aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Sheng <hesheng@wxiat.com>2022-10-09 09:18:48 +0800
committerguzitao <guzitao@wxiat.com>2022-11-01 01:29:12 +0000
commite156be6959d5c4e7e71af76bc9e69270ce208601 (patch)
tree65a0ad605d2f2eaa4bb4024aeb5d6b19f583ef7a
parentd5b85d88ab5e12fa0d0095ef27eb39850fd26b00 (diff)
downloadopenEuler-kernel-e156be6959d5c4e7e71af76bc9e69270ce208601.tar.gz
sw64: print real address of sp in show_regs()
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG -------------------------------- In show_regs(), we really want to print the address of stack pointer for debugging. Signed-off-by: He Sheng <hesheng@wxiat.com> Reviewed-by: Cui Wei <cuiwei@wxiat.com> Signed-off-by: Gu Zitao <guzitao@wxiat.com>
-rw-r--r--arch/sw_64/kernel/traps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sw_64/kernel/traps.c b/arch/sw_64/kernel/traps.c
index f01b88e53ff2df..5fac85c29bf6b1 100644
--- a/arch/sw_64/kernel/traps.c
+++ b/arch/sw_64/kernel/traps.c
@@ -69,7 +69,8 @@ void show_regs(struct pt_regs *regs)
regs->r22, regs->r23, regs->r24);
printk("t11= %016lx pv = %016lx at = %016lx\n",
regs->r25, regs->r27, regs->r28);
- printk("gp = %016lx sp = %p\n", regs->gp, regs+1);
+ printk("gp = %016lx sp = %px\n", regs->gp,
+ user_mode(regs) ? (void *)rdusp() : (regs + 1));
}
static void show_code(unsigned int *pc)