aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/ptrace.h')
-rw-r--r--arch/mips/include/asm/ptrace.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 4f5da948a777..a3186f2bb8a0 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)
49 49
50#define instruction_pointer(regs) ((regs)->cp0_epc) 50#define instruction_pointer(regs) ((regs)->cp0_epc)
51#define profile_pc(regs) instruction_pointer(regs) 51#define profile_pc(regs) instruction_pointer(regs)
52#define user_stack_pointer(r) ((r)->regs[29])
52 53
53extern asmlinkage void syscall_trace_enter(struct pt_regs *regs); 54extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
54extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); 55extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
@@ -61,4 +62,10 @@ static inline void die_if_kernel(const char *str, struct pt_regs *regs)
61 die(str, regs); 62 die(str, regs);
62} 63}
63 64
65#define current_pt_regs() \
66({ \
67 unsigned long sp = (unsigned long)__builtin_frame_address(0); \
68 (struct pt_regs *)((sp | (THREAD_SIZE - 1)) + 1 - 32) - 1; \
69})
70
64#endif /* _ASM_PTRACE_H */ 71#endif /* _ASM_PTRACE_H */