1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/*-
* Initial implementation:
* Copyright (c) 2001 Robert Drehmel
* All rights reserved.
*
* As long as the above copyright statement and this notice remain
* unchanged, you can do what ever you want with this file.
*
* $FreeBSD$
*/
#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>
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");
int cpu_impl;
void
cpu_identify(u_long vers, u_int freq, u_int id)
{
const char *manus;
const char *impls;
switch (VER_MANUF(vers)) {
case 0x04:
manus = "HAL";
break;
case 0x13:
case 0x17:
case 0x22:
case 0x3e:
manus = "Sun Microsystems";
break;
default:
manus = NULL;
break;
}
switch (VER_IMPL(vers)) {
case CPU_IMPL_SPARC64:
impls = "SPARC64";
break;
case CPU_IMPL_ULTRASPARCI:
impls = "UltraSparc-I";
break;
case CPU_IMPL_ULTRASPARCII:
impls = "UltraSparc-II";
break;
case CPU_IMPL_ULTRASPARCIIi:
impls = "UltraSparc-IIi";
break;
case CPU_IMPL_ULTRASPARCIIe:
/* V9 Manual says `UltraSparc-e'. I assume this is wrong. */
impls = "UltraSparc-IIe";
break;
case CPU_IMPL_ULTRASPARCIII:
impls = "UltraSparc-III";
break;
case CPU_IMPL_ULTRASPARCIIIp:
impls = "UltraSparc-III+";
break;
case CPU_IMPL_ULTRASPARCIIIi:
impls = "UltraSparc-IIIi";
break;
default:
impls = NULL;
break;
}
if (manus == NULL || impls == NULL) {
printf(
"CPU: unknown; please e-mail the following value together\n"
" with the exact name of your processor to "
"<freebsd-sparc64@FreeBSD.org>.\n"
" version register: <0x%lx>\n", vers);
return;
}
snprintf(cpu_model, sizeof(cpu_model), "%s %s", manus, impls);
printf("cpu%d: %s %s Processor (%d.%02d MHz CPU)\n", id, manus, impls,
(freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
if (bootverbose) {
printf(" mask=0x%lx maxtl=%ld maxwin=%ld\n", VER_MASK(vers),
VER_MAXTL(vers), VER_MAXWIN(vers));
}
}
|