patch-2.1.23 linux/arch/alpha/kernel/traps.c

Next file: linux/arch/alpha/mm/extable.c
Previous file: linux/arch/alpha/kernel/signal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.22/linux/arch/alpha/kernel/traps.c linux/arch/alpha/kernel/traps.c
@@ -21,15 +21,16 @@
 		   unsigned long *r9_15)
 {
 	long i;
-	unsigned long sp;
+	unsigned long sp, ra;
 	unsigned int * pc;
 
 	if (regs->ps & 8)
 		return;
 	printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
 	sp = (unsigned long) (regs+1);
+	__get_user(ra, (unsigned long *)sp);
 	printk("pc = [<%016lx>] ps = %04lx\n", regs->pc, regs->ps);
-	printk("rp = [<%016lx>] sp = %016lx\n", regs->r26, sp);
+	printk("rp = [<%016lx>] ra = [<%016lx>]\n", regs->r26, ra);
 	printk("r0 = %016lx  r1 = %016lx\n", regs->r0, regs->r1);
 	printk("r2 = %016lx  r3 = %016lx\n", regs->r2, regs->r3);
 	printk("r4 = %016lx  r5 = %016lx\n", regs->r4, regs->r5);
@@ -49,13 +50,17 @@
 	printk("r20= %016lx  r21= %016lx\n", regs->r20, regs->r21);
 	printk("r22= %016lx  r23= %016lx\n", regs->r22, regs->r23);
 	printk("r24= %016lx  r25= %016lx\n", regs->r24, regs->r25);
-	printk("r26= %016lx  r27= %016lx\n", regs->r26, regs->r27);
-	printk("r28= %016lx  r29= %016lx\n", regs->r28, regs->gp);
+	printk("r27= %016lx  r28= %016lx\n", regs->r27, regs->r28);
+	printk("gp = %016lx  sp = %016lx\n", regs->gp, sp);
 
 	printk("Code:");
 	pc = (unsigned int *) regs->pc;
-	for (i = -3; i < 6; i++)
-		printk("%c%08x%c",i?' ':'<',pc[i],i?' ':'>');
+	for (i = -3; i < 6; i++) {
+		unsigned int insn;
+		if (__get_user(insn, pc+i))
+			break;
+		printk("%c%08x%c",i?' ':'<',insn,i?' ':'>');
+	}
 	printk("\n");
 	do_exit(SIGSEGV);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov