Commit 5e3e784d authored by WANG Xuerui's avatar WANG Xuerui Committed by Huacai Chen

LoongArch: Humanize the ECFG line when showing registers

Example output looks like:

[   xx.xxxxxx]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
Signed-off-by: default avatarWANG Xuerui <git@xen0n.name>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 9718d96c
...@@ -189,6 +189,12 @@ static void print_memory_type_fragment(const char *key, unsigned long val) ...@@ -189,6 +189,12 @@ static void print_memory_type_fragment(const char *key, unsigned long val)
pr_cont(" %s=%s", key, humanized_type); pr_cont(" %s=%s", key, humanized_type);
} }
static void print_intr_fragment(const char *key, unsigned long val)
{
/* e.g. "LIE=0-1,3,5-7" */
pr_cont("%s=%*pbl", key, EXCCODE_INT_NUM, &val);
}
static void print_crmd(unsigned long x) static void print_crmd(unsigned long x)
{ {
printk(" CRMD: %08lx (", x); printk(" CRMD: %08lx (", x);
...@@ -221,6 +227,13 @@ static void print_euen(unsigned long x) ...@@ -221,6 +227,13 @@ static void print_euen(unsigned long x)
pr_cont(")\n"); pr_cont(")\n");
} }
static void print_ecfg(unsigned long x)
{
printk(" ECFG: %08lx (", x);
print_intr_fragment("LIE", FIELD_GET(CSR_ECFG_IM, x));
pr_cont(" VS=%d)\n", (int) FIELD_GET(CSR_ECFG_VS, x));
}
static void __show_regs(const struct pt_regs *regs) static void __show_regs(const struct pt_regs *regs)
{ {
const int field = 2 * sizeof(unsigned long); const int field = 2 * sizeof(unsigned long);
...@@ -265,7 +278,7 @@ static void __show_regs(const struct pt_regs *regs) ...@@ -265,7 +278,7 @@ static void __show_regs(const struct pt_regs *regs)
print_crmd(regs->csr_crmd); print_crmd(regs->csr_crmd);
print_prmd(regs->csr_prmd); print_prmd(regs->csr_prmd);
print_euen(regs->csr_euen); print_euen(regs->csr_euen);
printk(" ECFG: %08lx\n", regs->csr_ecfg); print_ecfg(regs->csr_ecfg);
printk("ESTAT: %08lx\n", regs->csr_estat); printk("ESTAT: %08lx\n", regs->csr_estat);
exccode = ((regs->csr_estat) & CSR_ESTAT_EXC) >> CSR_ESTAT_EXC_SHIFT; exccode = ((regs->csr_estat) & CSR_ESTAT_EXC) >> CSR_ESTAT_EXC_SHIFT;
......
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