84 DPRINT1(
"VIA CPUs not fully supported\n");
110 KiCpuId(&CpuInfo, 1);
119 Stepping = CpuSignature.
Model;
120 ExtendModel = (CpuSignature.
Family == 15);
121#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
122 if (CpuSignature.
Family == 6)
125#if (NTDDI_VERSION >= NTDDI_WIN8)
135 Stepping = (Stepping << 8) | CpuSignature.
Step;
217 VersionInfo.Ebx.Bits.MaximumAddressableIdsForLogicalProcessors;
269 if ((extendedFunction.
MaxLeaf & 0xffffff00) == 0x80000000)
286 if (ExtSig.
Amd.Edx.Bits.ThreeDNow) FeatureBits |=
KF_3DNOW;
314 if (ProcBasedCtls.
Bits.Allowed1.ActivateSecondaryControls)
319 if (ProcBasedCtls2.
Bits.Allowed1.EPT)
330 if ((extendedFunction.
MaxLeaf & 0xffffff00) == 0x80000000)
351 ULONG CpuFeatures = 0;
356 KiCpuId(&CpuInfo, 1);
357 CpuFeatures = CpuInfo.
Edx;
360 DPRINT1(
"Supported CPU features: ");
362#define print_kf_bit(kf_value) if (Prcb->FeatureBits & kf_value) DbgPrint(#kf_value " ")
407#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(#cpu_flag " ")
422 ULONG CacheRequests = 0,
i;
423 ULONG CurrentRegister;
442 KiCpuId(&CpuInfo, 0);
443 if (CpuInfo.
Eax >= 2)
449 KiCpuId(&CpuInfo, 2);
458 CacheRequests = CpuInfo.
Eax & 0xFF;
459 CpuInfo.
Eax &= 0xFFFFFF00;
466 for (
i = 0;
i < 4;
i++)
475 if (CurrentRegister & 0x80000000)
continue;
478 while (CurrentRegister)
481 RegisterByte = (
UCHAR)(CurrentRegister & 0xFF);
482 CurrentRegister >>= 8;
483 if (!RegisterByte)
continue;
490 if (((RegisterByte > 0x40) &&
491 (RegisterByte <= 0x49)) ||
492 ((RegisterByte > 0x80) &&
493 (RegisterByte <= 0x89)))
496 RegisterByte &= 0x0F;
504 }
while (--CacheRequests);
511 KiCpuId(&CpuInfo, 0x80000000);
512 if (CpuInfo.
Eax >= 6)
515 KiCpuId(&CpuInfo, 0x80000006);
579 ProcessorState->SpecialRegisters.Cr0 =
__readcr0();
580 ProcessorState->SpecialRegisters.Cr2 =
__readcr2();
581 ProcessorState->SpecialRegisters.Cr3 =
__readcr3();
582 ProcessorState->SpecialRegisters.Cr4 =
__readcr4();
583 ProcessorState->SpecialRegisters.Cr8 = __readcr8();
586 ProcessorState->SpecialRegisters.KernelDr0 =
__readdr(0);
587 ProcessorState->SpecialRegisters.KernelDr1 =
__readdr(1);
588 ProcessorState->SpecialRegisters.KernelDr2 =
__readdr(2);
589 ProcessorState->SpecialRegisters.KernelDr3 =
__readdr(3);
590 ProcessorState->SpecialRegisters.KernelDr6 =
__readdr(6);
591 ProcessorState->SpecialRegisters.KernelDr7 =
__readdr(7);
594 __sgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit);
595 __sldt(&ProcessorState->SpecialRegisters.Ldtr);
596 __str(&ProcessorState->SpecialRegisters.Tr);
597 __sidt(&ProcessorState->SpecialRegisters.Idtr.Limit);
599 ProcessorState->SpecialRegisters.MxCsr =
_mm_getcsr();
644 TrapFrame->PreviousMode);
#define MSR_IA32_VMX_PROCBASED_CTLS
#define MSR_IA32_VMX_PROCBASED_CTLS2
#define CPUID_AMD_SVM_FEATURES
#define CPUID_EXTENDED_FUNCTION
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS
#define CPUID_VERSION_INFO
#define CPUID_EXTENDED_STATE
#define CPUID_THERMAL_POWER_MANAGEMENT
#define CPUID_EXTENDED_STATE_SUB_LEAF
#define CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO
#define CPUID_EXTENDED_CPU_SIG
int strcmp(const char *String1, const char *String2)
OSVERSIONINFOW VersionInfo
#define KeLowerIrql(oldIrql)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
#define InterlockedExchangeAdd
PPC_QUAL void __writemsr(const unsigned long Value)
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
PPC_QUAL unsigned long long __readmsr()
PPC_QUAL void __wbinvd(void)
__INTRIN_INLINE unsigned long __readcr3(void)
__INTRIN_INLINE void __lidt(void *Source)
__INTRIN_INLINE void __cpuidex(int CPUInfo[4], int InfoType, int ECXValue)
__INTRIN_INLINE unsigned int __readdr(unsigned int reg)
__INTRIN_INLINE unsigned long __readcr4(void)
__INTRIN_INLINE unsigned long __readcr0(void)
__INTRIN_INLINE void __writecr3(unsigned int Data)
__INTRIN_INLINE unsigned long __readcr2(void)
__INTRIN_INLINE void __writecr0(unsigned int Data)
__INTRIN_INLINE void __sidt(void *Destination)
__INTRIN_INLINE void __writecr4(unsigned int Data)
__INTRIN_INLINE void __writedr(unsigned reg, unsigned int value)
#define KF_VIRT_FIRMWARE_ENABLED
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
#define UNREFERENCED_PARAMETER(P)
#define X86_MSR_KERNEL_GSBASE
VOID NTAPI KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN OUT PCONTEXT Context)
KAFFINITY KeActiveProcessors
VOID NTAPI KeContextToTrapFrame(PCONTEXT Context, PKEXCEPTION_FRAME ExeptionFrame, PKTRAP_FRAME TrapFrame, ULONG ContextFlags, KPROCESSOR_MODE PreviousMode)
ULONG NTAPI KeGetRecommendedSharedDataAlignment(VOID)
VOID NTAPI KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState)
VOID NTAPI KeFlushCurrentTb(VOID)
VOID NTAPI KiSetProcessorType(VOID)
VOID NTAPI KeFlushEntireTb(IN BOOLEAN Invalid, IN BOOLEAN AllProcessors)
VOID __cdecl KeSaveStateForHibernate(IN PKPROCESSOR_STATE State)
BOOLEAN KiSMTProcessorsPresent
ULONG64 NTAPI KiGetFeatureBits(VOID)
Evaluates the KeFeatureFlag bits for the current CPU.
BOOLEAN NTAPI KeInvalidateAllCaches(VOID)
NTSTATUS NTAPI KxRestoreFloatingPointState(IN PKFLOATING_SAVE FloatingState)
ULONG NTAPI KiGetCpuVendor(VOID)
volatile LONG KiTbFlushTimeStamp
VOID NTAPI KiSaveProcessorState(_In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame)
VOID NTAPI KeSetDmaIoCoherency(IN ULONG Coherency)
NTSTATUS NTAPI KxSaveFloatingPointState(OUT PKFLOATING_SAVE FloatingState)
VOID NTAPI KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
static const CHAR CmpIntelID[]
static const CHAR CmpAmdID[]
VOID NTAPI KiRestoreProcessorState(_Out_ PKTRAP_FRAME TrapFrame, _Out_ PKEXCEPTION_FRAME ExceptionFrame)
static const CHAR CmpCentaurID[]
VOID NTAPI KiGetCacheInformation(VOID)
union _CPU_SIGNATURE CPU_SIGNATURE
KAFFINITY NTAPI KeQueryActiveProcessors(VOID)
ULONG SecondLevelCacheSize
UCHAR LogicalProcessorsPerPhysicalProcessor
KPROCESSOR_STATE ProcessorState
KSPECIAL_REGISTERS SpecialRegisters
struct CPUID_AMD_SVM_FEATURES_EDX::@3724 Bits
CPUID_AMD_SVM_FEATURES_EDX Edx
struct CPUID_EXTENDED_CPU_SIG_REGS::@3722 Amd
struct CPUID_EXTENDED_CPU_SIG_REGS::@3721 Intel
CPUID_EXTENDED_STATE_SUB_LEAF_EAX Eax
struct CPUID_EXTENDED_STATE_SUB_LEAF_EAX::@3819 Bits
struct CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX::@3809 Bits
CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX Ebx
struct CPUID_THERMAL_POWER_MANAGEMENT_REGS::@3712 Undoc
struct MSR_IA32_VMX_PROCBASED_CTLS2_REGISTER::@3856 Bits
struct MSR_IA32_VMX_PROCBASED_CTLS_REGISTER::@3855 Bits
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
void _mm_setcsr(unsigned int a)
unsigned int _mm_getcsr(void)