Skip to content

Commit ce7f0b1

Browse files
xen0nchenhuacai
authored andcommitted
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>
1 parent efada2a commit ce7f0b1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

arch/loongarch/kernel/traps.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,15 @@ static void print_crmd(unsigned long x)
202202
pr_cont(")\n");
203203
}
204204

205+
static void print_prmd(unsigned long x)
206+
{
207+
printk(" PRMD: %08lx (", x);
208+
print_plv_fragment("PPLV", (int) FIELD_GET(CSR_PRMD_PPLV, x));
209+
print_bool_fragment("PIE", FIELD_GET(CSR_PRMD_PIE, x), false);
210+
print_bool_fragment("PWE", FIELD_GET(CSR_PRMD_PWE, x), false);
211+
pr_cont(")\n");
212+
}
213+
205214
static void __show_regs(const struct pt_regs *regs)
206215
{
207216
const int field = 2 * sizeof(unsigned long);
@@ -244,7 +253,7 @@ static void __show_regs(const struct pt_regs *regs)
244253

245254
/* Print saved important CSRs */
246255
print_crmd(regs->csr_crmd);
247-
printk(" PRMD: %08lx\n", regs->csr_prmd);
256+
print_prmd(regs->csr_prmd);
248257
printk(" EUEN: %08lx\n", regs->csr_euen);
249258
printk(" ECFG: %08lx\n", regs->csr_ecfg);
250259
printk("ESTAT: %08lx\n", regs->csr_estat);

0 commit comments

Comments
 (0)