path: root/arch/csky/include/asm/ptrace.h
AgeCommit message (Collapse)AuthorLines
2020-05-13csky: Fixup calltrace panicGuo Ren-0/+10
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 <>
2020-04-03csky: Add kprobes supportedGuo Ren-0/+2
This patch enable kprobes, kretprobes, ftrace interface. It utilized software breakpoint and single step debug exceptions, instructions simulation on csky. We use USR_BKPT replace origin instruction, and the kprobe handler prepares an excutable memory slot for out-of-line execution with a copy of the original instruction being probed. Most of instructions could be executed by single-step, but some instructions need origin pc value to execute and we need software simulate these instructions. Signed-off-by: Guo Ren <> Cc: Arnd Bergmann <> Cc: Steven Rostedt (VMware) <>
2020-03-08csky: Implement ptrace regs and stack APIGuo Ren-0/+41
Needed for kprobes support. Copied and adapted from Patrick's patch, but it has been modified for csky's pt_regs. ref: Signed-off-by: Guo Ren <> Cc: Patrick Staehlin <>
2019-04-22csky: Use in_syscall & forget_syscall instead of r11_sigGuo Ren-0/+12
We could use regs->sr 16-24 bits to detect syscall: VEC_TRAP0 and r11_sig is no necessary for current implementation. In this patch, we implement the in_syscall and forget_syscall which are inspired from arm & nds32, but csky pt_regs has no syscall_num element and we just set zero to regs->sr's vector-bits-field instead. For ret_from_fork, current task was forked from parent which is in syscall progress and its regs->sr has been already setted with VEC_TRAP0. See: arch/csky/kernel/process.c: copy_thread() Signed-off-by: Guo Ren <>
2019-04-22csky: Add non-uapi asm/ptrace.h namespaceGuo Ren-0/+29
Move #ifdef __KERNEL__ code in the uapi namespace to non-uapi include/asm/ptrace.h namespace and remove #ifdef __KERNEL__ in include/asm/ptrace.h. Seperate ptrace.h in uapi and non-uapi is more common and clear. Signed-off-by: Guo Ren <> Cc: Dmitry V. Levin <>