Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Mar 2010 17:21:41 +0100 (CET)
From:      Alexander Best <alexbestms@wwu.de>
To:        <freebsd-emulation@freebsd.org>
Subject:   [patch] fix wrong /proc/cpuinfo output in linprocfs
Message-ID:  <permail-20100322162141f0889e84000018b4-a_best01@message-id.uni-muenster.de>

index | next in thread | raw e-mail

[-- Attachment #1 --]
this patch fixes a bug in proc/cpuinfo where wrong values for 'model' and 'cpu
family' are being returned.

there's a pr dealing with this problem: kern/56451.

-- 
Alexander Best

[-- Attachment #2 --]
Index: sys/compat/linprocfs/linprocfs.c
===================================================================
--- sys/compat/linprocfs/linprocfs.c	(revision 205390)
+++ sys/compat/linprocfs/linprocfs.c	(working copy)
@@ -269,11 +269,11 @@
 		sbuf_printf(sb,
 		    "processor\t: %d\n"
 		    "vendor_id\t: %.20s\n"
-		    "cpu family\t: %d\n"
-		    "model\t\t: %d\n"
+		    "cpu family\t: %u\n"
+		    "model\t\t: %u\n"
 		    "model name\t: %s\n"
-		    "stepping\t: %d\n",
-		    i, cpu_vendor, class, cpu, model, cpu_id & 0xf);
+		    "stepping\t: %u\n",
+		    i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING);
 		/* XXX per-cpu vendor / class / model / id? */
 	}
 
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20100322162141f0889e84000018b4-a_best01>