X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Falpha%2Fkernel%2Ftraps.c;h=f9d12319e0fbba45ec9dc97cfd9e31e5581fadea;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=52348791ce1e976fb738b8fa3c302225cfdfe327;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 52348791c..f9d12319e 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,8 @@ dik_show_regs(struct pt_regs *regs, unsigned long *r9_15) { printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx %s\n", regs->pc, regs->r26, regs->ps, print_tainted()); + print_symbol("pc is at %s\n", regs->pc); + print_symbol("ra is at %s\n", regs->r26 ); printk("v0 = %016lx t0 = %016lx t1 = %016lx\n", regs->r0, regs->r1, regs->r2); printk("t2 = %016lx t3 = %016lx t4 = %016lx\n", @@ -108,7 +111,7 @@ dik_show_code(unsigned int *pc) printk("Code:"); for (i = -6; i < 2; i++) { unsigned int insn; - if (__get_user(insn, pc+i)) + if (__get_user(insn, (unsigned int __user *)pc + i)) break; printk("%c%08x%c", i ? ' ' : '<', insn, i ? ' ' : '>'); } @@ -119,7 +122,7 @@ static void dik_show_trace(unsigned long *sp) { long i = 0; - printk("Trace:"); + printk("Trace:\n"); while (0x1ff8 & (unsigned long) sp) { extern char _stext[], _etext[]; unsigned long tmp = *sp; @@ -128,7 +131,9 @@ dik_show_trace(unsigned long *sp) continue; if (tmp >= (unsigned long) &_etext) continue; - printk("%lx%c", tmp, ' '); + printk("[<%lx>]", tmp); + print_symbol(" %s", tmp); + printk("\n"); if (i > 40) { printk(" ..."); break; @@ -220,12 +225,12 @@ do_entArith(unsigned long summary, unsigned long write_mask, if (si_code == 0) return; } - die_if_kernel("Arithmetic fault", regs, 0, 0); + die_if_kernel("Arithmetic fault", regs, 0, NULL); info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGFPE, &info, current); } @@ -235,7 +240,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) siginfo_t info; int signo, code; - if (regs->ps == 0) { + if ((regs->ps & ~IPL_MAX) == 0) { if (type == 1) { const unsigned int *data = (const unsigned int *) regs->pc; @@ -244,7 +249,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) data[0]); } die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"), - regs, type, 0); + regs, type, NULL); } switch (type) { @@ -253,7 +258,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) info.si_errno = 0; info.si_code = TRAP_BRKPT; info.si_trapno = 0; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; if (ptrace_cancel_bpt(current)) { regs->pc -= 4; /* make pc point to former bpt */ @@ -266,13 +271,13 @@ do_entIF(unsigned long type, struct pt_regs *regs) info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = __SI_FAULT; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = 0; send_sig_info(SIGTRAP, &info, current); return; case 2: /* gentrap */ - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = regs->r16; switch ((long) regs->r16) { case GEN_INTOVF: @@ -334,7 +339,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) info.si_signo = signo; info.si_errno = 0; info.si_code = code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(signo, &info, current); return; @@ -362,7 +367,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGFPE, &info, current); return; } @@ -391,7 +396,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGILL, &info, current); } @@ -407,12 +412,12 @@ do_entDbg(struct pt_regs *regs) { siginfo_t info; - die_if_kernel("Instruction fault", regs, 0, 0); + die_if_kernel("Instruction fault", regs, 0, NULL); info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; force_sig_info(SIGILL, &info, current); } @@ -441,16 +446,15 @@ struct unaligned_stat { /* Macro for exception fixup code to access integer registers. */ -#define una_reg(r) (regs.regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)]) +#define una_reg(r) (regs->regs[(r) >= 16 && (r) <= 18 ? (r)+19 : (r)]) asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg, - unsigned long a3, unsigned long a4, unsigned long a5, - struct allregs regs) + struct allregs *regs) { long error, tmp1, tmp2, tmp3, tmp4; - unsigned long pc = regs.pc - 4; + unsigned long pc = regs->pc - 4; const struct exception_table_entry *fixup; unaligned[0].count++; @@ -631,7 +635,7 @@ got_exception: printk("Forwarding unaligned exception at %lx (%lx)\n", pc, newpc); - (®s)->pc = newpc; + regs->pc = newpc; return; } @@ -645,7 +649,7 @@ got_exception: current->comm, current->pid); printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n", - pc, una_reg(26), regs.ps); + pc, una_reg(26), regs->ps); printk("r0 = %016lx r1 = %016lx r2 = %016lx\n", una_reg(0), una_reg(1), una_reg(2)); printk("r3 = %016lx r4 = %016lx r5 = %016lx\n", @@ -665,10 +669,10 @@ got_exception: una_reg(22), una_reg(23), una_reg(24)); printk("r25= %016lx r27= %016lx r28= %016lx\n", una_reg(25), una_reg(27), una_reg(28)); - printk("gp = %016lx sp = %p\n", regs.gp, ®s+1); + printk("gp = %016lx sp = %p\n", regs->gp, regs+1); dik_show_code((unsigned int *)pc); - dik_show_trace((unsigned long *)(®s+1)); + dik_show_trace((unsigned long *)(regs+1)); if (test_and_set_thread_flag (TIF_DIE_IF_KERNEL)) { printk("die_if_kernel recursion detected.\n"); @@ -762,7 +766,7 @@ static int unauser_reg_offsets[32] = { #undef R asmlinkage void -do_entUnaUser(void * va, unsigned long opcode, +do_entUnaUser(void __user * va, unsigned long opcode, unsigned long reg, struct pt_regs *regs) { static int cnt = 0;