mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
[NTOS:KE/x86] Detect more KeFeatureBits
This commit is contained in:
parent
d09eb6f856
commit
9b002025d4
3 changed files with 27 additions and 0 deletions
|
@ -22,6 +22,14 @@ extern "C"
|
||||||
#define KD_BREAKPOINT_SIZE sizeof(UCHAR)
|
#define KD_BREAKPOINT_SIZE sizeof(UCHAR)
|
||||||
#define KD_BREAKPOINT_VALUE 0xCC
|
#define KD_BREAKPOINT_VALUE 0xCC
|
||||||
|
|
||||||
|
/* CPUID 1 - ECX flags */
|
||||||
|
#define X86_FEATURE_SSE3 0x00000001
|
||||||
|
#define X86_FEATURE_SSSE3 0x00000200
|
||||||
|
#define X86_FEATURE_SSE4_1 0x00080000
|
||||||
|
#define X86_FEATURE_SSE4_2 0x00100000
|
||||||
|
#define X86_FEATURE_XSAVE 0x04000000
|
||||||
|
#define X86_FEATURE_RDRAND 0x40000000
|
||||||
|
|
||||||
/* CPUID 1 - EDX flags */
|
/* CPUID 1 - EDX flags */
|
||||||
#define X86_FEATURE_FPU 0x00000001 /* x87 FPU is present */
|
#define X86_FEATURE_FPU 0x00000001 /* x87 FPU is present */
|
||||||
#define X86_FEATURE_VME 0x00000002 /* Virtual 8086 Extensions are present */
|
#define X86_FEATURE_VME 0x00000002 /* Virtual 8086 Extensions are present */
|
||||||
|
|
|
@ -361,6 +361,14 @@ KiGetFeatureBits(VOID)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get some features from ECX */
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_SSE3) FeatureBits |= KF_SSE3;
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_SSSE3) FeatureBits |= KF_SSSE3;
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_SSE4_1) FeatureBits |= KF_SSE4_1;
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_SSE4_2) FeatureBits |= KF_SSE4_2;
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_XSAVE) FeatureBits |= KF_XSTATE;
|
||||||
|
if (CpuInfo.Ecx & X86_FEATURE_RDRAND) FeatureBits |= KF_RDRAND;
|
||||||
|
|
||||||
/* Set the current features */
|
/* Set the current features */
|
||||||
CpuFeatures = CpuInfo.Edx;
|
CpuFeatures = CpuInfo.Edx;
|
||||||
|
|
||||||
|
|
|
@ -572,6 +572,17 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
|
||||||
(KeFeatureBits & KF_3DNOW) ? TRUE: FALSE;
|
(KeFeatureBits & KF_3DNOW) ? TRUE: FALSE;
|
||||||
SharedUserData->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] =
|
SharedUserData->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] =
|
||||||
(KeFeatureBits & KF_RDTSC) ? TRUE: FALSE;
|
(KeFeatureBits & KF_RDTSC) ? TRUE: FALSE;
|
||||||
|
SharedUserData->ProcessorFeatures[PF_RDRAND_INSTRUCTION_AVAILABLE] =
|
||||||
|
(KeFeatureBits & KF_RDRAND) ? TRUE : FALSE;
|
||||||
|
// Note: On x86 we lack support for saving/restoring SSE state
|
||||||
|
SharedUserData->ProcessorFeatures[PF_SSE3_INSTRUCTIONS_AVAILABLE] =
|
||||||
|
(KeFeatureBits & KF_SSE3) ? TRUE : FALSE;
|
||||||
|
SharedUserData->ProcessorFeatures[PF_SSSE3_INSTRUCTIONS_AVAILABLE] =
|
||||||
|
(KeFeatureBits & KF_SSSE3) ? TRUE : FALSE;
|
||||||
|
SharedUserData->ProcessorFeatures[PF_SSE4_1_INSTRUCTIONS_AVAILABLE] =
|
||||||
|
(KeFeatureBits & KF_SSE4_1) ? TRUE : FALSE;
|
||||||
|
SharedUserData->ProcessorFeatures[PF_SSE4_2_INSTRUCTIONS_AVAILABLE] =
|
||||||
|
(KeFeatureBits & KF_SSE4_2) ? TRUE : FALSE;
|
||||||
|
|
||||||
/* Set up the thread-related fields in the PRCB */
|
/* Set up the thread-related fields in the PRCB */
|
||||||
Prcb->CurrentThread = InitThread;
|
Prcb->CurrentThread = InitThread;
|
||||||
|
|
Loading…
Reference in a new issue