11 #include <linux/module.h>
12 #include <linux/slab.h>
18 #include <asm/sn/addrs.h>
25 #define FIT_ENTRY_FIT_HEADER 0x00
26 #define FIT_ENTRY_PAL_B 0x01
28 #define FIT_ENTRY_PAL_A_PROC 0x0E
29 #define FIT_ENTRY_PAL_A 0x0F
30 #define FIT_ENTRY_PAL_A_GEN 0x0F
31 #define FIT_ENTRY_UNUSED 0x7F
33 #define FIT_ENTRY_SAL_A 0x10
34 #define FIT_ENTRY_SAL_B 0x11
35 #define FIT_ENTRY_SALRUNTIME 0x12
36 #define FIT_ENTRY_EFI 0x1F
37 #define FIT_ENTRY_FPSWA 0x20
38 #define FIT_ENTRY_VMLINUX 0x21
40 #define FIT_MAJOR_SHIFT (32 + 8)
41 #define FIT_MAJOR_MASK ((1 << 8) - 1)
42 #define FIT_MINOR_SHIFT 32
43 #define FIT_MINOR_MASK ((1 << 8) - 1)
45 #define FIT_MAJOR(q) \
46 ((unsigned) ((q) >> FIT_MAJOR_SHIFT) & FIT_MAJOR_MASK)
47 #define FIT_MINOR(q) \
48 ((unsigned) ((q) >> FIT_MINOR_SHIFT) & FIT_MINOR_MASK)
50 #define FIT_TYPE_SHIFT (32 + 16)
51 #define FIT_TYPE_MASK ((1 << 7) - 1)
54 ((unsigned) ((q) >> FIT_TYPE_SHIFT) & FIT_TYPE_MASK)
77 static const char *fit_type_name(
unsigned char type)
81 for (mapp = fit_entry_types; mapp->
type != 0xff; mapp++)
82 if (type == mapp->
type)
90 return "Unknown type";
94 get_fit_entry(
unsigned long nasid,
int index,
unsigned long *fentry,
95 char *banner,
int banlen)
97 return ia64_sn_get_fit_compt(nasid, index, fentry, banner, banlen);
104 static int dump_fit_entry(
char *
page,
unsigned long *fentry)
109 return sprintf(page,
"%02x %-25s %x.%02x %016lx %u\n",
115 (
unsigned)(fentry[1] & 0xffffff) * 16);
128 dump_fit(
char *page,
unsigned long nasid)
130 unsigned long fentry[2];
135 for (index=0;;index++) {
137 if (get_fit_entry(nasid, index, fentry,
NULL, 0))
139 p += dump_fit_entry(p, fentry);
146 dump_version(
char *page,
unsigned long nasid)
148 unsigned long fentry[2];
153 for (index = 0; ; index++) {
154 if (get_fit_entry(nasid, index, fentry, banner,
173 proc_calc_metrics(
char *page,
char **
start,
off_t off,
int count,
int *eof,
176 if (len <= off + count)
188 read_version_entry(
char *page,
char **start,
off_t off,
int count,
int *eof,
194 len = dump_version(page, (
unsigned long)data);
195 len = proc_calc_metrics(page, start, off, count, eof, len);
200 read_fit_entry(
char *page,
char **start,
off_t off,
int count,
int *eof,
206 len = dump_fit(page, (
unsigned long)data);
207 len = proc_calc_metrics(page, start, off, count, eof, len);
222 #define NODE_NAME_LEN 11
244 sprintf(name,
"node%d", cnodeid);
247 create_proc_read_entry(
"fit", 0, *entp, read_fit_entry,
249 create_proc_read_entry(
"version", 0, *entp,
250 read_version_entry, (
void *)nasid);
260 unsigned int cnodeid;
267 sprintf(name,
"node%d", cnodeid);