9 #include <linux/ctype.h>
10 #include <linux/module.h>
11 #include <linux/kernel.h>
20 static char const page_strtbl[][3] = {
"1K",
"4K",
"1M",
"4M" };
21 #define page(flags) (((flags) & 0x30000) >> 16)
22 #define strpage(flags) page_strtbl[page(flags)]
32 static void cplbinfo_print_header(
struct seq_file *
m)
34 seq_printf(m,
"Index\tAddress\t\tData\tSize\tU/RD\tU/WR\tS/WR\tSwitch\n");
42 static int cplbinfo_show(
struct seq_file *
m,
void *
p)
50 addr = cdata->
tbl[
pos].addr;
51 data = cdata->
tbl[
pos].data;
54 "%d\t0x%08lx\t%05lx\t%s\t%c\t%c\t%c\t%c\n",
55 (
int)pos, addr, data,
strpage(data),
77 static void *cplbinfo_start(
struct seq_file *m, loff_t *pos)
85 cplbinfo_print_header(m);
86 }
else if (cplbinfo_nomore(cdata))
93 static void *cplbinfo_next(
struct seq_file *m,
void *p, loff_t *pos)
96 cdata->
pos = ++(*pos);
97 if (cplbinfo_nomore(cdata))
103 static void cplbinfo_stop(
struct seq_file *m,
void *p)
109 .start = cplbinfo_start,
110 .next = cplbinfo_next,
111 .stop = cplbinfo_stop,
112 .show = cplbinfo_show,
115 #define CPLBINFO_DCPLB_FLAG 0x80000000
141 cplbinfo_seq_init(cdata, cpu);
147 .open = cplbinfo_open,
153 static int __init cplbinfo_init(
void)