diff options
author | WANG Xuerui <git@xen0n.name> | 2023-05-01 17:19:10 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-05-01 17:19:10 +0800 |
commit | ce7f0b18b030e17fb3d8327f1b6f1719165ca51d (patch) | |
tree | 78e1b2d245b71fc4afee5cada9ed032fb5249d03 /arch/loongarch | |
parent | efada2afacee7b5e59b3182bc36ddfb0fad2b0e2 (diff) |
LoongArch: Humanize the PRMD line when showing registers
Example output looks like:
[ xx.xxxxxx] PRMD: 00000004 (PPLV0 +PIE -PWE)
Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch')
-rw-r--r-- | arch/loongarch/kernel/traps.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c index 97af82547725..9f092e1cc782 100644 --- a/arch/loongarch/kernel/traps.c +++ b/arch/loongarch/kernel/traps.c @@ -202,6 +202,15 @@ static void print_crmd(unsigned long x) pr_cont(")\n"); } +static void print_prmd(unsigned long x) +{ + printk(" PRMD: %08lx (", x); + print_plv_fragment("PPLV", (int) FIELD_GET(CSR_PRMD_PPLV, x)); + print_bool_fragment("PIE", FIELD_GET(CSR_PRMD_PIE, x), false); + print_bool_fragment("PWE", FIELD_GET(CSR_PRMD_PWE, x), false); + pr_cont(")\n"); +} + static void __show_regs(const struct pt_regs *regs) { const int field = 2 * sizeof(unsigned long); @@ -244,7 +253,7 @@ static void __show_regs(const struct pt_regs *regs) /* Print saved important CSRs */ print_crmd(regs->csr_crmd); - printk(" PRMD: %08lx\n", regs->csr_prmd); + print_prmd(regs->csr_prmd); printk(" EUEN: %08lx\n", regs->csr_euen); printk(" ECFG: %08lx\n", regs->csr_ecfg); printk("ESTAT: %08lx\n", regs->csr_estat); |