hrev46659 adds 1 changeset to branch 'master' old head: 586d22c9baa3dc52df5dada8bdc2b9070b760efa new head: 4f357bc0713d4344e344a04013485821d1d739e1 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=4f357bc+%5E586d22c ---------------------------------------------------------------------------- 4f357bc: sysinfo: Improve x86 CPU information * Displays standard CPUID, and shows what the internal CPUID used by OS.h *should* be. * Should help out in identifying new CPU's as all end users have to do is run sysinfo to get the CPU info + value for OS.h [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev46659 Commit: 4f357bc0713d4344e344a04013485821d1d739e1 URL: http://cgit.haiku-os.org/haiku/commit/?id=4f357bc Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Sat Jan 11 22:10:12 2014 UTC ---------------------------------------------------------------------------- 2 files changed, 25 insertions(+) src/bin/sysinfo.cpp | 24 +++++++++++++++++++++ src/system/kernel/arch/x86/arch_system_info.cpp | 1 + ---------------------------------------------------------------------------- diff --git a/src/bin/sysinfo.cpp b/src/bin/sysinfo.cpp index 552b3b4..2b096d9 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 a1423ff..2e227f0 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)) {