Commit 9b9fae8b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Rich Felker

sh: kernel: disassemble: Fix broken lines in disassembly dumps

Rejoin the broken lines by using pr_cont().
Convert the remaining printk() calls to pr_*() while at it.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarRich Felker <dalias@libc.org>
parent f6bed866
...@@ -376,148 +376,148 @@ static void print_sh_insn(u32 memaddr, u16 insn) ...@@ -376,148 +376,148 @@ static void print_sh_insn(u32 memaddr, u16 insn)
} }
ok: ok:
printk("%-8s ", op->name); pr_cont("%-8s ", op->name);
lastsp = (op->arg[0] == A_END); lastsp = (op->arg[0] == A_END);
disp_pc = 0; disp_pc = 0;
for (n = 0; n < 6 && op->arg[n] != A_END; n++) { for (n = 0; n < 6 && op->arg[n] != A_END; n++) {
if (n && op->arg[1] != A_END) if (n && op->arg[1] != A_END)
printk(", "); pr_cont(", ");
switch (op->arg[n]) { switch (op->arg[n]) {
case A_IMM: case A_IMM:
printk("#%d", (char)(imm)); pr_cont("#%d", (char)(imm));
break; break;
case A_R0: case A_R0:
printk("r0"); pr_cont("r0");
break; break;
case A_REG_N: case A_REG_N:
printk("r%d", rn); pr_cont("r%d", rn);
break; break;
case A_INC_N: case A_INC_N:
printk("@r%d+", rn); pr_cont("@r%d+", rn);
break; break;
case A_DEC_N: case A_DEC_N:
printk("@-r%d", rn); pr_cont("@-r%d", rn);
break; break;
case A_IND_N: case A_IND_N:
printk("@r%d", rn); pr_cont("@r%d", rn);
break; break;
case A_DISP_REG_N: case A_DISP_REG_N:
printk("@(%d,r%d)", imm, rn); pr_cont("@(%d,r%d)", imm, rn);
break; break;
case A_REG_M: case A_REG_M:
printk("r%d", rm); pr_cont("r%d", rm);
break; break;
case A_INC_M: case A_INC_M:
printk("@r%d+", rm); pr_cont("@r%d+", rm);
break; break;
case A_DEC_M: case A_DEC_M:
printk("@-r%d", rm); pr_cont("@-r%d", rm);
break; break;
case A_IND_M: case A_IND_M:
printk("@r%d", rm); pr_cont("@r%d", rm);
break; break;
case A_DISP_REG_M: case A_DISP_REG_M:
printk("@(%d,r%d)", imm, rm); pr_cont("@(%d,r%d)", imm, rm);
break; break;
case A_REG_B: case A_REG_B:
printk("r%d_bank", rb); pr_cont("r%d_bank", rb);
break; break;
case A_DISP_PC: case A_DISP_PC:
disp_pc = 1; disp_pc = 1;
disp_pc_addr = imm + 4 + (memaddr & relmask); disp_pc_addr = imm + 4 + (memaddr & relmask);
printk("%08x <%pS>", disp_pc_addr, pr_cont("%08x <%pS>", disp_pc_addr,
(void *)disp_pc_addr); (void *)disp_pc_addr);
break; break;
case A_IND_R0_REG_N: case A_IND_R0_REG_N:
printk("@(r0,r%d)", rn); pr_cont("@(r0,r%d)", rn);
break; break;
case A_IND_R0_REG_M: case A_IND_R0_REG_M:
printk("@(r0,r%d)", rm); pr_cont("@(r0,r%d)", rm);
break; break;
case A_DISP_GBR: case A_DISP_GBR:
printk("@(%d,gbr)",imm); pr_cont("@(%d,gbr)", imm);
break; break;
case A_R0_GBR: case A_R0_GBR:
printk("@(r0,gbr)"); pr_cont("@(r0,gbr)");
break; break;
case A_BDISP12: case A_BDISP12:
case A_BDISP8: case A_BDISP8:
printk("%08x", imm + memaddr); pr_cont("%08x", imm + memaddr);
break; break;
case A_SR: case A_SR:
printk("sr"); pr_cont("sr");
break; break;
case A_GBR: case A_GBR:
printk("gbr"); pr_cont("gbr");
break; break;
case A_VBR: case A_VBR:
printk("vbr"); pr_cont("vbr");
break; break;
case A_SSR: case A_SSR:
printk("ssr"); pr_cont("ssr");
break; break;
case A_SPC: case A_SPC:
printk("spc"); pr_cont("spc");
break; break;
case A_MACH: case A_MACH:
printk("mach"); pr_cont("mach");
break; break;
case A_MACL: case A_MACL:
printk("macl"); pr_cont("macl");
break; break;
case A_PR: case A_PR:
printk("pr"); pr_cont("pr");
break; break;
case A_SGR: case A_SGR:
printk("sgr"); pr_cont("sgr");
break; break;
case A_DBR: case A_DBR:
printk("dbr"); pr_cont("dbr");
break; break;
case FD_REG_N: case FD_REG_N:
case F_REG_N: case F_REG_N:
printk("fr%d", rn); pr_cont("fr%d", rn);
break; break;
case F_REG_M: case F_REG_M:
printk("fr%d", rm); pr_cont("fr%d", rm);
break; break;
case DX_REG_N: case DX_REG_N:
if (rn & 1) { if (rn & 1) {
printk("xd%d", rn & ~1); pr_cont("xd%d", rn & ~1);
break; break;
} }
/* else, fall through */ /* else, fall through */
case D_REG_N: case D_REG_N:
printk("dr%d", rn); pr_cont("dr%d", rn);
break; break;
case DX_REG_M: case DX_REG_M:
if (rm & 1) { if (rm & 1) {
printk("xd%d", rm & ~1); pr_cont("xd%d", rm & ~1);
break; break;
} }
/* else, fall through */ /* else, fall through */
case D_REG_M: case D_REG_M:
printk("dr%d", rm); pr_cont("dr%d", rm);
break; break;
case FPSCR_M: case FPSCR_M:
case FPSCR_N: case FPSCR_N:
printk("fpscr"); pr_cont("fpscr");
break; break;
case FPUL_M: case FPUL_M:
case FPUL_N: case FPUL_N:
printk("fpul"); pr_cont("fpul");
break; break;
case F_FR0: case F_FR0:
printk("fr0"); pr_cont("fr0");
break; break;
case V_REG_N: case V_REG_N:
printk("fv%d", rn*4); pr_cont("fv%d", rn*4);
break; break;
case V_REG_M: case V_REG_M:
printk("fv%d", rm*4); pr_cont("fv%d", rm*4);
break; break;
case XMTRX_M4: case XMTRX_M4:
printk("xmtrx"); pr_cont("xmtrx");
break; break;
default: default:
return; return;
...@@ -532,7 +532,7 @@ static void print_sh_insn(u32 memaddr, u16 insn) ...@@ -532,7 +532,7 @@ static void print_sh_insn(u32 memaddr, u16 insn)
else else
__get_user(val, (u32 *)disp_pc_addr); __get_user(val, (u32 *)disp_pc_addr);
printk(" ! %08x <%pS>", val, (void *)val); pr_cont(" ! %08x <%pS>", val, (void *)val);
} }
return; return;
...@@ -541,7 +541,7 @@ static void print_sh_insn(u32 memaddr, u16 insn) ...@@ -541,7 +541,7 @@ static void print_sh_insn(u32 memaddr, u16 insn)
} }
printk(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]); pr_info(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]);
} }
void show_code(struct pt_regs *regs) void show_code(struct pt_regs *regs)
...@@ -552,20 +552,21 @@ void show_code(struct pt_regs *regs) ...@@ -552,20 +552,21 @@ void show_code(struct pt_regs *regs)
if (regs->pc & 0x1) if (regs->pc & 0x1)
return; return;
printk("Code:\n"); pr_info("Code:\n");
for (i = -3 ; i < 6 ; i++) { for (i = -3 ; i < 6 ; i++) {
unsigned short insn; unsigned short insn;
if (__get_user(insn, pc + i)) { if (__get_user(insn, pc + i)) {
printk(" (Bad address in pc)\n"); pr_err(" (Bad address in pc)\n");
break; break;
} }
printk("%s%08lx: ", (i ? " ": "->"), (unsigned long)(pc + i)); pr_info("%s%08lx: ", (i ? " " : "->"),
(unsigned long)(pc + i));
print_sh_insn((unsigned long)(pc + i), insn); print_sh_insn((unsigned long)(pc + i), insn);
printk("\n"); pr_cont("\n");
} }
printk("\n"); pr_info("\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