userfaultfd.h (b28f9db1a7ce4d537ce2fae6fbce5e5e37dc265b) | userfaultfd.h (74c98e20a604b9db58284b8727688df70e9bf643) |
---|---|
1/* 2 * include/linux/userfaultfd.h 3 * 4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> 5 * Copyright (C) 2015 Red Hat, Inc. 6 * 7 */ 8 --- 6 unchanged lines hidden (view full) --- 15 * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and 16 * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In 17 * userfaultfd.h we assumed the kernel was reading (instead _IOC_READ 18 * means the userland is reading). 19 */ 20#define UFFD_API ((__u64)0xAA) 21#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ 22 UFFD_FEATURE_EVENT_REMAP | \ | 1/* 2 * include/linux/userfaultfd.h 3 * 4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> 5 * Copyright (C) 2015 Red Hat, Inc. 6 * 7 */ 8 --- 6 unchanged lines hidden (view full) --- 15 * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and 16 * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In 17 * userfaultfd.h we assumed the kernel was reading (instead _IOC_READ 18 * means the userland is reading). 19 */ 20#define UFFD_API ((__u64)0xAA) 21#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ 22 UFFD_FEATURE_EVENT_REMAP | \ |
23 UFFD_FEATURE_EVENT_MADVDONTNEED | \ | 23 UFFD_FEATURE_EVENT_REMOVE | \ 24 UFFD_FEATURE_EVENT_UNMAP | \ |
24 UFFD_FEATURE_MISSING_HUGETLBFS | \ 25 UFFD_FEATURE_MISSING_SHMEM) 26#define UFFD_API_IOCTLS \ 27 ((__u64)1 << _UFFDIO_REGISTER | \ 28 (__u64)1 << _UFFDIO_UNREGISTER | \ 29 (__u64)1 << _UFFDIO_API) 30#define UFFD_API_RANGE_IOCTLS \ 31 ((__u64)1 << _UFFDIO_WAKE | \ --- 55 unchanged lines hidden (view full) --- 87 __u64 from; 88 __u64 to; 89 __u64 len; 90 } remap; 91 92 struct { 93 __u64 start; 94 __u64 end; | 25 UFFD_FEATURE_MISSING_HUGETLBFS | \ 26 UFFD_FEATURE_MISSING_SHMEM) 27#define UFFD_API_IOCTLS \ 28 ((__u64)1 << _UFFDIO_REGISTER | \ 29 (__u64)1 << _UFFDIO_UNREGISTER | \ 30 (__u64)1 << _UFFDIO_API) 31#define UFFD_API_RANGE_IOCTLS \ 32 ((__u64)1 << _UFFDIO_WAKE | \ --- 55 unchanged lines hidden (view full) --- 88 __u64 from; 89 __u64 to; 90 __u64 len; 91 } remap; 92 93 struct { 94 __u64 start; 95 __u64 end; |
95 } madv_dn; | 96 } remove; |
96 97 struct { 98 /* unused reserved fields */ 99 __u64 reserved1; 100 __u64 reserved2; 101 __u64 reserved3; 102 } reserved; 103 } arg; 104} __attribute__((packed)); 105 106/* 107 * Start at 0x12 and not at 0 to be more strict against bugs. 108 */ 109#define UFFD_EVENT_PAGEFAULT 0x12 110#define UFFD_EVENT_FORK 0x13 111#define UFFD_EVENT_REMAP 0x14 | 97 98 struct { 99 /* unused reserved fields */ 100 __u64 reserved1; 101 __u64 reserved2; 102 __u64 reserved3; 103 } reserved; 104 } arg; 105} __attribute__((packed)); 106 107/* 108 * Start at 0x12 and not at 0 to be more strict against bugs. 109 */ 110#define UFFD_EVENT_PAGEFAULT 0x12 111#define UFFD_EVENT_FORK 0x13 112#define UFFD_EVENT_REMAP 0x14 |
112#define UFFD_EVENT_MADVDONTNEED 0x15 | 113#define UFFD_EVENT_REMOVE 0x15 114#define UFFD_EVENT_UNMAP 0x16 |
113 114/* flags for UFFD_EVENT_PAGEFAULT */ 115#define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ 116#define UFFD_PAGEFAULT_FLAG_WP (1<<1) /* If reason is VM_UFFD_WP */ 117 118struct uffdio_api { 119 /* userland asks for an API number and the features to enable */ 120 __u64 api; --- 29 unchanged lines hidden (view full) --- 150 * 151 * UFFD_FEATURE_MISSING_SHMEM works the same as 152 * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem 153 * (i.e. tmpfs and other shmem based APIs). 154 */ 155#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) 156#define UFFD_FEATURE_EVENT_FORK (1<<1) 157#define UFFD_FEATURE_EVENT_REMAP (1<<2) | 115 116/* flags for UFFD_EVENT_PAGEFAULT */ 117#define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ 118#define UFFD_PAGEFAULT_FLAG_WP (1<<1) /* If reason is VM_UFFD_WP */ 119 120struct uffdio_api { 121 /* userland asks for an API number and the features to enable */ 122 __u64 api; --- 29 unchanged lines hidden (view full) --- 152 * 153 * UFFD_FEATURE_MISSING_SHMEM works the same as 154 * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem 155 * (i.e. tmpfs and other shmem based APIs). 156 */ 157#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) 158#define UFFD_FEATURE_EVENT_FORK (1<<1) 159#define UFFD_FEATURE_EVENT_REMAP (1<<2) |
158#define UFFD_FEATURE_EVENT_MADVDONTNEED (1<<3) | 160#define UFFD_FEATURE_EVENT_REMOVE (1<<3) |
159#define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) 160#define UFFD_FEATURE_MISSING_SHMEM (1<<5) | 161#define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) 162#define UFFD_FEATURE_MISSING_SHMEM (1<<5) |
163#define UFFD_FEATURE_EVENT_UNMAP (1<<6) |
|
161 __u64 features; 162 163 __u64 ioctls; 164}; 165 166struct uffdio_range { 167 __u64 start; 168 __u64 len; --- 48 unchanged lines hidden --- | 164 __u64 features; 165 166 __u64 ioctls; 167}; 168 169struct uffdio_range { 170 __u64 start; 171 __u64 len; --- 48 unchanged lines hidden --- |