1 #ifndef _ASM_X86_PTRACE_ABI_H
2 #define _ASM_X86_PTRACE_ABI_H
27 #if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
34 /* arguments: interrupts/non tracing syscalls only save upto here*/
44 #define ORIG_RAX 120 /* = ERROR */
45 /* end of arguments */
46 /* cpu exception frame or undefined in case of fast syscall. */
53 #endif /* __ASSEMBLY__ */
55 /* top of stack page */
56 #define FRAME_SIZE 168
58 #endif /* !__i386__ */
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
68 #define PTRACE_OLDSETOPTIONS 21
70 /* only useful for access 32bit programs / kernels */
71 #define PTRACE_GET_THREAD_AREA 25
72 #define PTRACE_SET_THREAD_AREA 26
75 # define PTRACE_ARCH_PRCTL 30
77 # define PTRACE_SYSEMU 31
78 # define PTRACE_SYSEMU_SINGLESTEP 32
81 #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
84 /* configuration/status structure used in PTRACE_BTS_CONFIG and
85 PTRACE_BTS_STATUS commands.
87 struct ptrace_bts_config {
88 /* requested or actual size of BTS buffer in bytes */
90 /* bitmask of below flags */
92 /* buffer overflow signal */
97 #define PTRACE_BTS_O_TRACE 0x1 /* branch trace */
98 #define PTRACE_BTS_O_SCHED 0x2 /* scheduling events w/ jiffies */
99 #define PTRACE_BTS_O_SIGNAL 0x4 /* send SIG<signal> on buffer overflow
100 instead of wrapping around */
101 #define PTRACE_BTS_O_CUT_SIZE 0x8 /* cut requested size to max available
102 instead of failing */
104 #define PTRACE_BTS_CONFIG 40
105 /* Configure branch trace recording.
106 ADDR points to a struct ptrace_bts_config.
107 DATA gives the size of that buffer.
108 A new buffer is allocated, iff the size changes.
109 Returns the number of bytes read.
111 #define PTRACE_BTS_STATUS 41
112 /* Return the current configuration in a struct ptrace_bts_config
113 pointed to by ADDR; DATA gives the size of that buffer.
114 Returns the number of bytes written.
116 #define PTRACE_BTS_SIZE 42
117 /* Return the number of available BTS records.
118 DATA and ADDR are ignored.
120 #define PTRACE_BTS_GET 43
121 /* Get a single BTS record.
122 DATA defines the index into the BTS array, where 0 is the newest
123 entry, and higher indices refer to older entries.
124 ADDR is pointing to struct bts_struct (see asm/ds.h).
126 #define PTRACE_BTS_CLEAR 44
127 /* Clear the BTS buffer.
128 DATA and ADDR are ignored.
130 #define PTRACE_BTS_DRAIN 45
131 /* Read all available BTS records and clear the buffer.
132 ADDR points to an array of struct bts_struct.
133 DATA gives the size of that buffer.
134 BTS records are read from oldest to newest.
135 Returns number of BTS records drained.