Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _X86_64_PTRACE_H |
| 2 | #define _X86_64_PTRACE_H |
| 3 | |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 4 | #include <asm/ptrace-abi.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 6 | #ifndef __ASSEMBLY__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 8 | struct pt_regs { |
| 9 | unsigned long r15; |
| 10 | unsigned long r14; |
| 11 | unsigned long r13; |
| 12 | unsigned long r12; |
| 13 | unsigned long rbp; |
| 14 | unsigned long rbx; |
| 15 | /* arguments: non interrupts/non tracing syscalls only save upto here*/ |
| 16 | unsigned long r11; |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 17 | unsigned long r10; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | unsigned long r9; |
| 19 | unsigned long r8; |
| 20 | unsigned long rax; |
| 21 | unsigned long rcx; |
| 22 | unsigned long rdx; |
| 23 | unsigned long rsi; |
| 24 | unsigned long rdi; |
| 25 | unsigned long orig_rax; |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 26 | /* end of arguments */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | /* cpu exception frame or undefined */ |
| 28 | unsigned long rip; |
| 29 | unsigned long cs; |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 30 | unsigned long eflags; |
| 31 | unsigned long rsp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | unsigned long ss; |
Jeff Dike | 70e0eb8 | 2006-09-25 23:33:09 -0700 | [diff] [blame] | 33 | /* top of stack page */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #endif |
| 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) |
| 39 | #define user_mode(regs) (!!((regs)->cs & 3)) |
Vincent Hanquez | fa1e1bd | 2005-06-23 00:08:44 -0700 | [diff] [blame] | 40 | #define user_mode_vm(regs) user_mode(regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define instruction_pointer(regs) ((regs)->rip) |
Ananth N Mavinakayanahalli | b3f827c | 2006-10-02 02:17:31 -0700 | [diff] [blame] | 42 | #define regs_return_value(regs) ((regs)->rax) |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | extern unsigned long profile_pc(struct pt_regs *regs); |
| 45 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); |
| 46 | |
Andi Kleen | f1290ec | 2005-04-16 15:24:59 -0700 | [diff] [blame] | 47 | struct task_struct; |
| 48 | |
| 49 | extern unsigned long |
| 50 | convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs); |
| 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | enum { |
| 53 | EF_CF = 0x00000001, |
| 54 | EF_PF = 0x00000004, |
| 55 | EF_AF = 0x00000010, |
| 56 | EF_ZF = 0x00000040, |
| 57 | EF_SF = 0x00000080, |
| 58 | EF_TF = 0x00000100, |
| 59 | EF_IE = 0x00000200, |
| 60 | EF_DF = 0x00000400, |
| 61 | EF_OF = 0x00000800, |
| 62 | EF_IOPL = 0x00003000, |
| 63 | EF_IOPL_RING0 = 0x00000000, |
| 64 | EF_IOPL_RING1 = 0x00001000, |
| 65 | EF_IOPL_RING2 = 0x00002000, |
| 66 | EF_NT = 0x00004000, /* nested task */ |
| 67 | EF_RF = 0x00010000, /* resume */ |
| 68 | EF_VM = 0x00020000, /* virtual mode */ |
| 69 | EF_AC = 0x00040000, /* alignment */ |
| 70 | EF_VIF = 0x00080000, /* virtual interrupt */ |
| 71 | EF_VIP = 0x00100000, /* virtual interrupt pending */ |
| 72 | EF_ID = 0x00200000, /* id */ |
| 73 | }; |
| 74 | |
| 75 | #endif |
| 76 | |
| 77 | #endif |