Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_LINUX_PTRACE_H |
| 20 | #define _UAPI_LINUX_PTRACE_H |
| 21 | #include <linux/types.h> |
| 22 | #define PTRACE_TRACEME 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define PTRACE_PEEKTEXT 1 |
| 24 | #define PTRACE_PEEKDATA 2 |
| 25 | #define PTRACE_PEEKUSR 3 |
| 26 | #define PTRACE_POKETEXT 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define PTRACE_POKEDATA 5 |
| 28 | #define PTRACE_POKEUSR 6 |
| 29 | #define PTRACE_CONT 7 |
| 30 | #define PTRACE_KILL 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define PTRACE_SINGLESTEP 9 |
| 32 | #define PTRACE_ATTACH 16 |
| 33 | #define PTRACE_DETACH 17 |
| 34 | #define PTRACE_SYSCALL 24 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define PTRACE_SETOPTIONS 0x4200 |
| 36 | #define PTRACE_GETEVENTMSG 0x4201 |
| 37 | #define PTRACE_GETSIGINFO 0x4202 |
| 38 | #define PTRACE_SETSIGINFO 0x4203 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define PTRACE_GETREGSET 0x4204 |
| 40 | #define PTRACE_SETREGSET 0x4205 |
| 41 | #define PTRACE_SEIZE 0x4206 |
| 42 | #define PTRACE_INTERRUPT 0x4207 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define PTRACE_LISTEN 0x4208 |
| 44 | #define PTRACE_PEEKSIGINFO 0x4209 |
| 45 | struct ptrace_peeksiginfo_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | __u64 off; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | __u32 flags; |
| 48 | __s32 nr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 49 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 50 | #define PTRACE_GETSIGMASK 0x420a |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 51 | #define PTRACE_SETSIGMASK 0x420b |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 52 | #define PTRACE_SECCOMP_GET_FILTER 0x420c |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 53 | #define PTRACE_SECCOMP_GET_METADATA 0x420d |
| 54 | struct seccomp_metadata { |
| 55 | __u64 filter_off; |
| 56 | __u64 flags; |
| 57 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 58 | #define PTRACE_GET_SYSCALL_INFO 0x420e |
| 59 | #define PTRACE_SYSCALL_INFO_NONE 0 |
| 60 | #define PTRACE_SYSCALL_INFO_ENTRY 1 |
| 61 | #define PTRACE_SYSCALL_INFO_EXIT 2 |
| 62 | #define PTRACE_SYSCALL_INFO_SECCOMP 3 |
| 63 | struct ptrace_syscall_info { |
| 64 | __u8 op; |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 65 | __u8 pad[3]; |
| 66 | __u32 arch; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 67 | __u64 instruction_pointer; |
| 68 | __u64 stack_pointer; |
| 69 | union { |
| 70 | struct { |
| 71 | __u64 nr; |
| 72 | __u64 args[6]; |
| 73 | } entry; |
| 74 | struct { |
| 75 | __s64 rval; |
| 76 | __u8 is_error; |
| 77 | } exit; |
| 78 | struct { |
| 79 | __u64 nr; |
| 80 | __u64 args[6]; |
| 81 | __u32 ret_data; |
| 82 | } seccomp; |
| 83 | }; |
| 84 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 85 | #define PTRACE_GET_RSEQ_CONFIGURATION 0x420f |
| 86 | struct ptrace_rseq_configuration { |
| 87 | __u64 rseq_abi_pointer; |
| 88 | __u32 rseq_abi_size; |
| 89 | __u32 signature; |
| 90 | __u32 flags; |
| 91 | __u32 pad; |
| 92 | }; |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 93 | #define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG 0x4210 |
| 94 | #define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG 0x4211 |
| 95 | struct ptrace_sud_config { |
| 96 | __u64 mode; |
| 97 | __u64 selector; |
| 98 | __u64 offset; |
| 99 | __u64 len; |
| 100 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 101 | #define PTRACE_EVENTMSG_SYSCALL_ENTRY 1 |
| 102 | #define PTRACE_EVENTMSG_SYSCALL_EXIT 2 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 103 | #define PTRACE_PEEKSIGINFO_SHARED (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 104 | #define PTRACE_EVENT_FORK 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 105 | #define PTRACE_EVENT_VFORK 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 106 | #define PTRACE_EVENT_CLONE 3 |
| 107 | #define PTRACE_EVENT_EXEC 4 |
| 108 | #define PTRACE_EVENT_VFORK_DONE 5 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 109 | #define PTRACE_EVENT_EXIT 6 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | #define PTRACE_EVENT_SECCOMP 7 |
| 111 | #define PTRACE_EVENT_STOP 128 |
| 112 | #define PTRACE_O_TRACESYSGOOD 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 113 | #define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 114 | #define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK) |
| 115 | #define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE) |
| 116 | #define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 117 | #define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 118 | #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) |
| 119 | #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) |
| 120 | #define PTRACE_O_EXITKILL (1 << 20) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 121 | #define PTRACE_O_SUSPEND_SECCOMP (1 << 21) |
| 122 | #define PTRACE_O_MASK (0x000000ff | PTRACE_O_EXITKILL | PTRACE_O_SUSPEND_SECCOMP) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | #include <asm/ptrace.h> |
| 124 | #endif |