xref: /openbmc/linux/arch/nios2/include/asm/ptrace.h (revision c819e2cf)
1 /*
2  * Copyright (C) 2013 Altera Corporation
3  * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
4  * Copyright (C) 2004 Microtronix Datacom Ltd
5  *
6  * based on m68k asm/processor.h
7  *
8  * This file is subject to the terms and conditions of the GNU General Public
9  * License.  See the file "COPYING" in the main directory of this archive
10  * for more details.
11  */
12 
13 #ifndef _ASM_NIOS2_PTRACE_H
14 #define _ASM_NIOS2_PTRACE_H
15 
16 #include <uapi/asm/ptrace.h>
17 
18 #ifndef __ASSEMBLY__
19 #define user_mode(regs)	(((regs)->estatus & ESTATUS_EU))
20 
21 #define instruction_pointer(regs)	((regs)->ra)
22 #define profile_pc(regs)		instruction_pointer(regs)
23 #define user_stack_pointer(regs)	((regs)->sp)
24 extern void show_regs(struct pt_regs *);
25 
26 #define current_pt_regs() \
27 	((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE)\
28 		- 1)
29 
30 int do_syscall_trace_enter(void);
31 void do_syscall_trace_exit(void);
32 #endif /* __ASSEMBLY__ */
33 #endif /* _ASM_NIOS2_PTRACE_H */
34