diff --git a/src/bin/sysinfo.cpp b/src/bin/sysinfo.cpp index 552b3b4f72..2b096d9a13 100644 --- a/src/bin/sysinfo.cpp +++ b/src/bin/sysinfo.cpp @@ -583,6 +583,30 @@ dump_cpu(system_info *info, int32 cpu) } get_cpuid(&cpuInfo, 1, cpu); + // Dump Raw CPUID, and internal CPUID we use... + printf("\tRaw CPUID: 0x%1" B_PRIx32 "%1" B_PRIx32 "0%1" B_PRIx32 + "%1" B_PRIx32 "%1" B_PRIx32 ", ", cpuInfo.eax_1.extended_family, + cpuInfo.eax_1.extended_model, cpuInfo.eax_1.family, + cpuInfo.eax_1.model, cpuInfo.eax_1.stepping); + + // This logic should be kept in-sync with x86/arch_system_info.cpp + // There is also src/tools/cpuidtool.cpp to do command line conversions + // of CPUID's to OS.h CPUID's + uint32 internalCPUID = 0; + if (((info->cpu_type & B_CPU_x86_VENDOR_MASK) == B_CPU_AMD_x86 + && cpuInfo.eax_1.family == 0xF) + || (info->cpu_type & B_CPU_x86_VENDOR_MASK) == B_CPU_INTEL_x86) { + internalCPUID = (cpuInfo.eax_1.extended_family << 20) + + (cpuInfo.eax_1.extended_model << 16) + + (cpuInfo.eax_1.family << 4) + cpuInfo.eax_1.model; + } else + internalCPUID = (cpuInfo.eax_1.family << 4) + cpuInfo.eax_1.model; + + internalCPUID += info->cpu_type & B_CPU_x86_VENDOR_MASK; + + // Matches OS.h define + printf("Haiku Internal ID (OS.h): 0x%" B_PRIx32 "\n", internalCPUID); + print_processor_signature(info, &cpuInfo, NULL); print_features(cpuInfo.eax_1.features); diff --git a/src/system/kernel/arch/x86/arch_system_info.cpp b/src/system/kernel/arch/x86/arch_system_info.cpp index a1423ffaa7..2e227f086b 100644 --- a/src/system/kernel/arch/x86/arch_system_info.cpp +++ b/src/system/kernel/arch/x86/arch_system_info.cpp @@ -120,6 +120,7 @@ arch_system_info_init(struct kernel_args *args) base = B_CPU_x86; } + // Any changes to this logic should be replicated to sysinfo.cpp if (base != B_CPU_x86) { if (base == B_CPU_INTEL_x86 || (base == B_CPU_AMD_x86 && cpu->arch.family == 0xF)) {