Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Mar 2010 15:53:02 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r205646 - in stable/7/sys: amd64/amd64 i386/i386
Message-ID:  <201003251553.o2PFr2lg067337@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Mar 25 15:53:02 2010
New Revision: 205646
URL: http://svn.freebsd.org/changeset/base/205646

Log:
  MFC 205013:
  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.

Modified:
  stable/7/sys/amd64/amd64/identcpu.c
  stable/7/sys/i386/i386/identcpu.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/amd64/identcpu.c
==============================================================================
--- stable/7/sys/amd64/amd64/identcpu.c	Thu Mar 25 15:48:23 2010	(r205645)
+++ stable/7/sys/amd64/amd64/identcpu.c	Thu Mar 25 15:53:02 2010	(r205646)
@@ -186,7 +186,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) {
 			u_int cmp = 1, htt = 1;
 

Modified: stable/7/sys/i386/i386/identcpu.c
==============================================================================
--- stable/7/sys/i386/i386/identcpu.c	Thu Mar 25 15:48:23 2010	(r205645)
+++ stable/7/sys/i386/i386/identcpu.c	Thu Mar 25 15:53:02 2010	(r205646)
@@ -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) {
 			u_int cmp = 1, htt = 1;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003251553.o2PFr2lg067337>