StuBS
cpuid.h File Reference

CPUID queries information about the processor More...

#include "types.h"
Include dependency graph for cpuid.h:

Classes

union  CPUID::Reg
 Structure for register values returned by cpuid instruction. More...
 

Namespaces

 CPUID
 Query information about the processor.
 

Enumerations

enum  CPUID::Function {
  CPUID::HIGHEST_FUNCTION_PARAMETER = 0x0 , CPUID::MANUFACTURER_ID = 0x0 , CPUID::PROCESSOR_INFO = 0x1 , CPUID::FEATURE_BITS = 0x1 ,
  CPUID::CACHE_INFORMATION = 0x2 , CPUID::PROCESSOR_SERIAL_NUMBER = 0x3 , CPUID::HIGHEST_EXTENDED_FUNCTION = 0x80000000 , CPUID::EXTENDED_PROCESSOR_INFO = 0x80000001 ,
  CPUID::EXTENDED_FEATURE_BITS = 0x80000001 , CPUID::PROCESSOR_BRAND_STRING_1 = 0x80000002 , CPUID::PROCESSOR_BRAND_STRING_2 = 0x80000003 , CPUID::PROCESSOR_BRAND_STRING_3 = 0x80000004 ,
  CPUID::ADVANCED_POWER_MANAGEMENT = 0x80000007 , CPUID::ADDRESS_SIZES = 0x80000008
}
 
enum  CPUID::FeatureECX {
  CPUID::FEATURE_SSE3 = 1 << 0 , CPUID::FEATURE_PCLMUL = 1 << 1 , CPUID::FEATURE_DTES64 = 1 << 2 , CPUID::FEATURE_MONITOR = 1 << 3 ,
  CPUID::FEATURE_DS_CPL = 1 << 4 , CPUID::FEATURE_VMX = 1 << 5 , CPUID::FEATURE_SMX = 1 << 6 , CPUID::FEATURE_EST = 1 << 7 ,
  CPUID::FEATURE_TM2 = 1 << 8 , CPUID::FEATURE_SSSE3 = 1 << 9 , CPUID::FEATURE_CID = 1 << 10 , CPUID::FEATURE_SDBG = 1 << 11 ,
  CPUID::FEATURE_FMA = 1 << 12 , CPUID::FEATURE_CX16 = 1 << 13 , CPUID::FEATURE_ETPRD = 1 << 14 , CPUID::FEATURE_PDCM = 1 << 15 ,
  CPUID::FEATURE_PCIDE = 1 << 17 , CPUID::FEATURE_DCA = 1 << 18 , CPUID::FEATURE_SSE4_1 = 1 << 19 , CPUID::FEATURE_SSE4_2 = 1 << 20 ,
  CPUID::FEATURE_X2APIC = 1 << 21 , CPUID::FEATURE_MOVBE = 1 << 22 , CPUID::FEATURE_POPCNT = 1 << 23 , CPUID::FEATURE_TSC_DEADLINE = 1 << 24 ,
  CPUID::FEATURE_AES = 1 << 25 , CPUID::FEATURE_XSAVE = 1 << 26 , CPUID::FEATURE_OSXSAVE = 1 << 27 , CPUID::FEATURE_AVX = 1 << 28 ,
  CPUID::FEATURE_F16C = 1 << 29 , CPUID::FEATURE_RDRND = 1 << 30 , CPUID::FEATURE_HYPERVISOR = 1 << 31
}
 
enum  CPUID::FeatureEDX {
  CPUID::FEATURE_FPU = 1 << 0 , CPUID::FEATURE_VME = 1 << 1 , CPUID::FEATURE_DE = 1 << 2 , CPUID::FEATURE_PSE = 1 << 3 ,
  CPUID::FEATURE_TSC = 1 << 4 , CPUID::FEATURE_MSR = 1 << 5 , CPUID::FEATURE_PAE = 1 << 6 , CPUID::FEATURE_MCE = 1 << 7 ,
  CPUID::FEATURE_CX8 = 1 << 8 , CPUID::FEATURE_APIC = 1 << 9 , CPUID::FEATURE_SEP = 1 << 11 , CPUID::FEATURE_MTRR = 1 << 12 ,
  CPUID::FEATURE_PGE = 1 << 13 , CPUID::FEATURE_MCA = 1 << 14 , CPUID::FEATURE_CMOV = 1 << 15 , CPUID::FEATURE_PAT = 1 << 16 ,
  CPUID::FEATURE_PSE36 = 1 << 17 , CPUID::FEATURE_PSN = 1 << 18 , CPUID::FEATURE_CLF = 1 << 19 , CPUID::FEATURE_DTES = 1 << 21 ,
  CPUID::FEATURE_ACPI = 1 << 22 , CPUID::FEATURE_MMX = 1 << 23 , CPUID::FEATURE_FXSR = 1 << 24 , CPUID::FEATURE_SSE = 1 << 25 ,
  CPUID::FEATURE_SSE2 = 1 << 26 , CPUID::FEATURE_SS = 1 << 27 , CPUID::FEATURE_HTT = 1 << 28 , CPUID::FEATURE_TM1 = 1 << 29 ,
  CPUID::FEATURE_IA64 = 1 << 30 , CPUID::FEATURE_PBE = 1 << 31
}
 
enum  CPUID::ExtendedFeatureEDX {
  CPUID::EXTENDED_FEATURE_FPU = 1 << 0 , CPUID::EXTENDED_FEATURE_VME = 1 << 1 , CPUID::EXTENDED_FEATURE_DE = 1 << 2 , CPUID::EXTENDED_FEATURE_PSE = 1 << 3 ,
  CPUID::EXTENDED_FEATURE_TSC = 1 << 4 , CPUID::EXTENDED_FEATURE_MSR = 1 << 5 , CPUID::EXTENDED_FEATURE_PAE = 1 << 6 , CPUID::EXTENDED_FEATURE_MCE = 1 << 7 ,
  CPUID::EXTENDED_FEATURE_CX8 = 1 << 8 , CPUID::EXTENDED_FEATURE_APIC = 1 << 9 , CPUID::EXTENDED_FEATURE_SYSCALL = 1 << 11 , CPUID::EXTENDED_FEATURE_MTRR = 1 << 12 ,
  CPUID::EXTENDED_FEATURE_PGE = 1 << 13 , CPUID::EXTENDED_FEATURE_MCA = 1 << 14 , CPUID::EXTENDED_FEATURE_CMOV = 1 << 15 , CPUID::EXTENDED_FEATURE_PAT = 1 << 16 ,
  CPUID::EXTENDED_FEATURE_PSE36 = 1 << 17 , CPUID::EXTENDED_FEATURE_MP = 1 << 19 , CPUID::EXTENDED_FEATURE_NX = 1 << 20 , CPUID::EXTENDED_FEATURE_MMXEXT = 1 << 22 ,
  CPUID::EXTENDED_FEATURE_MMX = 1 << 23 , CPUID::EXTENDED_FEATURE_FXSR = 1 << 24 , CPUID::EXTENDED_FEATURE_FXSR_OPT = 1 << 25 , CPUID::EXTENDED_FEATURE_PDPE1GB = 1 << 26 ,
  CPUID::EXTENDED_FEATURE_RDTSCP = 1 << 27 , CPUID::EXTENDED_FEATURE_LM = 1 << 29 , CPUID::EXTENDED_FEATURE_3DNOWEXT = 1 << 30 , CPUID::EXTENDED_FEATURE_3DNOW = 1 << 31
}
 

Functions

Reg CPUID::get (Function eax)
 Get CPU identification and feature information. More...
 
bool CPUID::has (enum FeatureECX feature)
 Check if feature is provided by this system. More...
 
bool CPUID::has (enum FeatureEDX feature)
 Check if feature is provided by this system. More...
 
bool CPUID::has (enum ExtendedFeatureEDX feature)
 Check if feature is provided by this system. More...
 

Detailed Description

CPUID queries information about the processor