Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h.
[glibc.git] / sysdeps / unix / sysv / linux / powerpc / sys / ptrace.h
blob9fde99c74844e93b2fcbc94d374d7318b24d9d99
1 /* `ptrace' debugger support interface. Linux/PowerPC version.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _SYS_PTRACE_H
20 #define _SYS_PTRACE_H 1
22 #include <features.h>
23 #include <bits/types.h>
25 __BEGIN_DECLS
27 #if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H
28 /* Do not let Linux headers macros interfere with enum __ptrace_request. */
29 # undef PTRACE_ATTACH
30 # undef PTRACE_CONT
31 # undef PTRACE_DETACH
32 # undef PTRACE_GET_DEBUGREG
33 # undef PTRACE_GETEVENTMSG
34 # undef PTRACE_GETEVRREGS
35 # undef PTRACE_GETFPREGS
36 # undef PTRACE_GETREGS
37 # undef PTRACE_GETREGS64
38 # undef PTRACE_GETREGSET
39 # undef PTRACE_GETSIGINFO
40 # undef PTRACE_GETSIGMASK
41 # undef PTRACE_GETVRREGS
42 # undef PTRACE_GETVSRREGS
43 # undef PTRACE_INTERRUPT
44 # undef PTRACE_KILL
45 # undef PTRACE_LISTEN
46 # undef PTRACE_PEEKDATA
47 # undef PTRACE_PEEKSIGINFO
48 # undef PTRACE_PEEKTEXT
49 # undef PTRACE_POKEDATA
50 # undef PTRACE_POKETEXT
51 # undef PTRACE_SECCOMP_GET_FILTER
52 # undef PTRACE_SECCOMP_GET_METADATA
53 # undef PTRACE_SEIZE
54 # undef PTRACE_SET_DEBUGREG
55 # undef PTRACE_SETEVRREGS
56 # undef PTRACE_SETFPREGS
57 # undef PTRACE_SETOPTIONS
58 # undef PTRACE_SETREGS
59 # undef PTRACE_SETREGS64
60 # undef PTRACE_SETREGSET
61 # undef PTRACE_SETSIGINFO
62 # undef PTRACE_SETSIGMASK
63 # undef PTRACE_SETVRREGS
64 # undef PTRACE_SETVSRREGS
65 # undef PTRACE_SINGLEBLOCK
66 # undef PTRACE_SINGLESTEP
67 # undef PTRACE_SYSCALL
68 # undef PTRACE_TRACEME
69 #endif
71 /* Type of the REQUEST argument to `ptrace.' */
72 enum __ptrace_request
74 /* Indicate that the process making this request should be traced.
75 All signals received by this process can be intercepted by its
76 parent, and its parent can use the other `ptrace' requests. */
77 PTRACE_TRACEME = 0,
78 #define PT_TRACE_ME PTRACE_TRACEME
80 /* Return the word in the process's text space at address ADDR. */
81 PTRACE_PEEKTEXT = 1,
82 #define PT_READ_I PTRACE_PEEKTEXT
84 /* Return the word in the process's data space at address ADDR. */
85 PTRACE_PEEKDATA = 2,
86 #define PT_READ_D PTRACE_PEEKDATA
88 /* Return the word in the process's user area at offset ADDR. */
89 PTRACE_PEEKUSER = 3,
90 #define PT_READ_U PTRACE_PEEKUSER
92 /* Write the word DATA into the process's text space at address ADDR. */
93 PTRACE_POKETEXT = 4,
94 #define PT_WRITE_I PTRACE_POKETEXT
96 /* Write the word DATA into the process's data space at address ADDR. */
97 PTRACE_POKEDATA = 5,
98 #define PT_WRITE_D PTRACE_POKEDATA
100 /* Write the word DATA into the process's user area at offset ADDR. */
101 PTRACE_POKEUSER = 6,
102 #define PT_WRITE_U PTRACE_POKEUSER
104 /* Continue the process. */
105 PTRACE_CONT = 7,
106 #define PT_CONTINUE PTRACE_CONT
108 /* Kill the process. */
109 PTRACE_KILL = 8,
110 #define PT_KILL PTRACE_KILL
112 /* Single step the process. */
113 PTRACE_SINGLESTEP = 9,
114 #define PT_STEP PTRACE_SINGLESTEP
116 /* Get all general purpose registers used by a process. */
117 PTRACE_GETREGS = 12,
118 #define PT_GETREGS PTRACE_GETREGS
120 /* Set all general purpose registers used by a process. */
121 PTRACE_SETREGS = 13,
122 #define PT_SETREGS PTRACE_SETREGS
124 /* Get all floating point registers used by a process. */
125 PTRACE_GETFPREGS = 14,
126 #define PT_GETFPREGS PTRACE_GETFPREGS
128 /* Set all floating point registers used by a process. */
129 PTRACE_SETFPREGS = 15,
130 #define PT_SETFPREGS PTRACE_SETFPREGS
132 /* Attach to a process that is already running. */
133 PTRACE_ATTACH = 16,
134 #define PT_ATTACH PTRACE_ATTACH
136 /* Detach from a process attached to with PTRACE_ATTACH. */
137 PTRACE_DETACH = 17,
138 #define PT_DETACH PTRACE_DETACH
140 /* Get all altivec registers used by a process. */
141 PTRACE_GETVRREGS = 18,
142 #define PT_GETVRREGS PTRACE_GETVRREGS
144 /* Set all altivec registers used by a process. */
145 PTRACE_SETVRREGS = 19,
146 #define PT_SETVRREGS PTRACE_SETVRREGS
148 /* Get all SPE registers used by a process. */
149 PTRACE_GETEVRREGS = 20,
150 #define PT_GETEVRREGS PTRACE_GETEVRREGS
152 /* Set all SPE registers used by a process. */
153 PTRACE_SETEVRREGS = 21,
154 #define PT_SETEVRREGS PTRACE_SETEVRREGS
156 /* Same as PTRACE_GETREGS except a 32-bit process will obtain
157 the full 64-bit registers. Implemented by 64-bit kernels only. */
158 PTRACE_GETREGS64 = 22,
159 #define PT_GETREGS64 PTRACE_GETREGS64
161 /* Same as PTRACE_SETREGS except a 32-bit process will set
162 the full 64-bit registers. Implemented by 64-bit kernels only. */
163 PTRACE_SETREGS64 = 23,
164 #define PT_SETREGS64 PTRACE_SETREGS64
166 /* Continue and stop at the next entry to or return from syscall. */
167 PTRACE_SYSCALL = 24,
168 #define PT_SYSCALL PTRACE_SYSCALL
170 /* Get a debug register of a process. */
171 PTRACE_GET_DEBUGREG = 25,
172 #define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
174 /* Set a debug register of a process. */
175 PTRACE_SET_DEBUGREG = 26,
176 #define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
178 /* Get the first 32 VSX registers of a process. */
179 PTRACE_GETVSRREGS = 27,
180 #define PT_GETVSRREGS PTRACE_GETVSRREGS
182 /* Set the first 32 VSX registers of a process. */
183 PTRACE_SETVSRREGS = 28,
184 #define PT_SETVSRREGS PTRACE_SETVSRREGS
186 /* Execute process until next taken branch. */
187 PTRACE_SINGLEBLOCK = 256,
188 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK
190 /* Set ptrace filter options. */
191 PTRACE_SETOPTIONS = 0x4200,
192 #define PT_SETOPTIONS PTRACE_SETOPTIONS
194 /* Get last ptrace message. */
195 PTRACE_GETEVENTMSG = 0x4201,
196 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
198 /* Get siginfo for process. */
199 PTRACE_GETSIGINFO = 0x4202,
200 #define PT_GETSIGINFO PTRACE_GETSIGINFO
202 /* Set new siginfo for process. */
203 PTRACE_SETSIGINFO = 0x4203,
204 #define PT_SETSIGINFO PTRACE_SETSIGINFO
206 /* Get register content. */
207 PTRACE_GETREGSET = 0x4204,
208 #define PTRACE_GETREGSET PTRACE_GETREGSET
210 /* Set register content. */
211 PTRACE_SETREGSET = 0x4205,
212 #define PTRACE_SETREGSET PTRACE_SETREGSET
214 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
215 signal or group stop state. */
216 PTRACE_SEIZE = 0x4206,
217 #define PTRACE_SEIZE PTRACE_SEIZE
219 /* Trap seized tracee. */
220 PTRACE_INTERRUPT = 0x4207,
221 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
223 /* Wait for next group event. */
224 PTRACE_LISTEN = 0x4208,
225 #define PTRACE_LISTEN PTRACE_LISTEN
227 /* Retrieve siginfo_t structures without removing signals from a queue. */
228 PTRACE_PEEKSIGINFO = 0x4209,
229 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
231 /* Get the mask of blocked signals. */
232 PTRACE_GETSIGMASK = 0x420a,
233 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
235 /* Change the mask of blocked signals. */
236 PTRACE_SETSIGMASK = 0x420b,
237 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
239 /* Get seccomp BPF filters. */
240 PTRACE_SECCOMP_GET_FILTER = 0x420c,
241 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
243 /* Get seccomp BPF filter metadata. */
244 PTRACE_SECCOMP_GET_METADATA = 0x420d
245 #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
249 #include <bits/ptrace-shared.h>
251 __END_DECLS
253 #endif /* _SYS_PTRACE_H */