aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/cplb-mpu/cplbinfo.c')
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinfo.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinfo.c b/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
index 822beefa3a4b..00cb2cf3a420 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
@@ -66,32 +66,32 @@ static char *cplb_print_entry(char *buf, struct cplb_entry *tbl, int switched)
66 return buf; 66 return buf;
67} 67}
68 68
69int cplbinfo_proc_output(char *buf) 69int cplbinfo_proc_output(char *buf, void *data)
70{ 70{
71 char *p; 71 char *p;
72 unsigned int cpu = (unsigned int)data;;
72 73
73 p = buf; 74 p = buf;
74 75
75 p += sprintf(p, "------------------ CPLB Information ------------------\n\n"); 76 p += sprintf(p, "------------- CPLB Information on CPU%u --------------\n\n", cpu);
76
77 if (bfin_read_IMEM_CONTROL() & ENICPLB) { 77 if (bfin_read_IMEM_CONTROL() & ENICPLB) {
78 p += sprintf(p, "Instruction CPLB entry:\n"); 78 p += sprintf(p, "Instruction CPLB entry:\n");
79 p = cplb_print_entry(p, icplb_tbl, first_switched_icplb); 79 p = cplb_print_entry(p, icplb_tbl[cpu], first_switched_icplb);
80 } else 80 } else
81 p += sprintf(p, "Instruction CPLB is disabled.\n\n"); 81 p += sprintf(p, "Instruction CPLB is disabled.\n\n");
82 82
83 if (1 || bfin_read_DMEM_CONTROL() & ENDCPLB) { 83 if (1 || bfin_read_DMEM_CONTROL() & ENDCPLB) {
84 p += sprintf(p, "Data CPLB entry:\n"); 84 p += sprintf(p, "Data CPLB entry:\n");
85 p = cplb_print_entry(p, dcplb_tbl, first_switched_dcplb); 85 p = cplb_print_entry(p, dcplb_tbl[cpu], first_switched_dcplb);
86 } else 86 } else
87 p += sprintf(p, "Data CPLB is disabled.\n"); 87 p += sprintf(p, "Data CPLB is disabled.\n");
88 88
89 p += sprintf(p, "ICPLB miss: %d\nICPLB supervisor miss: %d\n", 89 p += sprintf(p, "ICPLB miss: %d\nICPLB supervisor miss: %d\n",
90 nr_icplb_miss, nr_icplb_supv_miss); 90 nr_icplb_miss[cpu], nr_icplb_supv_miss[cpu]);
91 p += sprintf(p, "DCPLB miss: %d\nDCPLB protection fault:%d\n", 91 p += sprintf(p, "DCPLB miss: %d\nDCPLB protection fault:%d\n",
92 nr_dcplb_miss, nr_dcplb_prot); 92 nr_dcplb_miss[cpu], nr_dcplb_prot[cpu]);
93 p += sprintf(p, "CPLB flushes: %d\n", 93 p += sprintf(p, "CPLB flushes: %d\n",
94 nr_cplb_flush); 94 nr_cplb_flush[cpu]);
95 95
96 return p - buf; 96 return p - buf;
97} 97}
@@ -101,7 +101,7 @@ static int cplbinfo_read_proc(char *page, char **start, off_t off,
101{ 101{
102 int len; 102 int len;
103 103
104 len = cplbinfo_proc_output(page); 104 len = cplbinfo_proc_output(page, data);
105 if (len <= off + count) 105 if (len <= off + count)
106 *eof = 1; 106 *eof = 1;
107 *start = page + off; 107 *start = page + off;
@@ -115,20 +115,33 @@ static int cplbinfo_read_proc(char *page, char **start, off_t off,
115 115
116static int __init cplbinfo_init(void) 116static int __init cplbinfo_init(void)
117{ 117{
118 struct proc_dir_entry *entry; 118 struct proc_dir_entry *parent, *entry;
119 unsigned int cpu;
120 unsigned char str[10];
121
122 parent = proc_mkdir("cplbinfo", NULL);
119 123
120 entry = create_proc_entry("cplbinfo", 0, NULL); 124 for_each_online_cpu(cpu) {
121 if (!entry) 125 sprintf(str, "cpu%u", cpu);
122 return -ENOMEM; 126 entry = create_proc_entry(str, 0, parent);
127 if (!entry)
128 return -ENOMEM;
123 129
124 entry->read_proc = cplbinfo_read_proc; 130 entry->read_proc = cplbinfo_read_proc;
125 entry->data = NULL; 131 entry->data = (void *)cpu;
132 }
126 133
127 return 0; 134 return 0;
128} 135}
129 136
130static void __exit cplbinfo_exit(void) 137static void __exit cplbinfo_exit(void)
131{ 138{
139 unsigned int cpu;
140 unsigned char str[20];
141 for_each_online_cpu(cpu) {
142 sprintf(str, "cplbinfo/cpu%u", cpu);
143 remove_proc_entry(str, NULL);
144 }
132 remove_proc_entry("cplbinfo", NULL); 145 remove_proc_entry("cplbinfo", NULL);
133} 146}
134 147