Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2003 PathScale, Inc. |
| 3 | * |
| 4 | * Licensed under the GPL |
| 5 | */ |
| 6 | |
| 7 | #ifndef __UM_PTRACE_X86_64_H |
| 8 | #define __UM_PTRACE_X86_64_H |
| 9 | |
| 10 | #include "linux/compiler.h" |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 11 | #include "asm/errno.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #define __FRAME_OFFSETS /* Needed to get the R* macros */ |
| 14 | #include "asm/ptrace-generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Jeff Dike | 79d20b1 | 2005-05-03 07:54:51 +0100 | [diff] [blame] | 16 | #define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64 |
| 17 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #define PT_REGS_RBX(r) UPT_RBX(&(r)->regs) |
| 19 | #define PT_REGS_RCX(r) UPT_RCX(&(r)->regs) |
| 20 | #define PT_REGS_RDX(r) UPT_RDX(&(r)->regs) |
| 21 | #define PT_REGS_RSI(r) UPT_RSI(&(r)->regs) |
| 22 | #define PT_REGS_RDI(r) UPT_RDI(&(r)->regs) |
| 23 | #define PT_REGS_RBP(r) UPT_RBP(&(r)->regs) |
| 24 | #define PT_REGS_RAX(r) UPT_RAX(&(r)->regs) |
| 25 | #define PT_REGS_R8(r) UPT_R8(&(r)->regs) |
| 26 | #define PT_REGS_R9(r) UPT_R9(&(r)->regs) |
| 27 | #define PT_REGS_R10(r) UPT_R10(&(r)->regs) |
| 28 | #define PT_REGS_R11(r) UPT_R11(&(r)->regs) |
| 29 | #define PT_REGS_R12(r) UPT_R12(&(r)->regs) |
| 30 | #define PT_REGS_R13(r) UPT_R13(&(r)->regs) |
| 31 | #define PT_REGS_R14(r) UPT_R14(&(r)->regs) |
| 32 | #define PT_REGS_R15(r) UPT_R15(&(r)->regs) |
| 33 | |
| 34 | #define PT_REGS_FS(r) UPT_FS(&(r)->regs) |
| 35 | #define PT_REGS_GS(r) UPT_GS(&(r)->regs) |
| 36 | #define PT_REGS_DS(r) UPT_DS(&(r)->regs) |
| 37 | #define PT_REGS_ES(r) UPT_ES(&(r)->regs) |
| 38 | #define PT_REGS_SS(r) UPT_SS(&(r)->regs) |
| 39 | #define PT_REGS_CS(r) UPT_CS(&(r)->regs) |
| 40 | |
| 41 | #define PT_REGS_ORIG_RAX(r) UPT_ORIG_RAX(&(r)->regs) |
| 42 | #define PT_REGS_RIP(r) UPT_IP(&(r)->regs) |
| 43 | #define PT_REGS_RSP(r) UPT_SP(&(r)->regs) |
| 44 | |
| 45 | #define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs) |
| 46 | |
| 47 | /* XXX */ |
| 48 | #define user_mode(r) UPT_IS_USER(&(r)->regs) |
| 49 | #define PT_REGS_ORIG_SYSCALL(r) PT_REGS_RAX(r) |
| 50 | #define PT_REGS_SYSCALL_RET(r) PT_REGS_RAX(r) |
| 51 | |
| 52 | #define PT_FIX_EXEC_STACK(sp) do ; while(0) |
| 53 | |
| 54 | #define profile_pc(regs) PT_REGS_IP(regs) |
| 55 | |
Al Viro | 17dcf75 | 2008-08-18 17:47:45 -0400 | [diff] [blame] | 56 | struct user_desc; |
| 57 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 58 | static inline int ptrace_get_thread_area(struct task_struct *child, int idx, |
| 59 | struct user_desc __user *user_desc) |
| 60 | { |
| 61 | return -ENOSYS; |
| 62 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 64 | static inline int ptrace_set_thread_area(struct task_struct *child, int idx, |
| 65 | struct user_desc __user *user_desc) |
| 66 | { |
| 67 | return -ENOSYS; |
| 68 | } |
| 69 | |
Jeff Dike | 77bf440 | 2007-10-16 01:26:58 -0700 | [diff] [blame] | 70 | extern long arch_prctl(struct task_struct *task, int code, |
| 71 | unsigned long __user *addr); |
Paolo 'Blaisorblade' Giarrusso | aa6758d | 2006-03-31 02:30:22 -0800 | [diff] [blame] | 72 | #endif |