mirror of
https://github.com/reactos/reactos.git
synced 2025-03-01 03:45:16 +00:00
[NTOS] Make KeFeatureBits 64 bit
This commit is contained in:
parent
77e4217919
commit
be3dde7698
10 changed files with 30 additions and 10 deletions
|
@ -664,7 +664,13 @@ QSI_DEF(SystemProcessorInformation)
|
||||||
#else
|
#else
|
||||||
Spi->MaximumProcessors = 0;
|
Spi->MaximumProcessors = 0;
|
||||||
#endif
|
#endif
|
||||||
Spi->ProcessorFeatureBits = KeFeatureBits;
|
|
||||||
|
/* According to Geoff Chappell, on Win 8.1 x64 / Win 10 x86, where this
|
||||||
|
field is extended to 64 bits, it continues to produce only the low 32
|
||||||
|
bits. For the full value, use SYSTEM_PROCESSOR_FEATURES_INFORMATION.
|
||||||
|
See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/processor.htm
|
||||||
|
*/
|
||||||
|
Spi->ProcessorFeatureBits = (ULONG)KeFeatureBits;
|
||||||
|
|
||||||
DPRINT("Arch %u Level %u Rev 0x%x\n", Spi->ProcessorArchitecture,
|
DPRINT("Arch %u Level %u Rev 0x%x\n", Spi->ProcessorArchitecture,
|
||||||
Spi->ProcessorLevel, Spi->ProcessorRevision);
|
Spi->ProcessorLevel, Spi->ProcessorRevision);
|
||||||
|
|
|
@ -462,7 +462,7 @@ NTAPI
|
||||||
KiSetProcessorType(VOID);
|
KiSetProcessorType(VOID);
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
ULONG
|
ULONG64
|
||||||
NTAPI
|
NTAPI
|
||||||
KiGetFeatureBits(VOID);
|
KiGetFeatureBits(VOID);
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ extern BOOLEAN ExCmosClockIsSane;
|
||||||
extern USHORT KeProcessorArchitecture;
|
extern USHORT KeProcessorArchitecture;
|
||||||
extern USHORT KeProcessorLevel;
|
extern USHORT KeProcessorLevel;
|
||||||
extern USHORT KeProcessorRevision;
|
extern USHORT KeProcessorRevision;
|
||||||
extern ULONG KeFeatureBits;
|
extern ULONG64 KeFeatureBits;
|
||||||
extern KNODE KiNode0;
|
extern KNODE KiNode0;
|
||||||
extern PKNODE KeNodeBlock[1];
|
extern PKNODE KeNodeBlock[1];
|
||||||
extern UCHAR KeNumberNodes;
|
extern UCHAR KeNumberNodes;
|
||||||
|
|
|
@ -233,7 +233,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
/* Set boot-level flags */
|
/* Set boot-level flags */
|
||||||
KeFeatureBits = Prcb->FeatureBits;
|
KeFeatureBits = Prcb->FeatureBits | (ULONG64)Prcb->FeatureBitsHigh << 32;
|
||||||
|
|
||||||
/* Initialize 8/16 bit SList support */
|
/* Initialize 8/16 bit SList support */
|
||||||
RtlpUse16ByteSLists = (KeFeatureBits & KF_CMPXCHG16B) ? TRUE : FALSE;
|
RtlpUse16ByteSLists = (KeFeatureBits & KF_CMPXCHG16B) ? TRUE : FALSE;
|
||||||
|
|
|
@ -209,13 +209,13 @@ KiSetProcessorType(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
ULONG
|
ULONG64
|
||||||
NTAPI
|
NTAPI
|
||||||
KiGetFeatureBits(VOID)
|
KiGetFeatureBits(VOID)
|
||||||
{
|
{
|
||||||
PKPRCB Prcb = KeGetCurrentPrcb();
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||||
ULONG Vendor;
|
ULONG Vendor;
|
||||||
ULONG FeatureBits = KF_WORKING_PTE;
|
ULONG64 FeatureBits = KF_WORKING_PTE;
|
||||||
CPU_INFO CpuInfo, DummyCpuInfo;
|
CPU_INFO CpuInfo, DummyCpuInfo;
|
||||||
UCHAR Ccr1;
|
UCHAR Ccr1;
|
||||||
BOOLEAN ExtendedCPUID = TRUE;
|
BOOLEAN ExtendedCPUID = TRUE;
|
||||||
|
|
|
@ -384,7 +384,7 @@ KiVerifyCpuFeatures(PKPRCB Prcb)
|
||||||
KeBugCheckEx(UNSUPPORTED_PROCESSOR, 0x386, 0, 0, 0);
|
KeBugCheckEx(UNSUPPORTED_PROCESSOR, 0x386, 0, 0, 0);
|
||||||
|
|
||||||
// 3. Finally, obtain CPU features.
|
// 3. Finally, obtain CPU features.
|
||||||
ULONG FeatureBits = KiGetFeatureBits();
|
ULONG64 FeatureBits = KiGetFeatureBits();
|
||||||
|
|
||||||
// 4. Verify it supports everything we need.
|
// 4. Verify it supports everything we need.
|
||||||
if (!(FeatureBits & KF_RDTSC))
|
if (!(FeatureBits & KF_RDTSC))
|
||||||
|
@ -423,7 +423,8 @@ KiVerifyCpuFeatures(PKPRCB Prcb)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Save feature bits.
|
// 5. Save feature bits.
|
||||||
Prcb->FeatureBits = FeatureBits;
|
Prcb->FeatureBits = (ULONG)FeatureBits;
|
||||||
|
Prcb->FeatureBitsHigh = FeatureBits >> 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
|
@ -445,7 +446,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
|
||||||
|
|
||||||
/* Set boot-level flags */
|
/* Set boot-level flags */
|
||||||
if (Number == 0)
|
if (Number == 0)
|
||||||
KeFeatureBits = Prcb->FeatureBits;
|
KeFeatureBits = Prcb->FeatureBits | (ULONG64)Prcb->FeatureBitsHigh << 32;
|
||||||
|
|
||||||
/* Set the default NX policy (opt-in) */
|
/* Set the default NX policy (opt-in) */
|
||||||
SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_OPTIN;
|
SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_OPTIN;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
USHORT KeProcessorArchitecture;
|
USHORT KeProcessorArchitecture;
|
||||||
USHORT KeProcessorLevel;
|
USHORT KeProcessorLevel;
|
||||||
USHORT KeProcessorRevision;
|
USHORT KeProcessorRevision;
|
||||||
ULONG KeFeatureBits;
|
ULONG64 KeFeatureBits;
|
||||||
|
|
||||||
/* System call count */
|
/* System call count */
|
||||||
ULONG KiServiceLimit = NUMBER_OF_SYSCALLS;
|
ULONG KiServiceLimit = NUMBER_OF_SYSCALLS;
|
||||||
|
|
|
@ -939,8 +939,11 @@ typedef struct _KPRCB
|
||||||
ULONG CacheCount;
|
ULONG CacheCount;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
|
#if (NTDDI_VERSION < NTDDI_WINBLUE)
|
||||||
|
// On Win 8.1+ the FeatureBits field is extended to 64 bits
|
||||||
ULONG FeatureBitsHigh;
|
ULONG FeatureBitsHigh;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
} KPRCB, *PKPRCB;
|
} KPRCB, *PKPRCB;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -761,7 +761,11 @@ typedef struct _SYSTEM_PROCESSOR_INFORMATION
|
||||||
#else
|
#else
|
||||||
USHORT MaximumProcessors;
|
USHORT MaximumProcessors;
|
||||||
#endif
|
#endif
|
||||||
|
#if (NTDDI_VERSION >= NTDDI_WIN10) || ((NTDDI_VERSION >= NTDDI_WINBLUE) && defined(_WIN64))
|
||||||
|
ULONG64 ProcessorFeatureBits;
|
||||||
|
#else
|
||||||
ULONG ProcessorFeatureBits;
|
ULONG ProcessorFeatureBits;
|
||||||
|
#endif
|
||||||
} SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
|
} SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
|
||||||
|
|
||||||
// Class 2
|
// Class 2
|
||||||
|
|
|
@ -781,6 +781,12 @@ typedef struct _KPRCB
|
||||||
ULONG PackageProcessorSet;
|
ULONG PackageProcessorSet;
|
||||||
ULONG CoreProcessorSet;
|
ULONG CoreProcessorSet;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
#if (NTDDI_VERSION < NTDDI_WIN10)
|
||||||
|
// On Win 10+ the FeatureBits field is extended to 64 bits
|
||||||
|
ULONG FeatureBitsHigh;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
} KPRCB, *PKPRCB;
|
} KPRCB, *PKPRCB;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue