Commit 8961a2a5 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/ptdump: Standardise display of BAT flags

Display BAT flags the same way as page flags: rwx and wimg
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/a07585f353c167b8db9597d83f992a5cb4fbf4c4.1589866984.git.christophe.leroy@csgroup.eu
parent 6b30830e
......@@ -15,12 +15,12 @@
static char *pp_601(int k, int pp)
{
if (pp == 0)
return k ? "NA" : "RWX";
return k ? " " : "rwx";
if (pp == 1)
return k ? "ROX" : "RWX";
return k ? "r x" : "rwx";
if (pp == 2)
return k ? "RWX" : "RWX";
return k ? "ROX" : "ROX";
return "rwx";
return "r x";
}
static void bat_show_601(struct seq_file *m, int idx, u32 lower, u32 upper)
......@@ -48,12 +48,9 @@ static void bat_show_601(struct seq_file *m, int idx, u32 lower, u32 upper)
seq_printf(m, "Kernel %s User %s", pp_601(k & 2, pp), pp_601(k & 1, pp));
if (lower & _PAGE_WRITETHRU)
seq_puts(m, "write through ");
if (lower & _PAGE_NO_CACHE)
seq_puts(m, "no cache ");
if (lower & _PAGE_COHERENT)
seq_puts(m, "coherent ");
seq_puts(m, lower & _PAGE_WRITETHRU ? "w " : " ");
seq_puts(m, lower & _PAGE_NO_CACHE ? "i " : " ");
seq_puts(m, lower & _PAGE_COHERENT ? "m " : " ");
seq_puts(m, "\n");
}
......@@ -101,20 +98,16 @@ static void bat_show_603(struct seq_file *m, int idx, u32 lower, u32 upper, bool
seq_puts(m, "Kernel/User ");
if (lower & BPP_RX)
seq_puts(m, is_d ? "RO " : "EXEC ");
seq_puts(m, is_d ? "r " : " x ");
else if (lower & BPP_RW)
seq_puts(m, is_d ? "RW " : "EXEC ");
seq_puts(m, is_d ? "rw " : " x ");
else
seq_puts(m, is_d ? "NA " : "NX ");
if (lower & _PAGE_WRITETHRU)
seq_puts(m, "write through ");
if (lower & _PAGE_NO_CACHE)
seq_puts(m, "no cache ");
if (lower & _PAGE_COHERENT)
seq_puts(m, "coherent ");
if (lower & _PAGE_GUARDED)
seq_puts(m, "guarded ");
seq_puts(m, is_d ? " " : " ");
seq_puts(m, lower & _PAGE_WRITETHRU ? "w " : " ");
seq_puts(m, lower & _PAGE_NO_CACHE ? "i " : " ");
seq_puts(m, lower & _PAGE_COHERENT ? "m " : " ");
seq_puts(m, lower & _PAGE_GUARDED ? "g " : " ");
seq_puts(m, "\n");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment