Commit 1f021ea0 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/dumpstack: use bit fields to decode psw mask in show_registers()

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent ca0fd75a
...@@ -121,13 +121,9 @@ static void show_last_breaking_event(struct pt_regs *regs) ...@@ -121,13 +121,9 @@ static void show_last_breaking_event(struct pt_regs *regs)
printk(" [<%016lx>] %pSR\n", regs->args[0], (void *)regs->args[0]); printk(" [<%016lx>] %pSR\n", regs->args[0], (void *)regs->args[0]);
} }
static inline int mask_bits(struct pt_regs *regs, unsigned long bits)
{
return (regs->psw.mask & bits) / ((~bits + 1) & bits);
}
void show_registers(struct pt_regs *regs) void show_registers(struct pt_regs *regs)
{ {
struct psw_bits *psw = &psw_bits(regs->psw);
char *mode; char *mode;
mode = user_mode(regs) ? "User" : "Krnl"; mode = user_mode(regs) ? "User" : "Krnl";
...@@ -136,14 +132,9 @@ void show_registers(struct pt_regs *regs) ...@@ -136,14 +132,9 @@ void show_registers(struct pt_regs *regs)
printk(" (%pSR)", (void *)regs->psw.addr); printk(" (%pSR)", (void *)regs->psw.addr);
printk("\n"); printk("\n");
printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
"P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER), "P:%x AS:%x CC:%x PM:%x", psw->r, psw->t, psw->i, psw->e,
mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO), psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm);
mask_bits(regs, PSW_MASK_EXT), mask_bits(regs, PSW_MASK_KEY), printk(" RI:%x EA:%x", psw->ri, psw->eaba);
mask_bits(regs, PSW_MASK_MCHECK), mask_bits(regs, PSW_MASK_WAIT),
mask_bits(regs, PSW_MASK_PSTATE), mask_bits(regs, PSW_MASK_ASC),
mask_bits(regs, PSW_MASK_CC), mask_bits(regs, PSW_MASK_PM));
printk(" RI:%x EA:%x", mask_bits(regs, PSW_MASK_RI),
mask_bits(regs, PSW_MASK_EA | PSW_MASK_BA));
printk("\n%s GPRS: %016lx %016lx %016lx %016lx\n", mode, printk("\n%s GPRS: %016lx %016lx %016lx %016lx\n", mode,
regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
printk(" %016lx %016lx %016lx %016lx\n", printk(" %016lx %016lx %016lx %016lx\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