forked from xt-sys/exectos
Compare commits
1 Commits
whpx
...
cpuid-enha
Author | SHA1 | Date | |
---|---|---|---|
46cc5072af |
@@ -394,6 +394,13 @@ typedef struct _CPU_IDENTIFICATION
|
|||||||
USHORT Stepping;
|
USHORT Stepping;
|
||||||
CPU_VENDOR Vendor;
|
CPU_VENDOR Vendor;
|
||||||
UCHAR VendorName[13];
|
UCHAR VendorName[13];
|
||||||
|
UINT32 StandardFeaturesEcx;
|
||||||
|
UINT32 StandardFeaturesEdx;
|
||||||
|
UINT32 ExtendedFeaturesEcx;
|
||||||
|
UINT32 ExtendedFeaturesEdx;
|
||||||
|
UINT32 Standard7FeaturesEbx;
|
||||||
|
UINT32 Standard7FeaturesEcx;
|
||||||
|
UINT32 Standard7FeaturesEdx;
|
||||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||||
|
|
||||||
/* CPUID registers */
|
/* CPUID registers */
|
||||||
|
@@ -359,6 +359,10 @@ typedef struct _CPU_IDENTIFICATION
|
|||||||
USHORT Stepping;
|
USHORT Stepping;
|
||||||
CPU_VENDOR Vendor;
|
CPU_VENDOR Vendor;
|
||||||
UCHAR VendorName[13];
|
UCHAR VendorName[13];
|
||||||
|
UINT32 StandardFeaturesEcx;
|
||||||
|
UINT32 StandardFeaturesEdx;
|
||||||
|
UINT32 ExtendedFeaturesEcx;
|
||||||
|
UINT32 ExtendedFeaturesEdx;
|
||||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||||
|
|
||||||
/* CPUID registers */
|
/* CPUID registers */
|
||||||
|
@@ -64,9 +64,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
CPUID_REGISTERS CpuRegisters;
|
CPUID_REGISTERS CpuRegisters;
|
||||||
CPUID_SIGNATURE CpuSignature;
|
CPUID_SIGNATURE CpuSignature;
|
||||||
|
|
||||||
/* Not fully implemented yet */
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
|
|
||||||
/* Get current processor control block */
|
/* Get current processor control block */
|
||||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||||
|
|
||||||
@@ -122,7 +119,42 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
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;
|
||||||
|
|
||||||
|
/* Get CPU leaf 7 features (subleaf 0) */
|
||||||
|
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||||
|
CpuRegisters.Leaf = CPUID_GET_STANDARD7_FEATURES;
|
||||||
|
CpuRegisters.SubLeaf = 0;
|
||||||
|
CpuFunc::CpuId(&CpuRegisters);
|
||||||
|
|
||||||
|
/* Store CPU leaf 7 features in processor control block */
|
||||||
|
Prcb->CpuId.Standard7FeaturesEbx = CpuRegisters.Ebx;
|
||||||
|
Prcb->CpuId.Standard7FeaturesEcx = CpuRegisters.Ecx;
|
||||||
|
Prcb->CpuId.Standard7FeaturesEdx = 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -59,9 +59,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
CPUID_REGISTERS CpuRegisters;
|
CPUID_REGISTERS CpuRegisters;
|
||||||
CPUID_SIGNATURE CpuSignature;
|
CPUID_SIGNATURE CpuSignature;
|
||||||
|
|
||||||
/* Not fully implemented yet */
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
|
|
||||||
/* Get current processor control block */
|
/* Get current processor control block */
|
||||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||||
|
|
||||||
@@ -117,7 +114,30 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
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