blob: 9047c2fe8f23f4bf7378e04cf8dc2ef6fb79524d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASMAXP_PTRACE_H
2#define _ASMAXP_PTRACE_H
3
David Howells96433f6e2012-12-17 13:47:09 +00004#include <uapi/asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Christoph Hellwig481bed42005-11-07 00:59:47 -08006
Christoph Hellwigfd341ab2010-03-10 15:22:47 -08007#define arch_has_single_step() (1)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#define user_mode(regs) (((regs)->ps & 8) != 0)
9#define instruction_pointer(regs) ((regs)->pc)
10#define profile_pc(regs) instruction_pointer(regs)
Al Viro1ca97bb2012-11-18 12:50:10 -050011#define current_user_stack_pointer() rdusp()
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
akpm@osdl.orge52f4ca2006-01-12 01:05:37 -080013#define task_pt_regs(task) \
Al Viro27f45132006-01-12 01:05:36 -080014 ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Al Virobe53db62012-08-19 14:40:59 +120016#define current_pt_regs() \
17 ((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1)
Al Viro22062a92012-11-05 13:00:27 -050018#define signal_pt_regs current_pt_regs
Al Virobe53db62012-08-19 14:40:59 +120019
20#define force_successful_syscall_return() (current_pt_regs()->r0 = 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
蔡正龙a9302e82013-12-20 10:04:10 +080022static inline unsigned long regs_return_value(struct pt_regs *regs)
23{
24 return regs->r0;
25}
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#endif