Enhance CPU identification with standard and extended feature support
This commit is contained in:
@@ -59,9 +59,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
CPUID_REGISTERS CpuRegisters;
|
||||
CPUID_SIGNATURE CpuSignature;
|
||||
|
||||
/* Not fully implemented yet */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Get current processor control block */
|
||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||
|
||||
@@ -117,7 +114,30 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
||||
}
|
||||
|
||||
/* TODO: Store a list of CPU features in processor control block */
|
||||
/* Get CPU standard features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = CPUID_GET_STANDARD1_FEATURES;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU standard features in processor control block */
|
||||
Prcb->CpuId.StandardFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.StandardFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Get CPU extended features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = 0x80000001;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU extended features in processor control block */
|
||||
Prcb->CpuId.ExtendedFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.ExtendedFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Print CPU information */
|
||||
DebugPrint(L"CPU: Vendor %hs, Family 0x%X, Model 0x%X, Stepping 0x%X\n",
|
||||
Prcb->CpuId.VendorName,
|
||||
Prcb->CpuId.Family,
|
||||
Prcb->CpuId.Model,
|
||||
Prcb->CpuId.Stepping);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user