Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Print the brand string if present instead o...



details:   https://anonhg.NetBSD.org/src/rev/668b4ec98449
branches:  trunk
changeset: 761060:668b4ec98449
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 19 21:39:41 2011 +0000

description:
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

diffstat:

 sys/arch/x86/x86/identcpu.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r 35be5c0265fe -r 668b4ec98449 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Wed Jan 19 21:07:13 2011 +0000
+++ b/sys/arch/x86/x86/identcpu.c       Wed Jan 19 21:39:41 2011 +0000
@@ -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");



Home | Main Index | Thread Index | Old Index