aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-08-16 13:06:48 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:06 -0400
commitd2f755e04f26b9ab4b8da24c025dc4f6112d6bee (patch)
treeb53124f517972e5169d4279a1c1279570cb13ee9
parent3fd5646cac36e2ea244bb3455a66afb1777b9a92 (diff)
Reindent dump_tlb.c.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/lib-32/dump_tlb.c83
1 files changed, 49 insertions, 34 deletions
diff --git a/arch/mips/lib-32/dump_tlb.c b/arch/mips/lib-32/dump_tlb.c
index f6d134feb12a..9373a7740125 100644
--- a/arch/mips/lib-32/dump_tlb.c
+++ b/arch/mips/lib-32/dump_tlb.c
@@ -20,16 +20,25 @@
20static inline const char *msk2str(unsigned int mask) 20static inline const char *msk2str(unsigned int mask)
21{ 21{
22 switch (mask) { 22 switch (mask) {
23 case PM_4K: return "4kb"; 23 case PM_4K:
24 case PM_16K: return "16kb"; 24 return "4kb";
25 case PM_64K: return "64kb"; 25 case PM_16K:
26 case PM_256K: return "256kb"; 26 return "16kb";
27 case PM_64K:
28 return "64kb";
29 case PM_256K:
30 return "256kb";
27#ifndef CONFIG_CPU_VR41XX 31#ifndef CONFIG_CPU_VR41XX
28 case PM_1M: return "1Mb"; 32 case PM_1M:
29 case PM_4M: return "4Mb"; 33 return "1Mb";
30 case PM_16M: return "16Mb"; 34 case PM_4M:
31 case PM_64M: return "64Mb"; 35 return "4Mb";
32 case PM_256M: return "256Mb"; 36 case PM_16M:
37 return "16Mb";
38 case PM_64M:
39 return "64Mb";
40 case PM_256M:
41 return "256Mb";
33#endif 42#endif
34 } 43 }
35 44
@@ -47,7 +56,7 @@ void dump_tlb(int first, int last)
47 unsigned int pagemask, c0, c1, asid; 56 unsigned int pagemask, c0, c1, asid;
48 unsigned long long entrylo0, entrylo1; 57 unsigned long long entrylo0, entrylo1;
49 unsigned long entryhi; 58 unsigned long entryhi;
50 int i; 59 int i;
51 60
52 asid = read_c0_entryhi() & 0xff; 61 asid = read_c0_entryhi() & 0xff;
53 62
@@ -58,7 +67,7 @@ void dump_tlb(int first, int last)
58 tlb_read(); 67 tlb_read();
59 BARRIER(); 68 BARRIER();
60 pagemask = read_c0_pagemask(); 69 pagemask = read_c0_pagemask();
61 entryhi = read_c0_entryhi(); 70 entryhi = read_c0_entryhi();
62 entrylo0 = read_c0_entrylo0(); 71 entrylo0 = read_c0_entrylo0();
63 entrylo1 = read_c0_entrylo1(); 72 entrylo1 = read_c0_entrylo1();
64 73
@@ -78,13 +87,11 @@ void dump_tlb(int first, int last)
78 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n", 87 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n",
79 (entrylo0 << 6) & PAGE_MASK, c0, 88 (entrylo0 << 6) & PAGE_MASK, c0,
80 (entrylo0 & 4) ? 1 : 0, 89 (entrylo0 & 4) ? 1 : 0,
81 (entrylo0 & 2) ? 1 : 0, 90 (entrylo0 & 2) ? 1 : 0, (entrylo0 & 1));
82 (entrylo0 & 1));
83 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n", 91 printk("\t\t\t[pa=%08Lx c=%d d=%d v=%d g=%Ld]\n",
84 (entrylo1 << 6) & PAGE_MASK, c1, 92 (entrylo1 << 6) & PAGE_MASK, c1,
85 (entrylo1 & 4) ? 1 : 0, 93 (entrylo1 & 4) ? 1 : 0,
86 (entrylo1 & 2) ? 1 : 0, 94 (entrylo1 & 2) ? 1 : 0, (entrylo1 & 1));
87 (entrylo1 & 1));
88 printk("\n"); 95 printk("\n");
89 } 96 }
90 } 97 }
@@ -99,7 +106,7 @@ void dump_tlb_all(void)
99 106
100void dump_tlb_wired(void) 107void dump_tlb_wired(void)
101{ 108{
102 int wired; 109 int wired;
103 110
104 wired = read_c0_wired(); 111 wired = read_c0_wired();
105 printk("Wired: %d", wired); 112 printk("Wired: %d", wired);
@@ -138,10 +145,10 @@ void dump_tlb_nonwired(void)
138 145
139void dump_list_process(struct task_struct *t, void *address) 146void dump_list_process(struct task_struct *t, void *address)
140{ 147{
141 pgd_t *page_dir, *pgd; 148 pgd_t *page_dir, *pgd;
142 pud_t *pud; 149 pud_t *pud;
143 pmd_t *pmd; 150 pmd_t *pmd;
144 pte_t *pte, page; 151 pte_t *pte, page;
145 unsigned long addr, val; 152 unsigned long addr, val;
146 153
147 addr = (unsigned long) address; 154 addr = (unsigned long) address;
@@ -180,14 +187,22 @@ void dump_list_process(struct task_struct *t, void *address)
180#endif 187#endif
181 188
182 val = pte_val(page); 189 val = pte_val(page);
183 if (val & _PAGE_PRESENT) printk("present "); 190 if (val & _PAGE_PRESENT)
184 if (val & _PAGE_READ) printk("read "); 191 printk("present ");
185 if (val & _PAGE_WRITE) printk("write "); 192 if (val & _PAGE_READ)
186 if (val & _PAGE_ACCESSED) printk("accessed "); 193 printk("read ");
187 if (val & _PAGE_MODIFIED) printk("modified "); 194 if (val & _PAGE_WRITE)
188 if (val & _PAGE_R4KBUG) printk("r4kbug "); 195 printk("write ");
189 if (val & _PAGE_GLOBAL) printk("global "); 196 if (val & _PAGE_ACCESSED)
190 if (val & _PAGE_VALID) printk("valid "); 197 printk("accessed ");
198 if (val & _PAGE_MODIFIED)
199 printk("modified ");
200 if (val & _PAGE_R4KBUG)
201 printk("r4kbug ");
202 if (val & _PAGE_GLOBAL)
203 printk("global ");
204 if (val & _PAGE_VALID)
205 printk("valid ");
191 printk("\n"); 206 printk("\n");
192} 207}
193 208
@@ -198,10 +213,10 @@ void dump_list_current(void *address)
198 213
199unsigned int vtop(void *address) 214unsigned int vtop(void *address)
200{ 215{
201 pgd_t *pgd; 216 pgd_t *pgd;
202 pud_t *pud; 217 pud_t *pud;
203 pmd_t *pmd; 218 pmd_t *pmd;
204 pte_t *pte; 219 pte_t *pte;
205 unsigned int addr, paddr; 220 unsigned int addr, paddr;
206 221
207 addr = (unsigned long) address; 222 addr = (unsigned long) address;
@@ -220,9 +235,9 @@ void dump16(unsigned long *p)
220 int i; 235 int i;
221 236
222 for (i = 0; i < 8; i++) { 237 for (i = 0; i < 8; i++) {
223 printk("*%08lx == %08lx, ", (unsigned long)p, *p); 238 printk("*%08lx == %08lx, ", (unsigned long) p, *p);
224 p++; 239 p++;
225 printk("*%08lx == %08lx\n", (unsigned long)p, *p); 240 printk("*%08lx == %08lx\n", (unsigned long) p, *p);
226 p++; 241 p++;
227 } 242 }
228} 243}