CPUID: Fix Intel processor identification

This commit is contained in:
zzz
2014-10-03 17:45:34 +00:00
parent 7b6f32e5b2
commit 1c2b6fc00e
4 changed files with 32 additions and 4 deletions

View File

@ -277,13 +277,19 @@ public class CPUID {
String mname = getCPUModelName();
if (mname != null)
System.out.println("CPU Model Name: " + mname);
System.out.println("CPU Vendor: " + getCPUVendorID());
String vendor = getCPUVendorID();
System.out.println("CPU Vendor: " + vendor);
// http://en.wikipedia.org/wiki/Cpuid
// http://web.archive.org/web/20110307080258/http://www.intel.com/Assets/PDF/appnote/241618.pdf
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf
int family = getCPUFamily();
int model = getCPUModel();
if (family == 15 ||
(family == 6 && "GenuineIntel".equals(vendor))) {
model += getCPUExtendedModel() << 4;
}
if (family == 15) {
family += getCPUExtendedFamily();
model += getCPUExtendedModel() << 4;
}
System.out.println("CPU Family: " + family);
System.out.println("CPU Model: " + model);

View File

@ -59,12 +59,18 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
private static String identifyCPU()
{
// http://en.wikipedia.org/wiki/Cpuid
// http://web.archive.org/web/20110307080258/http://www.intel.com/Assets/PDF/appnote/241618.pdf
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf
String modelString = null;
int family = CPUID.getCPUFamily();
int model = CPUID.getCPUModel();
if (family == 15 || family == 6) {
// Intel uses extended model for family = 15 or family = 6,
// which is not what wikipedia says
model += CPUID.getCPUExtendedModel() << 4;
}
if (family == 15) {
family += CPUID.getCPUExtendedFamily();
model += CPUID.getCPUExtendedModel() << 4;
}
switch (family) {
@ -160,6 +166,17 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
case 1:
modelString = "Pentium Pro";
break;
// Nehalem 45 nm
// As reported; can't find in any CPUID charts
case 2:
isPentium2Compatible = true;
isPentium3Compatible = true;
isPentiumMCompatible = true;
isCore2Compatible = true;
isCoreiCompatible = true;
isX64 = true;
modelString = "Core i7 (45nm)";
break;
case 3:
isPentium2Compatible = true;
modelString = "Pentium II (Klamath)";