Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASMAXP_PTRACE_H |
| 2 | #define _ASMAXP_PTRACE_H |
| 3 | |
David Howells | 96433f6e | 2012-12-17 13:47:09 +0000 | [diff] [blame] | 4 | #include <uapi/asm/ptrace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
Christoph Hellwig | 481bed4 | 2005-11-07 00:59:47 -0800 | [diff] [blame] | 6 | |
Christoph Hellwig | fd341ab | 2010-03-10 15:22:47 -0800 | [diff] [blame] | 7 | #define arch_has_single_step() (1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #define user_mode(regs) (((regs)->ps & 8) != 0) |
| 9 | #define instruction_pointer(regs) ((regs)->pc) |
| 10 | #define profile_pc(regs) instruction_pointer(regs) |
Al Viro | 1ca97bb | 2012-11-18 12:50:10 -0500 | [diff] [blame] | 11 | #define current_user_stack_pointer() rdusp() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
akpm@osdl.org | e52f4ca | 2006-01-12 01:05:37 -0800 | [diff] [blame] | 13 | #define task_pt_regs(task) \ |
Al Viro | 27f4513 | 2006-01-12 01:05:36 -0800 | [diff] [blame] | 14 | ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Al Viro | be53db6 | 2012-08-19 14:40:59 +1200 | [diff] [blame] | 16 | #define current_pt_regs() \ |
| 17 | ((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1) |
Al Viro | 22062a9 | 2012-11-05 13:00:27 -0500 | [diff] [blame] | 18 | #define signal_pt_regs current_pt_regs |
Al Viro | be53db6 | 2012-08-19 14:40:59 +1200 | [diff] [blame] | 19 | |
| 20 | #define force_successful_syscall_return() (current_pt_regs()->r0 = 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
蔡正龙 | a9302e8 | 2013-12-20 10:04:10 +0800 | [diff] [blame] | 22 | static inline unsigned long regs_return_value(struct pt_regs *regs) |
| 23 | { |
| 24 | return regs->r0; |
| 25 | } |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #endif |