mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:05:52 +00:00
[NTOS:KE/x64] Detect CPU vendor properly and store value in PRCB
Also generate processor identifier properly based on this value on the Configuration Manager machine-dependent initialization. Update processor driver INF file accordingly. CORE-17970 CORE-14922
This commit is contained in:
parent
a4bd2449ad
commit
84cc81ee29
3 changed files with 54 additions and 11 deletions
|
@ -62,6 +62,9 @@ HKR, , Icon, 0, "-28"
|
||||||
%IntelP4Processor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_15
|
%IntelP4Processor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86_Family_15
|
||||||
%IntelProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86
|
%IntelProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_x86
|
||||||
|
|
||||||
|
[Intel.NTAMD64]
|
||||||
|
%IntelProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineIntel_-_EM64T
|
||||||
|
|
||||||
[AMD]
|
[AMD]
|
||||||
%AMDK6Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_7
|
%AMDK6Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_7
|
||||||
%AMDK62Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_8
|
%AMDK62Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_5_Model_8
|
||||||
|
@ -74,6 +77,10 @@ HKR, , Icon, 0, "-28"
|
||||||
%AMDQProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_17
|
%AMDQProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86_Family_17
|
||||||
%AMDProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86
|
%AMDProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_x86
|
||||||
|
|
||||||
|
[AMD.NTAMD64]
|
||||||
|
%AMDK8Processor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_AMD64_Family_15
|
||||||
|
%AMDProcessor.DeviceDesc% = Processr_Inst,ACPI\AuthenticAMD_-_AMD64
|
||||||
|
|
||||||
[Transmeta]
|
[Transmeta]
|
||||||
%TransmetaProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineTMx86_-_x86
|
%TransmetaProcessor.DeviceDesc% = Processr_Inst,ACPI\GenuineTMx86_-_x86
|
||||||
|
|
||||||
|
@ -84,6 +91,9 @@ HKR, , Icon, 0, "-28"
|
||||||
%ViaNANOProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_15
|
%ViaNANOProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86_Family_6_Model_15
|
||||||
%ViaProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86
|
%ViaProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_x86
|
||||||
|
|
||||||
|
[VIA.NTAMD64]
|
||||||
|
%ViaProcessor.DeviceDesc% = Processr_Inst,ACPI\CentaurHauls_-_VIA64
|
||||||
|
|
||||||
;---------------------------- Processr Driver ---------------------------
|
;---------------------------- Processr Driver ---------------------------
|
||||||
|
|
||||||
[Processr_Inst.NT]
|
[Processr_Inst.NT]
|
||||||
|
|
|
@ -14,8 +14,14 @@
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
#ifdef _M_IX86
|
||||||
PCHAR CmpID1 = "80%u86-%c%x";
|
PCHAR CmpID1 = "80%u86-%c%x";
|
||||||
PCHAR CmpID2 = "x86 Family %u Model %u Stepping %u";
|
PCHAR CmpID2 = "x86 Family %u Model %u Stepping %u";
|
||||||
|
#else
|
||||||
|
PCHAR CmpID1 = "EM64T Family %u Model %u Stepping %u";
|
||||||
|
PCHAR CmpID2 = "AMD64 Family %u Model %u Stepping %u";
|
||||||
|
PCHAR CmpID3 = "VIA64 Family %u Model %u Stepping %u";
|
||||||
|
#endif
|
||||||
PCHAR CmpBiosStrings[] =
|
PCHAR CmpBiosStrings[] =
|
||||||
{
|
{
|
||||||
"Ver",
|
"Ver",
|
||||||
|
@ -346,6 +352,9 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||||
/* Loop all CPUs */
|
/* Loop all CPUs */
|
||||||
for (i = 0; i < KeNumberProcessors; i++)
|
for (i = 0; i < KeNumberProcessors; i++)
|
||||||
{
|
{
|
||||||
|
#ifdef _M_AMD64
|
||||||
|
PCHAR CmpID;
|
||||||
|
#endif
|
||||||
/* Get the PRCB */
|
/* Get the PRCB */
|
||||||
Prcb = KiProcessorBlock[i];
|
Prcb = KiProcessorBlock[i];
|
||||||
|
|
||||||
|
@ -357,6 +366,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||||
ConfigData.ComponentEntry.AffinityMask = AFFINITY_MASK(i);
|
ConfigData.ComponentEntry.AffinityMask = AFFINITY_MASK(i);
|
||||||
ConfigData.ComponentEntry.Identifier = Buffer;
|
ConfigData.ComponentEntry.Identifier = Buffer;
|
||||||
|
|
||||||
|
#if defined(_M_IX86)
|
||||||
/* Check if the CPU doesn't support CPUID */
|
/* Check if the CPU doesn't support CPUID */
|
||||||
if (!Prcb->CpuID)
|
if (!Prcb->CpuID)
|
||||||
{
|
{
|
||||||
|
@ -376,6 +386,32 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||||
(Prcb->CpuStep >> 8),
|
(Prcb->CpuStep >> 8),
|
||||||
Prcb->CpuStep & 0xff);
|
Prcb->CpuStep & 0xff);
|
||||||
}
|
}
|
||||||
|
#elif defined(_M_AMD64)
|
||||||
|
if (Prcb->CpuVendor == CPU_VIA)
|
||||||
|
{
|
||||||
|
/* This is VIA64 family */
|
||||||
|
CmpID = CmpID3;
|
||||||
|
}
|
||||||
|
else if (Prcb->CpuVendor == CPU_AMD)
|
||||||
|
{
|
||||||
|
/* This is AMD64 family */
|
||||||
|
CmpID = CmpID2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* This is generic EM64T family */
|
||||||
|
CmpID = CmpID1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ID string has the same style for all 64-bit CPUs */
|
||||||
|
sprintf(Buffer,
|
||||||
|
CmpID,
|
||||||
|
Prcb->CpuType,
|
||||||
|
(Prcb->CpuStep >> 8),
|
||||||
|
Prcb->CpuStep & 0xff);
|
||||||
|
#else
|
||||||
|
#error Unknown architecture
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Save the ID string length now that we've created it */
|
/* Save the ID string length now that we've created it */
|
||||||
ConfigData.ComponentEntry.IdentifierLength = (ULONG)strlen(Buffer) + 1;
|
ConfigData.ComponentEntry.IdentifierLength = (ULONG)strlen(Buffer) + 1;
|
||||||
|
|
|
@ -33,10 +33,7 @@ volatile LONG KiTbFlushTimeStamp;
|
||||||
/* CPU Signatures */
|
/* CPU Signatures */
|
||||||
static const CHAR CmpIntelID[] = "GenuineIntel";
|
static const CHAR CmpIntelID[] = "GenuineIntel";
|
||||||
static const CHAR CmpAmdID[] = "AuthenticAMD";
|
static const CHAR CmpAmdID[] = "AuthenticAMD";
|
||||||
static const CHAR CmpCyrixID[] = "CyrixInstead";
|
|
||||||
static const CHAR CmpTransmetaID[] = "GenuineTMx86";
|
|
||||||
static const CHAR CmpCentaurID[] = "CentaurHauls";
|
static const CHAR CmpCentaurID[] = "CentaurHauls";
|
||||||
static const CHAR CmpRiseID[] = "RiseRiseRise";
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
@ -89,25 +86,25 @@ KiGetCpuVendor(VOID)
|
||||||
/* Now check the CPU Type */
|
/* Now check the CPU Type */
|
||||||
if (!strcmp((PCHAR)Prcb->VendorString, CmpIntelID))
|
if (!strcmp((PCHAR)Prcb->VendorString, CmpIntelID))
|
||||||
{
|
{
|
||||||
return CPU_INTEL;
|
Prcb->CpuVendor = CPU_INTEL;
|
||||||
}
|
}
|
||||||
else if (!strcmp((PCHAR)Prcb->VendorString, CmpAmdID))
|
else if (!strcmp((PCHAR)Prcb->VendorString, CmpAmdID))
|
||||||
{
|
{
|
||||||
return CPU_AMD;
|
Prcb->CpuVendor = CPU_AMD;
|
||||||
}
|
}
|
||||||
else if (!strcmp((PCHAR)Prcb->VendorString, CmpCentaurID))
|
else if (!strcmp((PCHAR)Prcb->VendorString, CmpCentaurID))
|
||||||
{
|
{
|
||||||
DPRINT1("VIA CPUs not fully supported\n");
|
DPRINT1("VIA CPUs not fully supported\n");
|
||||||
return CPU_VIA;
|
Prcb->CpuVendor = CPU_VIA;
|
||||||
}
|
}
|
||||||
else if (!strcmp((PCHAR)Prcb->VendorString, CmpRiseID))
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("Rise CPUs not fully supported\n");
|
/* Invalid CPU */
|
||||||
return 0;
|
DPRINT1("%s CPU support not fully tested!\n", Prcb->VendorString);
|
||||||
|
Prcb->CpuVendor = CPU_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invalid CPU */
|
return Prcb->CpuVendor;
|
||||||
return CPU_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue