Module Name:    src
Committed By:   jmcneill
Date:           Wed Jan 19 21:39:42 UTC 2011

Modified Files:
        src/sys/arch/x86/x86: identcpu.c

Log Message:
Print the brand string if present instead of model (model is still
available via sysctl hw.model):

-cpu0 at mainbus0 apid 0: IDT/VIA 686-class, 1596MHz, id 0x6d0
+cpu0 at mainbus0 apid 0: VIA C7-M Processor 1600MHz, id 0x6d0


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/identcpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.20 src/sys/arch/x86/x86/identcpu.c:1.21
--- src/sys/arch/x86/x86/identcpu.c:1.20	Sun Apr 18 23:47:51 2010
+++ src/sys/arch/x86/x86/identcpu.c	Wed Jan 19 21:39:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.20 2010/04/18 23:47:51 jym Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.21 2011/01/19 21:39:41 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.20 2010/04/18 23:47:51 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.21 2011/01/19 21:39:41 jmcneill Exp $");
 
 #include "opt_enhanced_speedstep.h"
 #include "opt_intel_odcm.h"
@@ -694,9 +694,14 @@
 
 	snprintf(cpu_model, sizeof(cpu_model), "%s %d86-class",
 	    cpu_vendor_names[cpu_vendor], cpu_class + 3);
-	aprint_normal(": %s", cpu_model);
-	if (ci->ci_data.cpu_cc_freq != 0)
-		aprint_normal(", %dMHz", (int)(ci->ci_data.cpu_cc_freq / 1000000));
+	if (cpu_brand_string[0] != '\0') {
+		aprint_normal(": %s", cpu_brand_string);
+	} else {
+		aprint_normal(": %s", cpu_model);
+		if (ci->ci_data.cpu_cc_freq != 0)
+			aprint_normal(", %dMHz",
+			    (int)(ci->ci_data.cpu_cc_freq / 1000000));
+	}
 	if (ci->ci_signature != 0)
 		aprint_normal(", id 0x%x", ci->ci_signature);
 	aprint_normal("\n");

Reply via email to