1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_LINUX_RSEQ_H 7 #define _UAPI_LINUX_RSEQ_H 8 #include <linux/types.h> 9 #include <asm/byteorder.h> 10 enum rseq_cpu_id_state { 11 RSEQ_CPU_ID_UNINITIALIZED = -1, 12 RSEQ_CPU_ID_REGISTRATION_FAILED = -2, 13 }; 14 enum rseq_flags { 15 RSEQ_FLAG_UNREGISTER = (1 << 0), 16 }; 17 enum rseq_cs_flags_bit { 18 RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0, 19 RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1, 20 RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2, 21 }; 22 enum rseq_cs_flags { 23 RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = 24 (1U << RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT), 25 RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = 26 (1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT), 27 RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = 28 (1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT), 29 }; 30 struct rseq_cs { 31 32 __u32 version; 33 34 __u32 flags; 35 __u64 start_ip; 36 37 __u64 post_commit_offset; 38 __u64 abort_ip; 39 } __attribute__((aligned(4 * sizeof(__u64)))); 40 struct rseq { 41 42 __u32 cpu_id_start; 43 44 __u32 cpu_id; 45 46 union { 47 __u64 ptr64; 48 #ifdef __LP64__ 49 __u64 ptr; 50 #else 51 struct { 52 #if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || defined(__BIG_ENDIAN) 53 __u32 padding; 54 __u32 ptr32; 55 #else 56 __u32 ptr32; 57 __u32 padding; 58 #endif 59 } ptr; 60 #endif 61 } rseq_cs; 62 63 __u32 flags; 64 } __attribute__((aligned(4 * sizeof(__u64)))); 65 #endif 66