2 * Initial implementation:
3 * Copyright (c) 2001 Robert Drehmel
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
11 #include <sys/param.h>
12 #include <sys/systm.h>
13 #include <sys/kernel.h>
14 #include <sys/sysctl.h>
16 #include <machine/cpufunc.h>
17 #include <machine/md_var.h>
18 #include <machine/ver.h>
20 char machine[] = MACHINE;
21 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
22 machine, 0, "Machine class");
24 static char cpu_model[128];
25 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
26 cpu_model, 0, "Machine model");
32 void setPQL2(int *const size, int *const ways);
35 setPQL2(int *const size, int *const ways)
38 /* XXX hardcoding is lame */
46 cpu_identify(u_long vers, u_int freq, u_int id)
51 switch (VER_MANUF(vers)) {
59 manus = "Sun Microsystems";
65 switch (VER_IMPL(vers)) {
66 case CPU_IMPL_SPARC64:
69 case CPU_IMPL_ULTRASPARCI:
70 impls = "UltraSparc-I";
72 case CPU_IMPL_ULTRASPARCII:
73 impls = "UltraSparc-II";
75 case CPU_IMPL_ULTRASPARCIIi:
76 impls = "UltraSparc-IIi";
78 case CPU_IMPL_ULTRASPARCIIe:
79 /* V9 Manual says `UltraSparc-e'. I assume this is wrong. */
80 impls = "UltraSparc-IIe";
82 case CPU_IMPL_ULTRASPARCIII:
83 impls = "UltraSparc-III";
85 case CPU_IMPL_ULTRASPARCIIIp:
86 impls = "UltraSparc-III+";
88 case CPU_IMPL_ULTRASPARCIIIi:
89 impls = "UltraSparc-IIIi";
95 if (manus == NULL || impls == NULL) {
97 "CPU: unknown; please e-mail the following value together\n"
98 " with the exact name of your processor to "
99 "<freebsd-sparc64@FreeBSD.org>.\n"
100 " version register: <0x%lx>\n", vers);
104 snprintf(cpu_model, sizeof(cpu_model), "%s %s", manus, impls);
105 printf("cpu%d: %s %s Processor (%d.%02d MHz CPU)\n", id, manus, impls,
106 (freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
108 printf(" mask=0x%lx maxtl=%ld maxwin=%ld\n", VER_MASK(vers),
109 VER_MAXTL(vers), VER_MAXWIN(vers));