[Linux-ia64] [patch] 2.4.21-pre5-bk arch/ia64/kernel/unwind.c

From: Keith Owens <kaos_at_sgi.com>
Date: 2003-03-19 14:08:55
David has said that he has applied the take the "read unwind data from
r0" patch to 2.5, so add it to 2.4.  The check for info->pt before
calling get_scratch_regs() is a merge error, get_scratch_regs() does
all the checking (needs to be in 2.5 as well).

--- 2.4.21-pre5-ia64-bk/arch/ia64/kernel/unwind.c	Wed Mar 19 11:56:52 2003
+++ linux/arch/ia64/kernel/unwind.c	Wed Mar 19 14:03:57 2003
@@ -253,6 +253,11 @@
 	struct pt_regs *pt;
 
 	if ((unsigned) regnum - 1 >= 127) {
+		if (regnum == 0 && !write) {
+			*val = 0;	/* read r0 always returns 0 */
+			*nat = 0;
+			return 0;
+		}
 		UNW_DPRINT(0, "unwind.%s: trying to access non-existent r%u\n",
 			   __FUNCTION__, regnum);
 		return -1;
@@ -318,11 +323,6 @@
 			}
 		} else {
 			/* access a scratch register */
-			if (!info->pt) {
-				UNW_DPRINT(0, "unwind.%s: no pt-regs; cannot access r%d\n",
-					   __FUNCTION__, regnum);
-				return -1;
-			}
 			pt = get_scratch_regs(info);
 			addr = (unsigned long *) (pt + pt_regs_off(regnum));
 			if (info->pri_unat_loc)
Received on Tue Mar 18 19:09:38 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:12 EST