summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-03-11 14:17:37 +0000
committerjhb <jhb@FreeBSD.org>2010-03-11 14:17:37 +0000
commitd937b522a1d72eb6b270db5bf368d3fd1a79ebcf (patch)
treec0bd5272361b76058352eab0e52405982c0b3efd /sys
parent3a7e25160077d8c3e8c1d500d658bdf85e3db378 (diff)
downloadFreeBSD-src-d937b522a1d72eb6b270db5bf368d3fd1a79ebcf.zip
FreeBSD-src-d937b522a1d72eb6b270db5bf368d3fd1a79ebcf.tar.gz
Print out the family and model from the cpu_id. This is especially useful
given the advent of the extended family and extended model fields. The values are printed in hex to match their common usage in documentation. Submitted by: Alexander Best MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/identcpu.c4
-rw-r--r--sys/i386/i386/identcpu.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c
index aecec7a..c23102a 100644
--- a/sys/amd64/amd64/identcpu.c
+++ b/sys/amd64/amd64/identcpu.c
@@ -187,7 +187,9 @@ printcpuinfo(void)
if (cpu_vendor_id == CPU_VENDOR_INTEL ||
cpu_vendor_id == CPU_VENDOR_AMD ||
cpu_vendor_id == CPU_VENDOR_CENTAUR) {
- printf(" Stepping = %u", cpu_id & 0xf);
+ printf(" Family = %x", CPUID_TO_FAMILY(cpu_id));
+ printf(" Model = %x", CPUID_TO_MODEL(cpu_id));
+ printf(" Stepping = %u", cpu_id & CPUID_STEPPING);
if (cpu_high > 0) {
/*
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 62c27ab..931bfaf 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -672,9 +672,11 @@ printcpuinfo(void)
cpu_vendor_id == CPU_VENDOR_NSC ||
(cpu_vendor_id == CPU_VENDOR_CYRIX &&
((cpu_id & 0xf00) > 0x500))) {
- printf(" Stepping = %u", cpu_id & 0xf);
+ printf(" Family = %x", CPUID_TO_FAMILY(cpu_id));
+ printf(" Model = %x", CPUID_TO_MODEL(cpu_id));
+ printf(" Stepping = %u", cpu_id & CPUID_STEPPING);
if (cpu_vendor_id == CPU_VENDOR_CYRIX)
- printf(" DIR=0x%04x", cyrix_did);
+ printf("\n DIR=0x%04x", cyrix_did);
if (cpu_high > 0) {
/*
OpenPOWER on IntegriCloud