blob: e72cd0df5ba381436b8158ebad5ee0f758ba8eab [file] [log] [blame]
Al Viro243412b2012-05-20 00:05:58 -04001#ifndef __UM_X86_PTRACE_H
2#define __UM_X86_PTRACE_H
3
Al Viro27f85f12011-08-18 20:02:59 +01004#ifdef CONFIG_X86_32
5# include "ptrace_32.h"
6#else
7# include "ptrace_64.h"
8#endif
Al Viro243412b2012-05-20 00:05:58 -04009
10#define PT_REGS_AX(r) UPT_AX(&(r)->regs)
11#define PT_REGS_BX(r) UPT_BX(&(r)->regs)
12#define PT_REGS_CX(r) UPT_CX(&(r)->regs)
13#define PT_REGS_DX(r) UPT_DX(&(r)->regs)
14
15#define PT_REGS_SI(r) UPT_SI(&(r)->regs)
16#define PT_REGS_DI(r) UPT_DI(&(r)->regs)
17#define PT_REGS_BP(r) UPT_BP(&(r)->regs)
18#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
19
20#define PT_REGS_CS(r) UPT_CS(&(r)->regs)
21#define PT_REGS_SS(r) UPT_SS(&(r)->regs)
22#define PT_REGS_DS(r) UPT_DS(&(r)->regs)
23#define PT_REGS_ES(r) UPT_ES(&(r)->regs)
24
25#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_AX(r)
26#define PT_REGS_SYSCALL_RET(r) PT_REGS_AX(r)
27
28#define PT_FIX_EXEC_STACK(sp) do ; while(0)
29
30#define profile_pc(regs) PT_REGS_IP(regs)
31
32#define UPT_RESTART_SYSCALL(r) (UPT_IP(r) -= 2)
Al Viroa3170d22012-05-22 21:16:35 -040033#define PT_REGS_SET_SYSCALL_RETURN(r, res) (PT_REGS_AX(r) = (res))
Al Viro243412b2012-05-20 00:05:58 -040034
Al Viroa3170d22012-05-22 21:16:35 -040035static inline long regs_return_value(struct pt_regs *regs)
Al Viro243412b2012-05-20 00:05:58 -040036{
Al Viroa3170d22012-05-22 21:16:35 -040037 return PT_REGS_AX(regs);
Al Viro243412b2012-05-20 00:05:58 -040038}
39#endif /* __UM_X86_PTRACE_H */