StuBS
cpuid.h File Reference

CPUID queries information about the processor More...

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

Classes

struct  CPUID::Reg.__unnamed19__
 

Namespaces

namespace  CPUID
 Query information about the processor.
 

Enumerations

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


Class Documentation

◆ CPUID::Reg.__unnamed19__

struct CPUID::Reg.__unnamed19__
Class Members
uint32_t ebx
uint32_t edx
uint32_t ecx
uint32_t eax