summaryrefslogtreecommitdiffstats
path: root/arch/nios2/include/asm
diff options
context:
space:
mode:
authorLey Foon Tan <lftan@altera.com>2014-11-06 15:20:13 +0800
committerLey Foon Tan <lftan@altera.com>2014-12-08 12:56:04 +0800
commit106174d0d8d6f263fd07fdffd05c5573611e0922 (patch)
tree25fb2f89ebe8cd048c7d61cbd6fe638221689c57 /arch/nios2/include/asm
parent42381bf1f2de13bbfbdea74b78af9768ab65b80c (diff)
nios2: ptrace support
Add ptrace support for nios2. Signed-off-by: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'arch/nios2/include/asm')
-rw-r--r--arch/nios2/include/asm/ptrace.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/ptrace.h b/arch/nios2/include/asm/ptrace.h
new file mode 100644
index 00000000000..20fb1cf2dab
--- /dev/null
+++ b/arch/nios2/include/asm/ptrace.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2013 Altera Corporation
+ * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
+ * Copyright (C) 2004 Microtronix Datacom Ltd
+ *
+ * based on m68k asm/processor.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef _ASM_NIOS2_PTRACE_H
+#define _ASM_NIOS2_PTRACE_H
+
+#include <uapi/asm/ptrace.h>
+
+#ifndef __ASSEMBLY__
+#define user_mode(regs) (((regs)->estatus & ESTATUS_EU))
+
+#define instruction_pointer(regs) ((regs)->ra)
+#define profile_pc(regs) instruction_pointer(regs)
+#define user_stack_pointer(regs) ((regs)->sp)
+extern void show_regs(struct pt_regs *);
+
+#define current_pt_regs() \
+ ((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE)\
+ - 1)
+
+int do_syscall_trace_enter(void);
+void do_syscall_trace_exit(void);
+#endif /* __ASSEMBLY__ */
+#endif /* _ASM_NIOS2_PTRACE_H */