提交 d1ce483e 编写于 作者: J James Hogan 提交者: Ralf Baechle

MIPS: dump_tlb: Refactor TLB matching

Refactor the TLB matching code in dump_tlb() slightly so that the
conditions which can cause a TLB entry to be skipped can be more easily
extended. This should prevent the match condition getting unwieldy once
it is updated to take further conditions into account.
Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10081/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 137877e4
...@@ -46,6 +46,11 @@ static void dump_tlb(int first, int last) ...@@ -46,6 +46,11 @@ static void dump_tlb(int first, int last)
unsigned long s_entryhi, entryhi, asid; unsigned long s_entryhi, entryhi, asid;
unsigned long long entrylo0, entrylo1; unsigned long long entrylo0, entrylo1;
unsigned int s_index, s_pagemask, pagemask, c0, c1, i; unsigned int s_index, s_pagemask, pagemask, c0, c1, i;
#ifdef CONFIG_32BIT
int width = 8;
#else
int width = 11;
#endif
s_pagemask = read_c0_pagemask(); s_pagemask = read_c0_pagemask();
s_entryhi = read_c0_entryhi(); s_entryhi = read_c0_entryhi();
...@@ -62,14 +67,15 @@ static void dump_tlb(int first, int last) ...@@ -62,14 +67,15 @@ static void dump_tlb(int first, int last)
entrylo0 = read_c0_entrylo0(); entrylo0 = read_c0_entrylo0();
entrylo1 = read_c0_entrylo1(); entrylo1 = read_c0_entrylo1();
/* Unused entries have a virtual address of CKSEG0. */ /*
if ((entryhi & ~0x1ffffUL) != CKSEG0 * Prior to tlbinv, unused entries have a virtual address of
&& (entryhi & 0xff) == asid) { * CKSEG0.
#ifdef CONFIG_32BIT */
int width = 8; if ((entryhi & ~0x1ffffUL) == CKSEG0)
#else continue;
int width = 11; if ((entryhi & 0xff) != asid)
#endif continue;
/* /*
* Only print entries in use * Only print entries in use
*/ */
...@@ -94,7 +100,6 @@ static void dump_tlb(int first, int last) ...@@ -94,7 +100,6 @@ static void dump_tlb(int first, int last)
(entrylo1 & 2) ? 1 : 0, (entrylo1 & 2) ? 1 : 0,
(entrylo1 & 1) ? 1 : 0); (entrylo1 & 1) ? 1 : 0);
} }
}
printk("\n"); printk("\n");
write_c0_entryhi(s_entryhi); write_c0_entryhi(s_entryhi);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册