summaryrefslogtreecommitdiff
path: root/arch/arc/include/asm/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/include/asm/ptrace.h')
-rw-r--r--arch/arc/include/asm/ptrace.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h
index 4c93594..3afadef 100644
--- a/arch/arc/include/asm/ptrace.h
+++ b/arch/arc/include/asm/ptrace.h
@@ -91,6 +91,14 @@ struct callee_regs {
#define in_syscall(regs) (((regs->orig_r8) >= 0 && \
(regs->orig_r8 <= NR_syscalls)) ? 1 : 0)
+#define current_pt_regs() \
+({ \
+ /* open-coded current_thread_info() */ \
+ register unsigned long sp asm ("sp"); \
+ unsigned long pg_start = (sp & ~(THREAD_SIZE - 1)); \
+ (struct pt_regs *)(pg_start + THREAD_SIZE - 4) - 1; \
+})
+
#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */