diff --git a/headers/os/kernel/OS.h b/headers/os/kernel/OS.h index c3ccad50a8..3af0052c6a 100644 --- a/headers/os/kernel/OS.h +++ b/headers/os/kernel/OS.h @@ -455,6 +455,7 @@ typedef enum cpu_types { B_CPU_INTEL_PENTIUM_IV_MODEL_2, B_CPU_INTEL_PENTIUM_IV_MODEL_3, B_CPU_INTEL_PENTIUM_IV_MODEL_4, + B_CPU_INTEL_PENTIUM_CORE_2_EXTREME = 0x1467, /* AMD */ diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index df979769eb..803edc6816 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -189,8 +189,10 @@ typedef struct arch_cpu_info { const char *vendor_name; int type; int family; + int extended_family; int stepping; int model; + int extended_model; char feature_string[256]; // local TSS for this cpu diff --git a/headers/private/shared/cpu_type.h b/headers/private/shared/cpu_type.h index 1f32ca5ad6..6be1135fdc 100644 --- a/headers/private/shared/cpu_type.h +++ b/headers/private/shared/cpu_type.h @@ -8,6 +8,7 @@ */ #include +#include #include @@ -48,7 +49,14 @@ get_cpu_vendor_string(enum cpu_types type) return "VIA"; return "IDT"; case B_CPU_RISE_x86: - return "Rise"; + // TODO(bga): There is a conflict between new Intel + // CPUs that sets extended model bits and the RISE + // CPUs. For now we check for it here but there is + // probably a better solution. + if (type == B_CPU_INTEL_PENTIUM_CORE_2_EXTREME) + return "Intel"; + else + return "Rise"; case B_CPU_TRANSMETA_x86: return "Transmeta"; @@ -115,6 +123,8 @@ get_cpu_model_string(system_info *info) case B_CPU_INTEL_PENTIUM_IV_MODEL_3: case B_CPU_INTEL_PENTIUM_IV_MODEL_4: return "Pentium 4"; + case B_CPU_INTEL_PENTIUM_CORE_2_EXTREME: + return "Core 2 Extreme"; /* AMD */ case B_CPU_AMD_K5_MODEL_0: diff --git a/src/system/kernel/arch/x86/arch_cpu.c b/src/system/kernel/arch/x86/arch_cpu.c index c9579d39cc..ad5d25308a 100644 --- a/src/system/kernel/arch/x86/arch_cpu.c +++ b/src/system/kernel/arch/x86/arch_cpu.c @@ -356,10 +356,15 @@ detect_cpu(int curr_cpu) get_current_cpuid(&cpuid, 1); cpu->arch.type = cpuid.eax_1.type; cpu->arch.family = cpuid.eax_1.family; + cpu->arch.extended_family = cpuid.eax_1.extended_family; cpu->arch.model = cpuid.eax_1.model; + cpu->arch.extended_model = cpuid.eax_1.extended_model; cpu->arch.stepping = cpuid.eax_1.stepping; - dprintf("CPU %d: type %d family %d model %d stepping %d, string '%s'\n", - curr_cpu, cpu->arch.type, cpu->arch.family, cpu->arch.model, cpu->arch.stepping, vendor_str); + dprintf("CPU %d: type %d family %d extended_family %d model %d " + "extended_model %d stepping %d, string '%s'\n", + curr_cpu, cpu->arch.type, cpu->arch.family, + cpu->arch.extended_family, cpu->arch.model, + cpu->arch.extended_model, cpu->arch.stepping, vendor_str); // figure out what vendor we have here diff --git a/src/system/kernel/arch/x86/arch_system_info.c b/src/system/kernel/arch/x86/arch_system_info.c index 935e9b6197..68499e3ea5 100644 --- a/src/system/kernel/arch/x86/arch_system_info.c +++ b/src/system/kernel/arch/x86/arch_system_info.c @@ -115,9 +115,13 @@ arch_system_info_init(struct kernel_args *args) } if (base != B_CPU_x86) - model = (cpu->arch.family << 4) + cpu->arch.model; + model = (cpu->arch.extended_family << 14) + + (cpu->arch.extended_model << 10) + (cpu->arch.family << 4) + + cpu->arch.model; - sCpuRevision = (cpu->arch.type << 12) + sCpuRevision = (cpu->arch.extended_family << 18) + | (cpu->arch.extended_model << 14) + | (cpu->arch.type << 12) | (cpu->arch.family << 8) | (cpu->arch.model << 4) | cpu->arch.stepping;