diff options
author | jake <jake@FreeBSD.org> | 2001-11-18 03:05:56 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-11-18 03:05:56 +0000 |
commit | b1b4ae1667d70caf6bd3229ab80e7ca67bea66a6 (patch) | |
tree | 5d00529ea1fbd47bbcc112fa693d32a7f6ac835a /sys | |
parent | 03532122b2ceb10dfc34483331350ff45f90285d (diff) | |
download | FreeBSD-src-b1b4ae1667d70caf6bd3229ab80e7ca67bea66a6.zip FreeBSD-src-b1b4ae1667d70caf6bd3229ab80e7ca67bea66a6.tar.gz |
Implement hw.machine and hw.model sysctls.
Submitted by: tmm
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sparc64/sparc64/identcpu.c | 11 |
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) { |