Propagate the CPU model to the hw.model sysctl.

This commit is contained in:
marcel 2007-01-14 21:45:05 +00:00
parent 3251ecf31a
commit 62b15d9b50
3 changed files with 5 additions and 6 deletions

View File

@ -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, "");

View File

@ -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);

View File

@ -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, "");