From 556ad14249f7db7e21e7977d2663f35bad2fd8c0 Mon Sep 17 00:00:00 2001 From: Keith Owens Date: Thu, 13 Mar 2003 19:25:24 -0800 Subject: [PATCH] [PATCH] ia64: unwind.c - allow unw_access_gr(r0) The patch allows unw_access_gr() to read from r0, to support unwind directives such as .save ar.pfs,r0 and .save rp,r0. --- arch/ia64/kernel/unwind.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index f082018fcbc12..4594c3dbbd033 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c @@ -253,6 +253,11 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char 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; -- 2.53.0