path: root/arch/csky/include/asm/ptrace.h
diff options
authorGuo Ren <>2020-05-13 15:15:25 +0800
committerGuo Ren <>2020-05-13 17:55:06 +0800
commit18c07d23da5a48525b2955aa269b8bb108c19300 (patch)
tree450a798836c2658ff1a2b7fce73bbc5bd59df9af /arch/csky/include/asm/ptrace.h
parent229a0ddee1108a3f82a873e6cbbe35c92c540444 (diff)
csky: Fixup calltrace panic
The implementation of show_stack will panic with wrong fp: addr = *fp++; because the fp isn't checked properly. The current implementations of show_stack, wchan and stack_trace haven't been designed properly, so just deprecate them. This patch is a reference to riscv's way, all codes are modified from arm's. The patch is passed with: - cat /proc/<pid>/stack - cat /proc/<pid>/wchan - echo c > /proc/sysrq-trigger Signed-off-by: Guo Ren <>
Diffstat (limited to 'arch/csky/include/asm/ptrace.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/csky/include/asm/ptrace.h b/arch/csky/include/asm/ptrace.h
index aae5aa96cf54..bcfb7070e48d 100644
--- a/arch/csky/include/asm/ptrace.h
+++ b/arch/csky/include/asm/ptrace.h
@@ -58,6 +58,16 @@ static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
return regs->usp;
+static inline unsigned long frame_pointer(struct pt_regs *regs)
+ return regs->regs[4];
+static inline void frame_pointer_set(struct pt_regs *regs,
+ unsigned long val)
+ regs->regs[4] = val;
extern int regs_query_register_offset(const char *name);
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
unsigned int n);