ptrace: add PTRACE_GET_SYSCALL_INFO request
[sfrench/cifs-2.6.git] / include / uapi / linux / ptrace.h
index d5a1b8a492b93ddb6dd41cf23d759c4059bc8660..a71b6e3b03ebc2848ab932c66a936d38aaff2d07 100644 (file)
@@ -73,6 +73,41 @@ struct seccomp_metadata {
        __u64 flags;            /* Output: filter's flags */
 };
 
+#define PTRACE_GET_SYSCALL_INFO                0x420e
+#define PTRACE_SYSCALL_INFO_NONE       0
+#define PTRACE_SYSCALL_INFO_ENTRY      1
+#define PTRACE_SYSCALL_INFO_EXIT       2
+#define PTRACE_SYSCALL_INFO_SECCOMP    3
+
+struct ptrace_syscall_info {
+       __u8 op;        /* PTRACE_SYSCALL_INFO_* */
+       __u32 arch __attribute__((__aligned__(sizeof(__u32))));
+       __u64 instruction_pointer;
+       __u64 stack_pointer;
+       union {
+               struct {
+                       __u64 nr;
+                       __u64 args[6];
+               } entry;
+               struct {
+                       __s64 rval;
+                       __u8 is_error;
+               } exit;
+               struct {
+                       __u64 nr;
+                       __u64 args[6];
+                       __u32 ret_data;
+               } seccomp;
+       };
+};
+
+/*
+ * These values are stored in task->ptrace_message
+ * by tracehook_report_syscall_* to describe the current syscall-stop.
+ */
+#define PTRACE_EVENTMSG_SYSCALL_ENTRY  1
+#define PTRACE_EVENTMSG_SYSCALL_EXIT   2
+
 /* Read signals from a shared (process wide) queue */
 #define PTRACE_PEEKSIGINFO_SHARED      (1 << 0)