Home | History | Annotate | Download | only in linux
      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_RSEQ_H
     20 #define _UAPI_LINUX_RSEQ_H
     21 #include <linux/types.h>
     22 #include <asm/byteorder.h>
     23 enum rseq_cpu_id_state {
     24   RSEQ_CPU_ID_UNINITIALIZED = - 1,
     25   RSEQ_CPU_ID_REGISTRATION_FAILED = - 2,
     26 };
     27 enum rseq_flags {
     28   RSEQ_FLAG_UNREGISTER = (1 << 0),
     29 };
     30 enum rseq_cs_flags_bit {
     31   RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0,
     32   RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1,
     33   RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2,
     34 };
     35 enum rseq_cs_flags {
     36   RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT = (1U << RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),
     37   RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),
     38   RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),
     39 };
     40 struct rseq_cs {
     41   __u32 version;
     42   __u32 flags;
     43   __u64 start_ip;
     44   __u64 post_commit_offset;
     45   __u64 abort_ip;
     46 } __attribute__((aligned(4 * sizeof(__u64))));
     47 struct rseq {
     48   __u32 cpu_id_start;
     49   __u32 cpu_id;
     50   union {
     51     __u64 ptr64;
     52 #ifdef __LP64__
     53     __u64 ptr;
     54 #else
     55     struct {
     56 #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN)
     57       __u32 padding;
     58       __u32 ptr32;
     59 #else
     60       __u32 ptr32;
     61       __u32 padding;
     62 #endif
     63     } ptr;
     64 #endif
     65   } rseq_cs;
     66   __u32 flags;
     67 } __attribute__((aligned(4 * sizeof(__u64))));
     68 #endif
     69