x86, ptrace: change BTS GET ptrace interface
[safe/jmp/linux-2.6] / include / asm-x86 / ptrace-abi.h
1 #ifndef _ASM_X86_PTRACE_ABI_H
2 #define _ASM_X86_PTRACE_ABI_H
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)
28 #define R15 0
29 #define R14 8
30 #define R13 16
31 #define R12 24
32 #define RBP 32
33 #define RBX 40
34 /* arguments: interrupts/non tracing syscalls only save upto here*/
35 #define R11 48
36 #define R10 56
37 #define R9 64
38 #define R8 72
39 #define RAX 80
40 #define RCX 88
41 #define RDX 96
42 #define RSI 104
43 #define RDI 112
44 #define ORIG_RAX 120       /* = ERROR */
45 /* end of arguments */
46 /* cpu exception frame or undefined in case of fast syscall. */
47 #define RIP 128
48 #define CS 136
49 #define EFLAGS 144
50 #define RSP 152
51 #define SS 160
52 #define ARGOFFSET R11
53 #endif /* __ASSEMBLY__ */
54
55 /* top of stack page */
56 #define FRAME_SIZE 168
57
58 #endif /* !__i386__ */
59
60 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
61 #define PTRACE_GETREGS            12
62 #define PTRACE_SETREGS            13
63 #define PTRACE_GETFPREGS          14
64 #define PTRACE_SETFPREGS          15
65 #define PTRACE_GETFPXREGS         18
66 #define PTRACE_SETFPXREGS         19
67
68 #define PTRACE_OLDSETOPTIONS      21
69
70 /* only useful for access 32bit programs / kernels */
71 #define PTRACE_GET_THREAD_AREA    25
72 #define PTRACE_SET_THREAD_AREA    26
73
74 #ifdef __x86_64__
75 # define PTRACE_ARCH_PRCTL        30
76 #else
77 # define PTRACE_SYSEMU            31
78 # define PTRACE_SYSEMU_SINGLESTEP 32
79 #endif
80
81 #define PTRACE_SINGLEBLOCK      33      /* resume execution until next branch */
82
83 /* Return maximal BTS buffer size in number of records,
84    if successuf; -1, otherwise.
85    EOPNOTSUPP...processor does not support bts tracing */
86 #define PTRACE_BTS_MAX_BUFFER_SIZE 40
87
88 /* Allocate new bts buffer (free old one, if exists) of size DATA bts records;
89    parameter ADDR is ignored.
90    Return 0, if successful; -1, otherwise.
91    EOPNOTSUPP...processor does not support bts tracing
92    EINVAL.......invalid size in records
93    ENOMEM.......out of memory */
94 #define PTRACE_BTS_ALLOCATE_BUFFER 41
95
96 /* Return the size of the bts buffer in number of bts records,
97    if successful; -1, otherwise.
98    EOPNOTSUPP...processor does not support bts tracing
99    ENXIO........no buffer allocated */
100 #define PTRACE_BTS_GET_BUFFER_SIZE 42
101
102 /* Read the DATA'th bts record into a ptrace_bts_record buffer
103    provided in ADDR.
104    Records are ordered from newest to oldest.
105    Return 0, if successful; -1, otherwise
106    EOPNOTSUPP...processor does not support bts tracing
107    ENXIO........no buffer allocated
108    EINVAL.......invalid index */
109 #define PTRACE_BTS_READ_RECORD 43
110
111 /* Configure last branch trace; the configuration is given as a bit-mask of
112    PTRACE_BTS_O_* options in DATA; parameter ADDR is ignored.
113    Return 0, if successful; -1, otherwise
114    EOPNOTSUPP...processor does not support bts tracing
115    ENXIO........no buffer allocated */
116 #define PTRACE_BTS_CONFIG 44
117
118 /* Return the configuration as bit-mask of PTRACE_BTS_O_* options
119    if successful; -1, otherwise.
120    EOPNOTSUPP...processor does not support bts tracing
121    ENXIO........no buffer allocated */
122 #define PTRACE_BTS_STATUS 45
123
124 /* Trace configuration options */
125 /* Collect last branch trace */
126 #define PTRACE_BTS_O_TRACE_TASK 0x1
127 /* Take timestamps when the task arrives and departs */
128 #define PTRACE_BTS_O_TIMESTAMPS 0x2
129
130 #endif