From 1ec6a65f397400eb452dbc4519bc0567fd9de623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 1 Dec 2004 07:00:50 +0000 Subject: [PATCH] No longer prints out the extended processor signature on Intel CPUs as it's only reserved but not defined or used for those. If you have a stupid BIOS, the name string might not have been set; this is now supported, and the standard vendor string is used in that case. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10332 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bin/sysinfo.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/apps/bin/sysinfo.c b/src/apps/bin/sysinfo.c index e7e3b6ca21..850a500304 100644 --- a/src/apps/bin/sysinfo.c +++ b/src/apps/bin/sysinfo.c @@ -321,12 +321,13 @@ dump_cpu(system_info *info, int32 cpu) memset(buffer, 0, sizeof(buffer)); for (i = 0; i < 3; i++) { - get_cpuid(&cpuInfo, 0x80000002 + i, cpu); + cpuid_info nameInfo; + get_cpuid(&nameInfo, 0x80000002 + i, cpu); - memcpy(name, &cpuInfo.regs.eax, 4); - memcpy(name + 4, &cpuInfo.regs.ebx, 4); - memcpy(name + 8, &cpuInfo.regs.ecx, 4); - memcpy(name + 12, &cpuInfo.regs.edx, 4); + memcpy(name, &nameInfo.regs.eax, 4); + memcpy(name + 4, &nameInfo.regs.ebx, 4); + memcpy(name + 8, &nameInfo.regs.ecx, 4); + memcpy(name + 12, &nameInfo.regs.edx, 4); name += 16; } @@ -335,7 +336,15 @@ dump_cpu(system_info *info, int32 cpu) while (name[0] == ' ') name++; - printf("CPU #%ld: \"%s\"\n", cpu, name); + // the BIOS may not have set the processor name + if (name[0]) + printf("CPU #%ld: \"%s\"\n", cpu, name); + else { + // Intel CPUs don't seem to have the genuine vendor field + printf("CPU #%ld: %.12s\n", cpu, + (info->cpu_type & B_CPU_x86_VENDOR_MASK) == B_CPU_INTEL_x86 ? + baseInfo.eax_0.vendor_id : cpuInfo.eax_0.vendor_id); + } } else { printf("CPU #%ld: %.12s\n", cpu, baseInfo.eax_0.vendor_id); if (max_eax == 0) @@ -347,7 +356,7 @@ dump_cpu(system_info *info, int32 cpu) print_features(cpuInfo.eax_1.features); /* Extended CPUID */ - if (max_extended_eax >= 1) { + if (max_extended_eax >= 1 && (info->cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_INTEL_x86) { get_cpuid(&cpuInfo, 0x80000001, cpu); print_processor_signature(&cpuInfo, "extended: ");