blob: 580aee3072e0684082b0f74e1358925efaf4f540 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_PTRACE_ABI_H
2#define _ASM_X86_PTRACE_ABI_H
Thomas Gleixner686d8c62007-10-17 18:04:40 +02003
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 Vlasenkoe90e1472015-02-26 14:40:28 -080028/*
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 Gleixner686d8c62007-10-17 18:04:40 +020032#define R15 0
33#define R14 8
34#define R13 16
35#define R12 24
36#define RBP 32
37#define RBX 40
Denys Vlasenkoe90e1472015-02-26 14:40:28 -080038/* These regs are callee-clobbered. Always saved on kernel entry. */
Thomas Gleixner686d8c62007-10-17 18:04:40 +020039#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 Vlasenkoe90e1472015-02-26 14:40:28 -080048/*
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 Gleixner686d8c62007-10-17 18:04:40 +020054#define RIP 128
55#define CS 136
56#define EFLAGS 144
57#define RSP 152
58#define SS 160
Thomas Gleixner686d8c62007-10-17 18:04:40 +020059#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 Gleixner686d8c62007-10-17 18:04:40 +020082#endif
83
Roland McGrathd4d67152008-07-09 02:38:07 -070084#define PTRACE_SYSEMU 31
85#define PTRACE_SYSEMU_SINGLESTEP 32
86
Roland McGrath0fa376e2008-01-30 13:30:55 +010087#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
88
Markus Metzger93fa7632008-04-08 11:01:58 +020089#ifndef __ASSEMBLY__
Jaswinder Singh Rajput420ab352009-01-30 22:52:16 +053090#include <linux/types.h>
Peter Zijlstrafaa46022010-03-25 14:51:50 +010091#endif
Markus Metzgereee3af42008-01-30 13:31:09 +010092
H. Peter Anvin1965aae2008-10-22 22:26:29 -070093#endif /* _ASM_X86_PTRACE_ABI_H */