diff options
author | marcel <marcel@FreeBSD.org> | 2007-01-14 21:45:05 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-01-14 21:45:05 +0000 |
commit | 62b15d9b508f7c3085d34682b2b77ee3d8f2dbfe (patch) | |
tree | 143ffccdc5baf9b29465abdea9fc6c66f441fe29 /sys/powerpc | |
parent | 3251ecf31adcc7943849240ac1b38c7b4ae0303e (diff) | |
download | FreeBSD-src-62b15d9b508f7c3085d34682b2b77ee3d8f2dbfe.zip FreeBSD-src-62b15d9b508f7c3085d34682b2b77ee3d8f2dbfe.tar.gz |
Propagate the CPU model to the hw.model sysctl.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/machdep.c | 3 | ||||
-rw-r--r-- | sys/powerpc/powerpc/cpu.c | 5 | ||||
-rw-r--r-- | sys/powerpc/powerpc/machdep.c | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 5b158d0..3aa68d9 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -136,9 +136,6 @@ vm_offset_t kstack0_phys; char machine[] = "powerpc"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); -static char model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); - static int cacheline_size = CACHELINESIZE; SYSCTL_INT(_machdep, CPU_CACHELINE, cacheline_size, CTLFLAG_RD, &cacheline_size, 0, ""); diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index b409a3c..7895c77 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -63,6 +63,7 @@ #include <sys/bus.h> #include <sys/conf.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <machine/bus.h> #include <machine/hid.h> @@ -99,6 +100,9 @@ static const struct cputab models[] = { { "Unknown PowerPC CPU", 0, REVFMT_HEX } }; +static char model[64]; +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); + static register_t l2cr_config = 0; static void cpu_print_speed(void); @@ -137,6 +141,7 @@ cpu_setup(u_int cpuid) name = "Motorola MPC755"; revfmt = REVFMT_HEX; } + strncpy(model, name, sizeof(model) - 1); printf("cpu%d: %s revision ", cpuid, name); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 5b158d0..3aa68d9 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -136,9 +136,6 @@ vm_offset_t kstack0_phys; char machine[] = "powerpc"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); -static char model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); - static int cacheline_size = CACHELINESIZE; SYSCTL_INT(_machdep, CPU_CACHELINE, cacheline_size, CTLFLAG_RD, &cacheline_size, 0, ""); |