diff options
author | WANG Xuerui <git@xen0n.name> | 2023-05-01 12:19:27 +0300 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-05-01 12:19:27 +0300 |
commit | 9718d96c035c594390600168cbca0ae4e0d867f5 (patch) | |
tree | 73dac8c4b624136e5b77a48cc5de4552c2bfa90e /arch/loongarch/kernel/traps.c | |
parent | ce7f0b18b030e17fb3d8327f1b6f1719165ca51d (diff) | |
download | linux-9718d96c035c594390600168cbca0ae4e0d867f5.tar.xz |
LoongArch: Humanize the EUEN line when showing registers
Example output looks like:
[ xx.xxxxxx] EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/traps.c')
-rw-r--r-- | arch/loongarch/kernel/traps.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c index 9f092e1cc782..bd6be798f81d 100644 --- a/arch/loongarch/kernel/traps.c +++ b/arch/loongarch/kernel/traps.c @@ -211,6 +211,16 @@ static void print_prmd(unsigned long x) pr_cont(")\n"); } +static void print_euen(unsigned long x) +{ + printk(" EUEN: %08lx (", x); + print_bool_fragment("FPE", FIELD_GET(CSR_EUEN_FPEN, x), true); + print_bool_fragment("SXE", FIELD_GET(CSR_EUEN_LSXEN, x), false); + print_bool_fragment("ASXE", FIELD_GET(CSR_EUEN_LASXEN, x), false); + print_bool_fragment("BTE", FIELD_GET(CSR_EUEN_LBTEN, x), false); + pr_cont(")\n"); +} + static void __show_regs(const struct pt_regs *regs) { const int field = 2 * sizeof(unsigned long); @@ -254,7 +264,7 @@ static void __show_regs(const struct pt_regs *regs) /* Print saved important CSRs */ print_crmd(regs->csr_crmd); print_prmd(regs->csr_prmd); - printk(" EUEN: %08lx\n", regs->csr_euen); + print_euen(regs->csr_euen); printk(" ECFG: %08lx\n", regs->csr_ecfg); printk("ESTAT: %08lx\n", regs->csr_estat); |