cpuid: Rework AMD CPUID numbers

* If family is 0xF, we grab extended family and model
  like Intel does
* Idenfify AMD cpu's more correctly
This commit is contained in:
Alexander von Gluck IV
2012-06-04 11:01:39 -05:00
parent bd12d75f96
commit 548b1a4988
3 changed files with 108 additions and 44 deletions
@@ -117,16 +117,16 @@ arch_system_info_init(struct kernel_args *args)
}
if (base != B_CPU_x86) {
if (base == B_CPU_INTEL_x86) {
if (base == B_CPU_INTEL_x86
|| (base == B_CPU_AMD_x86 && cpu->arch.family == 0xF)) {
model = (cpu->arch.extended_family << 20)
+ (cpu->arch.extended_model << 16)
+ (cpu->arch.family << 4) + cpu->arch.model;
} else {
model = (cpu->arch.family << 4) +
cpu->arch.model;
// There isn't much useful information yet in the extended
// family and extended model fields of AMD processors
// and is probably undefined for others
model = (cpu->arch.family << 4)
+ cpu->arch.model;
// Isn't much useful extended family and model information
// yet on other processors.
}
}