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 _LINUX_USERFAULTFD_H
     20 #define _LINUX_USERFAULTFD_H
     21 #include <linux/types.h>
     22 #define UFFD_API ((__u64) 0xAA)
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #define UFFD_API_FEATURES (0)
     25 #define UFFD_API_IOCTLS ((__u64) 1 << _UFFDIO_REGISTER | (__u64) 1 << _UFFDIO_UNREGISTER | (__u64) 1 << _UFFDIO_API)
     26 #define UFFD_API_RANGE_IOCTLS ((__u64) 1 << _UFFDIO_WAKE | (__u64) 1 << _UFFDIO_COPY | (__u64) 1 << _UFFDIO_ZEROPAGE)
     27 #define _UFFDIO_REGISTER (0x00)
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #define _UFFDIO_UNREGISTER (0x01)
     30 #define _UFFDIO_WAKE (0x02)
     31 #define _UFFDIO_COPY (0x03)
     32 #define _UFFDIO_ZEROPAGE (0x04)
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34 #define _UFFDIO_API (0x3F)
     35 #define UFFDIO 0xAA
     36 #define UFFDIO_API _IOWR(UFFDIO, _UFFDIO_API, struct uffdio_api)
     37 #define UFFDIO_REGISTER _IOWR(UFFDIO, _UFFDIO_REGISTER, struct uffdio_register)
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39 #define UFFDIO_UNREGISTER _IOR(UFFDIO, _UFFDIO_UNREGISTER, struct uffdio_range)
     40 #define UFFDIO_WAKE _IOR(UFFDIO, _UFFDIO_WAKE, struct uffdio_range)
     41 #define UFFDIO_COPY _IOWR(UFFDIO, _UFFDIO_COPY, struct uffdio_copy)
     42 #define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, struct uffdio_zeropage)
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 struct uffd_msg {
     45   __u8 event;
     46   __u8 reserved1;
     47   __u16 reserved2;
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49   __u32 reserved3;
     50   union {
     51     struct {
     52       __u64 flags;
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54       __u64 address;
     55     } pagefault;
     56     struct {
     57       __u64 reserved1;
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59       __u64 reserved2;
     60       __u64 reserved3;
     61     } reserved;
     62   } arg;
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 } __packed;
     65 #define UFFD_EVENT_PAGEFAULT 0x12
     66 #define UFFD_PAGEFAULT_FLAG_WRITE (1 << 0)
     67 #define UFFD_PAGEFAULT_FLAG_WP (1 << 1)
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69 struct uffdio_api {
     70   __u64 api;
     71   __u64 features;
     72   __u64 ioctls;
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74 };
     75 struct uffdio_range {
     76   __u64 start;
     77   __u64 len;
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79 };
     80 struct uffdio_register {
     81   struct uffdio_range range;
     82 #define UFFDIO_REGISTER_MODE_MISSING ((__u64) 1 << 0)
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 #define UFFDIO_REGISTER_MODE_WP ((__u64) 1 << 1)
     85   __u64 mode;
     86   __u64 ioctls;
     87 };
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89 struct uffdio_copy {
     90   __u64 dst;
     91   __u64 src;
     92   __u64 len;
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 #define UFFDIO_COPY_MODE_DONTWAKE ((__u64) 1 << 0)
     95   __u64 mode;
     96   __s64 copy;
     97 };
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99 struct uffdio_zeropage {
    100   struct uffdio_range range;
    101 #define UFFDIO_ZEROPAGE_MODE_DONTWAKE ((__u64) 1 << 0)
    102   __u64 mode;
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104   __s64 zeropage;
    105 };
    106 #endif
    107