H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_PTRACE_ABI_H |
| 2 | #define _ASM_X86_PTRACE_ABI_H |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 3 | |
| 4 | #ifdef __i386__ |
| 5 | |
| 6 | #define EBX 0 |
| 7 | #define ECX 1 |
| 8 | #define EDX 2 |
| 9 | #define ESI 3 |
| 10 | #define EDI 4 |
| 11 | #define EBP 5 |
| 12 | #define EAX 6 |
| 13 | #define DS 7 |
| 14 | #define ES 8 |
| 15 | #define FS 9 |
| 16 | #define GS 10 |
| 17 | #define ORIG_EAX 11 |
| 18 | #define EIP 12 |
| 19 | #define CS 13 |
| 20 | #define EFL 14 |
| 21 | #define UESP 15 |
| 22 | #define SS 16 |
| 23 | #define FRAME_SIZE 17 |
| 24 | |
| 25 | #else /* __i386__ */ |
| 26 | |
| 27 | #if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS) |
Denys Vlasenko | e90e147 | 2015-02-26 14:40:28 -0800 | [diff] [blame] | 28 | /* |
| 29 | * C ABI says these regs are callee-preserved. They aren't saved on kernel entry |
| 30 | * unless syscall needs a complete, fully filled "struct pt_regs". |
| 31 | */ |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 32 | #define R15 0 |
| 33 | #define R14 8 |
| 34 | #define R13 16 |
| 35 | #define R12 24 |
| 36 | #define RBP 32 |
| 37 | #define RBX 40 |
Denys Vlasenko | e90e147 | 2015-02-26 14:40:28 -0800 | [diff] [blame] | 38 | /* These regs are callee-clobbered. Always saved on kernel entry. */ |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 39 | #define R11 48 |
| 40 | #define R10 56 |
| 41 | #define R9 64 |
| 42 | #define R8 72 |
| 43 | #define RAX 80 |
| 44 | #define RCX 88 |
| 45 | #define RDX 96 |
| 46 | #define RSI 104 |
| 47 | #define RDI 112 |
Denys Vlasenko | e90e147 | 2015-02-26 14:40:28 -0800 | [diff] [blame] | 48 | /* |
| 49 | * On syscall entry, this is syscall#. On CPU exception, this is error code. |
| 50 | * On hw interrupt, it's IRQ number: |
| 51 | */ |
| 52 | #define ORIG_RAX 120 |
| 53 | /* Return frame for iretq */ |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 54 | #define RIP 128 |
| 55 | #define CS 136 |
| 56 | #define EFLAGS 144 |
| 57 | #define RSP 152 |
| 58 | #define SS 160 |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 59 | #endif /* __ASSEMBLY__ */ |
| 60 | |
| 61 | /* top of stack page */ |
| 62 | #define FRAME_SIZE 168 |
| 63 | |
| 64 | #endif /* !__i386__ */ |
| 65 | |
| 66 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
| 67 | #define PTRACE_GETREGS 12 |
| 68 | #define PTRACE_SETREGS 13 |
| 69 | #define PTRACE_GETFPREGS 14 |
| 70 | #define PTRACE_SETFPREGS 15 |
| 71 | #define PTRACE_GETFPXREGS 18 |
| 72 | #define PTRACE_SETFPXREGS 19 |
| 73 | |
| 74 | #define PTRACE_OLDSETOPTIONS 21 |
| 75 | |
| 76 | /* only useful for access 32bit programs / kernels */ |
| 77 | #define PTRACE_GET_THREAD_AREA 25 |
| 78 | #define PTRACE_SET_THREAD_AREA 26 |
| 79 | |
| 80 | #ifdef __x86_64__ |
| 81 | # define PTRACE_ARCH_PRCTL 30 |
Thomas Gleixner | 686d8c6 | 2007-10-17 18:04:40 +0200 | [diff] [blame] | 82 | #endif |
| 83 | |
Roland McGrath | d4d6715 | 2008-07-09 02:38:07 -0700 | [diff] [blame] | 84 | #define PTRACE_SYSEMU 31 |
| 85 | #define PTRACE_SYSEMU_SINGLESTEP 32 |
| 86 | |
Roland McGrath | 0fa376e | 2008-01-30 13:30:55 +0100 | [diff] [blame] | 87 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ |
| 88 | |
Markus Metzger | 93fa763 | 2008-04-08 11:01:58 +0200 | [diff] [blame] | 89 | #ifndef __ASSEMBLY__ |
Jaswinder Singh Rajput | 420ab35 | 2009-01-30 22:52:16 +0530 | [diff] [blame] | 90 | #include <linux/types.h> |
Peter Zijlstra | faa4602 | 2010-03-25 14:51:50 +0100 | [diff] [blame] | 91 | #endif |
Markus Metzger | eee3af4 | 2008-01-30 13:31:09 +0100 | [diff] [blame] | 92 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 93 | #endif /* _ASM_X86_PTRACE_ABI_H */ |