[patch] fix wrong /proc/cpuinfo output in linprocfs
Alexander Best
alexbestms at wwu.de
Mon Mar 22 16:21:50 UTC 2010
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
-------------- next part --------------
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? */
}
More information about the freebsd-emulation
mailing list