summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-11-18 03:05:56 +0000
committerjake <jake@FreeBSD.org>2001-11-18 03:05:56 +0000
commitb1b4ae1667d70caf6bd3229ab80e7ca67bea66a6 (patch)
tree5d00529ea1fbd47bbcc112fa693d32a7f6ac835a
parent03532122b2ceb10dfc34483331350ff45f90285d (diff)
downloadFreeBSD-src-b1b4ae1667d70caf6bd3229ab80e7ca67bea66a6.zip
FreeBSD-src-b1b4ae1667d70caf6bd3229ab80e7ca67bea66a6.tar.gz
Implement hw.machine and hw.model sysctls.
Submitted by: tmm
-rw-r--r--sys/sparc64/sparc64/identcpu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/identcpu.c b/sys/sparc64/sparc64/identcpu.c
index f56d860..0cc00ae 100644
--- a/sys/sparc64/sparc64/identcpu.c
+++ b/sys/sparc64/sparc64/identcpu.c
@@ -10,11 +10,21 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
#include <machine/cpufunc.h>
#include <machine/md_var.h>
#include <machine/ver.h>
+static char machine[] = "sparc64";
+SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
+ machine, 0, "Machine class");
+
+static char cpu_model[128];
+SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
+ cpu_model, 0, "Machine model");
+
void
cpu_identify(unsigned int freq)
{
@@ -62,6 +72,7 @@ cpu_identify(unsigned int freq)
return;
}
+ snprintf(cpu_model, sizeof(cpu_model), "%s %s", manus, impls);
printf("CPU: %s %s Processor (%d.%02d MHZ CPU)\n", manus, impls,
(freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
if (bootverbose) {
OpenPOWER on IntegriCloud