Date: Thu, 11 Mar 2010 14:43:29 +0100 (CET)
From: Alexander Best <alexbestms@wwu.de>
To: <freebsd-hackers@FreeBSD.org>
Subject: Re: Re: [patch] extending {amd64|i386} cpu info
Message-ID: <permail-201003111343291e86ffa800005d56-a_best01@message-id.uni-muenster.de>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
since ed@ noticed that there's no CPUID_TO_STEPPING() macro this new patch
adds one. i checked and include/specialreg.h is only available on amd64, i386
and pc98. all the latter does however is:
#include <i386/specialreg.h>
cheers.
alex
[-- Attachment #2 --]
Index: amd64/include/specialreg.h
===================================================================
--- amd64/include/specialreg.h (revision 204977)
+++ amd64/include/specialreg.h (working copy)
@@ -169,6 +169,8 @@
#define CPUID_FAMILY 0x00000f00
#define CPUID_EXT_MODEL 0x000f0000
#define CPUID_EXT_FAMILY 0x0ff00000
+#define CPUID_TO_STEPPING(id) \
+ ((id) & CPUID_STEPPING)
#define CPUID_TO_MODEL(id) \
((((id) & CPUID_MODEL) >> 4) | \
(((id) & CPUID_EXT_MODEL) >> 12))
Index: amd64/amd64/identcpu.c
===================================================================
--- amd64/amd64/identcpu.c (revision 204977)
+++ amd64/amd64/identcpu.c (working copy)
@@ -187,7 +187,12 @@
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(" Stepping = %u"
+ " Model = %u"
+ " Family = %u",
+ CPUID_TO_STEPPING(cpu_id),
+ CPUID_TO_MODEL(cpu_id),
+ CPUID_TO_FAMILY(cpu_id));
if (cpu_high > 0) {
/*
Index: i386/include/specialreg.h
===================================================================
--- i386/include/specialreg.h (revision 204977)
+++ i386/include/specialreg.h (working copy)
@@ -166,6 +166,8 @@
#define CPUID_FAMILY 0x00000f00
#define CPUID_EXT_MODEL 0x000f0000
#define CPUID_EXT_FAMILY 0x0ff00000
+#define CPUID_TO_STEPPING(id) \
+ ((id) & CPUID_STEPPING)
#define CPUID_TO_MODEL(id) \
((((id) & CPUID_MODEL) >> 4) | \
((((id) & CPUID_FAMILY) >= 0x600) ? \
Index: i386/i386/identcpu.c
===================================================================
--- i386/i386/identcpu.c (revision 204977)
+++ i386/i386/identcpu.c (working copy)
@@ -672,7 +672,12 @@
cpu_vendor_id == CPU_VENDOR_NSC ||
(cpu_vendor_id == CPU_VENDOR_CYRIX &&
((cpu_id & 0xf00) > 0x500))) {
- printf(" Stepping = %u", cpu_id & 0xf);
+ printf(" Stepping = %u"
+ " Model = %u"
+ " Family = %u",
+ CPUID_TO_STEPPING(cpu_id),
+ CPUID_TO_MODEL(cpu_id),
+ CPUID_TO_FAMILY(cpu_id));
if (cpu_vendor_id == CPU_VENDOR_CYRIX)
printf(" DIR=0x%04x", cyrix_did);
if (cpu_high > 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-201003111343291e86ffa800005d56-a_best01>
