1 /* automatically generated by rust-bindgen 0.68.1 */
2
3 pub const __BITS_PER_LONG_LONG: u32 = 64;
4 pub const USERFAULTFD_IOC: u32 = 170;
5 pub const _UFFDIO_REGISTER: u64 = 0;
6 pub const _UFFDIO_UNREGISTER: u64 = 1;
7 pub const _UFFDIO_WAKE: u64 = 2;
8 pub const _UFFDIO_COPY: u64 = 3;
9 pub const _UFFDIO_ZEROPAGE: u64 = 4;
10 pub const _UFFDIO_MOVE: u64 = 5;
11 pub const _UFFDIO_WRITEPROTECT: u64 = 6;
12 pub const _UFFDIO_CONTINUE: u64 = 7;
13 pub const _UFFDIO_POISON: u64 = 8;
14 pub const _UFFDIO_API: u64 = 63;
15 pub const UFFDIO: u8 = 170;
16 pub const UFFD_EVENT_PAGEFAULT: u8 = 18;
17 pub const UFFD_EVENT_FORK: u8 = 19;
18 pub const UFFD_EVENT_REMAP: u8 = 20;
19 pub const UFFD_EVENT_REMOVE: u8 = 21;
20 pub const UFFD_EVENT_UNMAP: u8 = 22;
21 pub const UFFD_PAGEFAULT_FLAG_WRITE: u64 = 1;
22 pub const UFFD_PAGEFAULT_FLAG_WP: u64 = 2;
23 pub const UFFD_PAGEFAULT_FLAG_MINOR: u64 = 4;
24 pub const UFFD_FEATURE_PAGEFAULT_FLAG_WP: u64 = 1;
25 pub const UFFD_FEATURE_EVENT_FORK: u64 = 2;
26 pub const UFFD_FEATURE_EVENT_REMAP: u64 = 4;
27 pub const UFFD_FEATURE_EVENT_REMOVE: u64 = 8;
28 pub const UFFD_FEATURE_MISSING_HUGETLBFS: u64 = 16;
29 pub const UFFD_FEATURE_MISSING_SHMEM: u64 = 32;
30 pub const UFFD_FEATURE_EVENT_UNMAP: u64 = 64;
31 pub const UFFD_FEATURE_SIGBUS: u64 = 128;
32 pub const UFFD_FEATURE_THREAD_ID: u64 = 256;
33 pub const UFFD_FEATURE_MINOR_HUGETLBFS: u64 = 512;
34 pub const UFFD_FEATURE_MINOR_SHMEM: u64 = 1024;
35 pub const UFFD_FEATURE_EXACT_ADDRESS: u64 = 2048;
36 pub const UFFD_FEATURE_WP_HUGETLBFS_SHMEM: u64 = 4096;
37 pub const UFFD_FEATURE_WP_UNPOPULATED: u64 = 8192;
38 pub const UFFD_FEATURE_POISON: u64 = 16384;
39 pub const UFFD_FEATURE_WP_ASYNC: u64 = 32768;
40 pub const UFFD_FEATURE_MOVE: u64 = 65536;
41 pub const UFFD_USER_MODE_ONLY: u32 = 1;
42 pub type __s8 = ::std::os::raw::c_schar;
43 pub type __u8 = ::std::os::raw::c_uchar;
44 pub type __s16 = ::std::os::raw::c_short;
45 pub type __u16 = ::std::os::raw::c_ushort;
46 pub type __s32 = ::std::os::raw::c_int;
47 pub type __u32 = ::std::os::raw::c_uint;
48 pub type __s64 = ::std::os::raw::c_longlong;
49 pub type __u64 = ::std::os::raw::c_ulonglong;
50 #[repr(C)]
51 #[derive(Debug, Copy, Clone)]
52 pub struct __kernel_fd_set {
53 pub fds_bits: [::std::os::raw::c_ulong; 16usize],
54 }
55 #[test]
bindgen_test_layout___kernel_fd_set()56 fn bindgen_test_layout___kernel_fd_set() {
57 const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit();
58 let ptr = UNINIT.as_ptr();
59 assert_eq!(
60 ::std::mem::size_of::<__kernel_fd_set>(),
61 128usize,
62 concat!("Size of: ", stringify!(__kernel_fd_set))
63 );
64 assert_eq!(
65 ::std::mem::align_of::<__kernel_fd_set>(),
66 8usize,
67 concat!("Alignment of ", stringify!(__kernel_fd_set))
68 );
69 assert_eq!(
70 unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize },
71 0usize,
72 concat!(
73 "Offset of field: ",
74 stringify!(__kernel_fd_set),
75 "::",
76 stringify!(fds_bits)
77 )
78 );
79 }
80 pub type __kernel_sighandler_t =
81 ::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
82 pub type __kernel_key_t = ::std::os::raw::c_int;
83 pub type __kernel_mqd_t = ::std::os::raw::c_int;
84 pub type __kernel_old_uid_t = ::std::os::raw::c_ushort;
85 pub type __kernel_old_gid_t = ::std::os::raw::c_ushort;
86 pub type __kernel_old_dev_t = ::std::os::raw::c_ulong;
87 pub type __kernel_long_t = ::std::os::raw::c_long;
88 pub type __kernel_ulong_t = ::std::os::raw::c_ulong;
89 pub type __kernel_ino_t = __kernel_ulong_t;
90 pub type __kernel_mode_t = ::std::os::raw::c_uint;
91 pub type __kernel_pid_t = ::std::os::raw::c_int;
92 pub type __kernel_ipc_pid_t = ::std::os::raw::c_int;
93 pub type __kernel_uid_t = ::std::os::raw::c_uint;
94 pub type __kernel_gid_t = ::std::os::raw::c_uint;
95 pub type __kernel_suseconds_t = __kernel_long_t;
96 pub type __kernel_daddr_t = ::std::os::raw::c_int;
97 pub type __kernel_uid32_t = ::std::os::raw::c_uint;
98 pub type __kernel_gid32_t = ::std::os::raw::c_uint;
99 pub type __kernel_size_t = __kernel_ulong_t;
100 pub type __kernel_ssize_t = __kernel_long_t;
101 pub type __kernel_ptrdiff_t = __kernel_long_t;
102 #[repr(C)]
103 #[derive(Debug, Copy, Clone)]
104 pub struct __kernel_fsid_t {
105 pub val: [::std::os::raw::c_int; 2usize],
106 }
107 #[test]
bindgen_test_layout___kernel_fsid_t()108 fn bindgen_test_layout___kernel_fsid_t() {
109 const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit();
110 let ptr = UNINIT.as_ptr();
111 assert_eq!(
112 ::std::mem::size_of::<__kernel_fsid_t>(),
113 8usize,
114 concat!("Size of: ", stringify!(__kernel_fsid_t))
115 );
116 assert_eq!(
117 ::std::mem::align_of::<__kernel_fsid_t>(),
118 4usize,
119 concat!("Alignment of ", stringify!(__kernel_fsid_t))
120 );
121 assert_eq!(
122 unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize },
123 0usize,
124 concat!(
125 "Offset of field: ",
126 stringify!(__kernel_fsid_t),
127 "::",
128 stringify!(val)
129 )
130 );
131 }
132 pub type __kernel_off_t = __kernel_long_t;
133 pub type __kernel_loff_t = ::std::os::raw::c_longlong;
134 pub type __kernel_old_time_t = __kernel_long_t;
135 pub type __kernel_time_t = __kernel_long_t;
136 pub type __kernel_time64_t = ::std::os::raw::c_longlong;
137 pub type __kernel_clock_t = __kernel_long_t;
138 pub type __kernel_timer_t = ::std::os::raw::c_int;
139 pub type __kernel_clockid_t = ::std::os::raw::c_int;
140 pub type __kernel_caddr_t = *mut ::std::os::raw::c_char;
141 pub type __kernel_uid16_t = ::std::os::raw::c_ushort;
142 pub type __kernel_gid16_t = ::std::os::raw::c_ushort;
143 pub type __s128 = i128;
144 pub type __u128 = u128;
145 pub type __poll_t = ::std::os::raw::c_uint;
146 #[repr(C, packed)]
147 #[derive(Copy, Clone)]
148 pub struct uffd_msg {
149 pub event: __u8,
150 pub reserved1: __u8,
151 pub reserved2: __u16,
152 pub reserved3: __u32,
153 pub arg: uffd_msg__bindgen_ty_1,
154 }
155 #[repr(C)]
156 #[derive(Copy, Clone)]
157 pub union uffd_msg__bindgen_ty_1 {
158 pub pagefault: uffd_msg__bindgen_ty_1__bindgen_ty_1,
159 pub fork: uffd_msg__bindgen_ty_1__bindgen_ty_2,
160 pub remap: uffd_msg__bindgen_ty_1__bindgen_ty_3,
161 pub remove: uffd_msg__bindgen_ty_1__bindgen_ty_4,
162 pub reserved: uffd_msg__bindgen_ty_1__bindgen_ty_5,
163 }
164 #[repr(C)]
165 #[derive(Copy, Clone)]
166 pub struct uffd_msg__bindgen_ty_1__bindgen_ty_1 {
167 pub flags: __u64,
168 pub address: __u64,
169 pub feat: uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
170 }
171 #[repr(C)]
172 #[derive(Copy, Clone)]
173 pub union uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
174 pub ptid: __u32,
175 }
176 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1()177 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() {
178 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1> =
179 ::std::mem::MaybeUninit::uninit();
180 let ptr = UNINIT.as_ptr();
181 assert_eq!(
182 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
183 4usize,
184 concat!(
185 "Size of: ",
186 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
187 )
188 );
189 assert_eq!(
190 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(),
191 4usize,
192 concat!(
193 "Alignment of ",
194 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1)
195 )
196 );
197 assert_eq!(
198 unsafe { ::std::ptr::addr_of!((*ptr).ptid) as usize - ptr as usize },
199 0usize,
200 concat!(
201 "Offset of field: ",
202 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1),
203 "::",
204 stringify!(ptid)
205 )
206 );
207 }
208 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1()209 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1() {
210 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_1> =
211 ::std::mem::MaybeUninit::uninit();
212 let ptr = UNINIT.as_ptr();
213 assert_eq!(
214 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_1>(),
215 24usize,
216 concat!(
217 "Size of: ",
218 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1)
219 )
220 );
221 assert_eq!(
222 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_1>(),
223 8usize,
224 concat!(
225 "Alignment of ",
226 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1)
227 )
228 );
229 assert_eq!(
230 unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
231 0usize,
232 concat!(
233 "Offset of field: ",
234 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1),
235 "::",
236 stringify!(flags)
237 )
238 );
239 assert_eq!(
240 unsafe { ::std::ptr::addr_of!((*ptr).address) as usize - ptr as usize },
241 8usize,
242 concat!(
243 "Offset of field: ",
244 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1),
245 "::",
246 stringify!(address)
247 )
248 );
249 assert_eq!(
250 unsafe { ::std::ptr::addr_of!((*ptr).feat) as usize - ptr as usize },
251 16usize,
252 concat!(
253 "Offset of field: ",
254 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1),
255 "::",
256 stringify!(feat)
257 )
258 );
259 }
260 #[repr(C)]
261 #[derive(Debug, Copy, Clone)]
262 pub struct uffd_msg__bindgen_ty_1__bindgen_ty_2 {
263 pub ufd: __u32,
264 }
265 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_2()266 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_2() {
267 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_2> =
268 ::std::mem::MaybeUninit::uninit();
269 let ptr = UNINIT.as_ptr();
270 assert_eq!(
271 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_2>(),
272 4usize,
273 concat!(
274 "Size of: ",
275 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2)
276 )
277 );
278 assert_eq!(
279 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_2>(),
280 4usize,
281 concat!(
282 "Alignment of ",
283 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2)
284 )
285 );
286 assert_eq!(
287 unsafe { ::std::ptr::addr_of!((*ptr).ufd) as usize - ptr as usize },
288 0usize,
289 concat!(
290 "Offset of field: ",
291 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2),
292 "::",
293 stringify!(ufd)
294 )
295 );
296 }
297 #[repr(C)]
298 #[derive(Debug, Copy, Clone)]
299 pub struct uffd_msg__bindgen_ty_1__bindgen_ty_3 {
300 pub from: __u64,
301 pub to: __u64,
302 pub len: __u64,
303 }
304 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_3()305 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_3() {
306 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_3> =
307 ::std::mem::MaybeUninit::uninit();
308 let ptr = UNINIT.as_ptr();
309 assert_eq!(
310 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_3>(),
311 24usize,
312 concat!(
313 "Size of: ",
314 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3)
315 )
316 );
317 assert_eq!(
318 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_3>(),
319 8usize,
320 concat!(
321 "Alignment of ",
322 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3)
323 )
324 );
325 assert_eq!(
326 unsafe { ::std::ptr::addr_of!((*ptr).from) as usize - ptr as usize },
327 0usize,
328 concat!(
329 "Offset of field: ",
330 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3),
331 "::",
332 stringify!(from)
333 )
334 );
335 assert_eq!(
336 unsafe { ::std::ptr::addr_of!((*ptr).to) as usize - ptr as usize },
337 8usize,
338 concat!(
339 "Offset of field: ",
340 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3),
341 "::",
342 stringify!(to)
343 )
344 );
345 assert_eq!(
346 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
347 16usize,
348 concat!(
349 "Offset of field: ",
350 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3),
351 "::",
352 stringify!(len)
353 )
354 );
355 }
356 #[repr(C)]
357 #[derive(Debug, Copy, Clone)]
358 pub struct uffd_msg__bindgen_ty_1__bindgen_ty_4 {
359 pub start: __u64,
360 pub end: __u64,
361 }
362 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_4()363 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_4() {
364 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_4> =
365 ::std::mem::MaybeUninit::uninit();
366 let ptr = UNINIT.as_ptr();
367 assert_eq!(
368 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_4>(),
369 16usize,
370 concat!(
371 "Size of: ",
372 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4)
373 )
374 );
375 assert_eq!(
376 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_4>(),
377 8usize,
378 concat!(
379 "Alignment of ",
380 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4)
381 )
382 );
383 assert_eq!(
384 unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
385 0usize,
386 concat!(
387 "Offset of field: ",
388 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4),
389 "::",
390 stringify!(start)
391 )
392 );
393 assert_eq!(
394 unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize },
395 8usize,
396 concat!(
397 "Offset of field: ",
398 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4),
399 "::",
400 stringify!(end)
401 )
402 );
403 }
404 #[repr(C)]
405 #[derive(Debug, Copy, Clone)]
406 pub struct uffd_msg__bindgen_ty_1__bindgen_ty_5 {
407 pub reserved1: __u64,
408 pub reserved2: __u64,
409 pub reserved3: __u64,
410 }
411 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_5()412 fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_5() {
413 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1__bindgen_ty_5> =
414 ::std::mem::MaybeUninit::uninit();
415 let ptr = UNINIT.as_ptr();
416 assert_eq!(
417 ::std::mem::size_of::<uffd_msg__bindgen_ty_1__bindgen_ty_5>(),
418 24usize,
419 concat!(
420 "Size of: ",
421 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5)
422 )
423 );
424 assert_eq!(
425 ::std::mem::align_of::<uffd_msg__bindgen_ty_1__bindgen_ty_5>(),
426 8usize,
427 concat!(
428 "Alignment of ",
429 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5)
430 )
431 );
432 assert_eq!(
433 unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize },
434 0usize,
435 concat!(
436 "Offset of field: ",
437 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5),
438 "::",
439 stringify!(reserved1)
440 )
441 );
442 assert_eq!(
443 unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize },
444 8usize,
445 concat!(
446 "Offset of field: ",
447 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5),
448 "::",
449 stringify!(reserved2)
450 )
451 );
452 assert_eq!(
453 unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize },
454 16usize,
455 concat!(
456 "Offset of field: ",
457 stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5),
458 "::",
459 stringify!(reserved3)
460 )
461 );
462 }
463 #[test]
bindgen_test_layout_uffd_msg__bindgen_ty_1()464 fn bindgen_test_layout_uffd_msg__bindgen_ty_1() {
465 const UNINIT: ::std::mem::MaybeUninit<uffd_msg__bindgen_ty_1> =
466 ::std::mem::MaybeUninit::uninit();
467 let ptr = UNINIT.as_ptr();
468 assert_eq!(
469 ::std::mem::size_of::<uffd_msg__bindgen_ty_1>(),
470 24usize,
471 concat!("Size of: ", stringify!(uffd_msg__bindgen_ty_1))
472 );
473 assert_eq!(
474 ::std::mem::align_of::<uffd_msg__bindgen_ty_1>(),
475 8usize,
476 concat!("Alignment of ", stringify!(uffd_msg__bindgen_ty_1))
477 );
478 assert_eq!(
479 unsafe { ::std::ptr::addr_of!((*ptr).pagefault) as usize - ptr as usize },
480 0usize,
481 concat!(
482 "Offset of field: ",
483 stringify!(uffd_msg__bindgen_ty_1),
484 "::",
485 stringify!(pagefault)
486 )
487 );
488 assert_eq!(
489 unsafe { ::std::ptr::addr_of!((*ptr).fork) as usize - ptr as usize },
490 0usize,
491 concat!(
492 "Offset of field: ",
493 stringify!(uffd_msg__bindgen_ty_1),
494 "::",
495 stringify!(fork)
496 )
497 );
498 assert_eq!(
499 unsafe { ::std::ptr::addr_of!((*ptr).remap) as usize - ptr as usize },
500 0usize,
501 concat!(
502 "Offset of field: ",
503 stringify!(uffd_msg__bindgen_ty_1),
504 "::",
505 stringify!(remap)
506 )
507 );
508 assert_eq!(
509 unsafe { ::std::ptr::addr_of!((*ptr).remove) as usize - ptr as usize },
510 0usize,
511 concat!(
512 "Offset of field: ",
513 stringify!(uffd_msg__bindgen_ty_1),
514 "::",
515 stringify!(remove)
516 )
517 );
518 assert_eq!(
519 unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize },
520 0usize,
521 concat!(
522 "Offset of field: ",
523 stringify!(uffd_msg__bindgen_ty_1),
524 "::",
525 stringify!(reserved)
526 )
527 );
528 }
529 #[test]
bindgen_test_layout_uffd_msg()530 fn bindgen_test_layout_uffd_msg() {
531 const UNINIT: ::std::mem::MaybeUninit<uffd_msg> = ::std::mem::MaybeUninit::uninit();
532 let ptr = UNINIT.as_ptr();
533 assert_eq!(
534 ::std::mem::size_of::<uffd_msg>(),
535 32usize,
536 concat!("Size of: ", stringify!(uffd_msg))
537 );
538 assert_eq!(
539 ::std::mem::align_of::<uffd_msg>(),
540 1usize,
541 concat!("Alignment of ", stringify!(uffd_msg))
542 );
543 assert_eq!(
544 unsafe { ::std::ptr::addr_of!((*ptr).event) as usize - ptr as usize },
545 0usize,
546 concat!(
547 "Offset of field: ",
548 stringify!(uffd_msg),
549 "::",
550 stringify!(event)
551 )
552 );
553 assert_eq!(
554 unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize },
555 1usize,
556 concat!(
557 "Offset of field: ",
558 stringify!(uffd_msg),
559 "::",
560 stringify!(reserved1)
561 )
562 );
563 assert_eq!(
564 unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize },
565 2usize,
566 concat!(
567 "Offset of field: ",
568 stringify!(uffd_msg),
569 "::",
570 stringify!(reserved2)
571 )
572 );
573 assert_eq!(
574 unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize },
575 4usize,
576 concat!(
577 "Offset of field: ",
578 stringify!(uffd_msg),
579 "::",
580 stringify!(reserved3)
581 )
582 );
583 assert_eq!(
584 unsafe { ::std::ptr::addr_of!((*ptr).arg) as usize - ptr as usize },
585 8usize,
586 concat!(
587 "Offset of field: ",
588 stringify!(uffd_msg),
589 "::",
590 stringify!(arg)
591 )
592 );
593 }
594 #[repr(C)]
595 #[derive(Debug, Copy, Clone)]
596 pub struct uffdio_api {
597 pub api: __u64,
598 pub features: __u64,
599 pub ioctls: __u64,
600 }
601 #[test]
bindgen_test_layout_uffdio_api()602 fn bindgen_test_layout_uffdio_api() {
603 const UNINIT: ::std::mem::MaybeUninit<uffdio_api> = ::std::mem::MaybeUninit::uninit();
604 let ptr = UNINIT.as_ptr();
605 assert_eq!(
606 ::std::mem::size_of::<uffdio_api>(),
607 24usize,
608 concat!("Size of: ", stringify!(uffdio_api))
609 );
610 assert_eq!(
611 ::std::mem::align_of::<uffdio_api>(),
612 8usize,
613 concat!("Alignment of ", stringify!(uffdio_api))
614 );
615 assert_eq!(
616 unsafe { ::std::ptr::addr_of!((*ptr).api) as usize - ptr as usize },
617 0usize,
618 concat!(
619 "Offset of field: ",
620 stringify!(uffdio_api),
621 "::",
622 stringify!(api)
623 )
624 );
625 assert_eq!(
626 unsafe { ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize },
627 8usize,
628 concat!(
629 "Offset of field: ",
630 stringify!(uffdio_api),
631 "::",
632 stringify!(features)
633 )
634 );
635 assert_eq!(
636 unsafe { ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize },
637 16usize,
638 concat!(
639 "Offset of field: ",
640 stringify!(uffdio_api),
641 "::",
642 stringify!(ioctls)
643 )
644 );
645 }
646 #[repr(C)]
647 #[derive(Debug, Copy, Clone)]
648 pub struct uffdio_range {
649 pub start: __u64,
650 pub len: __u64,
651 }
652 #[test]
bindgen_test_layout_uffdio_range()653 fn bindgen_test_layout_uffdio_range() {
654 const UNINIT: ::std::mem::MaybeUninit<uffdio_range> = ::std::mem::MaybeUninit::uninit();
655 let ptr = UNINIT.as_ptr();
656 assert_eq!(
657 ::std::mem::size_of::<uffdio_range>(),
658 16usize,
659 concat!("Size of: ", stringify!(uffdio_range))
660 );
661 assert_eq!(
662 ::std::mem::align_of::<uffdio_range>(),
663 8usize,
664 concat!("Alignment of ", stringify!(uffdio_range))
665 );
666 assert_eq!(
667 unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
668 0usize,
669 concat!(
670 "Offset of field: ",
671 stringify!(uffdio_range),
672 "::",
673 stringify!(start)
674 )
675 );
676 assert_eq!(
677 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
678 8usize,
679 concat!(
680 "Offset of field: ",
681 stringify!(uffdio_range),
682 "::",
683 stringify!(len)
684 )
685 );
686 }
687 #[repr(C)]
688 #[derive(Debug, Copy, Clone)]
689 pub struct uffdio_register {
690 pub range: uffdio_range,
691 pub mode: __u64,
692 pub ioctls: __u64,
693 }
694 #[test]
bindgen_test_layout_uffdio_register()695 fn bindgen_test_layout_uffdio_register() {
696 const UNINIT: ::std::mem::MaybeUninit<uffdio_register> = ::std::mem::MaybeUninit::uninit();
697 let ptr = UNINIT.as_ptr();
698 assert_eq!(
699 ::std::mem::size_of::<uffdio_register>(),
700 32usize,
701 concat!("Size of: ", stringify!(uffdio_register))
702 );
703 assert_eq!(
704 ::std::mem::align_of::<uffdio_register>(),
705 8usize,
706 concat!("Alignment of ", stringify!(uffdio_register))
707 );
708 assert_eq!(
709 unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize },
710 0usize,
711 concat!(
712 "Offset of field: ",
713 stringify!(uffdio_register),
714 "::",
715 stringify!(range)
716 )
717 );
718 assert_eq!(
719 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
720 16usize,
721 concat!(
722 "Offset of field: ",
723 stringify!(uffdio_register),
724 "::",
725 stringify!(mode)
726 )
727 );
728 assert_eq!(
729 unsafe { ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize },
730 24usize,
731 concat!(
732 "Offset of field: ",
733 stringify!(uffdio_register),
734 "::",
735 stringify!(ioctls)
736 )
737 );
738 }
739 #[repr(C)]
740 #[derive(Debug, Copy, Clone)]
741 pub struct uffdio_copy {
742 pub dst: __u64,
743 pub src: __u64,
744 pub len: __u64,
745 pub mode: __u64,
746 pub copy: __s64,
747 }
748 #[test]
bindgen_test_layout_uffdio_copy()749 fn bindgen_test_layout_uffdio_copy() {
750 const UNINIT: ::std::mem::MaybeUninit<uffdio_copy> = ::std::mem::MaybeUninit::uninit();
751 let ptr = UNINIT.as_ptr();
752 assert_eq!(
753 ::std::mem::size_of::<uffdio_copy>(),
754 40usize,
755 concat!("Size of: ", stringify!(uffdio_copy))
756 );
757 assert_eq!(
758 ::std::mem::align_of::<uffdio_copy>(),
759 8usize,
760 concat!("Alignment of ", stringify!(uffdio_copy))
761 );
762 assert_eq!(
763 unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize },
764 0usize,
765 concat!(
766 "Offset of field: ",
767 stringify!(uffdio_copy),
768 "::",
769 stringify!(dst)
770 )
771 );
772 assert_eq!(
773 unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize },
774 8usize,
775 concat!(
776 "Offset of field: ",
777 stringify!(uffdio_copy),
778 "::",
779 stringify!(src)
780 )
781 );
782 assert_eq!(
783 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
784 16usize,
785 concat!(
786 "Offset of field: ",
787 stringify!(uffdio_copy),
788 "::",
789 stringify!(len)
790 )
791 );
792 assert_eq!(
793 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
794 24usize,
795 concat!(
796 "Offset of field: ",
797 stringify!(uffdio_copy),
798 "::",
799 stringify!(mode)
800 )
801 );
802 assert_eq!(
803 unsafe { ::std::ptr::addr_of!((*ptr).copy) as usize - ptr as usize },
804 32usize,
805 concat!(
806 "Offset of field: ",
807 stringify!(uffdio_copy),
808 "::",
809 stringify!(copy)
810 )
811 );
812 }
813 #[repr(C)]
814 #[derive(Debug, Copy, Clone)]
815 pub struct uffdio_zeropage {
816 pub range: uffdio_range,
817 pub mode: __u64,
818 pub zeropage: __s64,
819 }
820 #[test]
bindgen_test_layout_uffdio_zeropage()821 fn bindgen_test_layout_uffdio_zeropage() {
822 const UNINIT: ::std::mem::MaybeUninit<uffdio_zeropage> = ::std::mem::MaybeUninit::uninit();
823 let ptr = UNINIT.as_ptr();
824 assert_eq!(
825 ::std::mem::size_of::<uffdio_zeropage>(),
826 32usize,
827 concat!("Size of: ", stringify!(uffdio_zeropage))
828 );
829 assert_eq!(
830 ::std::mem::align_of::<uffdio_zeropage>(),
831 8usize,
832 concat!("Alignment of ", stringify!(uffdio_zeropage))
833 );
834 assert_eq!(
835 unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize },
836 0usize,
837 concat!(
838 "Offset of field: ",
839 stringify!(uffdio_zeropage),
840 "::",
841 stringify!(range)
842 )
843 );
844 assert_eq!(
845 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
846 16usize,
847 concat!(
848 "Offset of field: ",
849 stringify!(uffdio_zeropage),
850 "::",
851 stringify!(mode)
852 )
853 );
854 assert_eq!(
855 unsafe { ::std::ptr::addr_of!((*ptr).zeropage) as usize - ptr as usize },
856 24usize,
857 concat!(
858 "Offset of field: ",
859 stringify!(uffdio_zeropage),
860 "::",
861 stringify!(zeropage)
862 )
863 );
864 }
865 #[repr(C)]
866 #[derive(Debug, Copy, Clone)]
867 pub struct uffdio_writeprotect {
868 pub range: uffdio_range,
869 pub mode: __u64,
870 }
871 #[test]
bindgen_test_layout_uffdio_writeprotect()872 fn bindgen_test_layout_uffdio_writeprotect() {
873 const UNINIT: ::std::mem::MaybeUninit<uffdio_writeprotect> = ::std::mem::MaybeUninit::uninit();
874 let ptr = UNINIT.as_ptr();
875 assert_eq!(
876 ::std::mem::size_of::<uffdio_writeprotect>(),
877 24usize,
878 concat!("Size of: ", stringify!(uffdio_writeprotect))
879 );
880 assert_eq!(
881 ::std::mem::align_of::<uffdio_writeprotect>(),
882 8usize,
883 concat!("Alignment of ", stringify!(uffdio_writeprotect))
884 );
885 assert_eq!(
886 unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize },
887 0usize,
888 concat!(
889 "Offset of field: ",
890 stringify!(uffdio_writeprotect),
891 "::",
892 stringify!(range)
893 )
894 );
895 assert_eq!(
896 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
897 16usize,
898 concat!(
899 "Offset of field: ",
900 stringify!(uffdio_writeprotect),
901 "::",
902 stringify!(mode)
903 )
904 );
905 }
906 #[repr(C)]
907 #[derive(Debug, Copy, Clone)]
908 pub struct uffdio_continue {
909 pub range: uffdio_range,
910 pub mode: __u64,
911 pub mapped: __s64,
912 }
913 #[test]
bindgen_test_layout_uffdio_continue()914 fn bindgen_test_layout_uffdio_continue() {
915 const UNINIT: ::std::mem::MaybeUninit<uffdio_continue> = ::std::mem::MaybeUninit::uninit();
916 let ptr = UNINIT.as_ptr();
917 assert_eq!(
918 ::std::mem::size_of::<uffdio_continue>(),
919 32usize,
920 concat!("Size of: ", stringify!(uffdio_continue))
921 );
922 assert_eq!(
923 ::std::mem::align_of::<uffdio_continue>(),
924 8usize,
925 concat!("Alignment of ", stringify!(uffdio_continue))
926 );
927 assert_eq!(
928 unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize },
929 0usize,
930 concat!(
931 "Offset of field: ",
932 stringify!(uffdio_continue),
933 "::",
934 stringify!(range)
935 )
936 );
937 assert_eq!(
938 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
939 16usize,
940 concat!(
941 "Offset of field: ",
942 stringify!(uffdio_continue),
943 "::",
944 stringify!(mode)
945 )
946 );
947 assert_eq!(
948 unsafe { ::std::ptr::addr_of!((*ptr).mapped) as usize - ptr as usize },
949 24usize,
950 concat!(
951 "Offset of field: ",
952 stringify!(uffdio_continue),
953 "::",
954 stringify!(mapped)
955 )
956 );
957 }
958 #[repr(C)]
959 #[derive(Debug, Copy, Clone)]
960 pub struct uffdio_poison {
961 pub range: uffdio_range,
962 pub mode: __u64,
963 pub updated: __s64,
964 }
965 #[test]
bindgen_test_layout_uffdio_poison()966 fn bindgen_test_layout_uffdio_poison() {
967 const UNINIT: ::std::mem::MaybeUninit<uffdio_poison> = ::std::mem::MaybeUninit::uninit();
968 let ptr = UNINIT.as_ptr();
969 assert_eq!(
970 ::std::mem::size_of::<uffdio_poison>(),
971 32usize,
972 concat!("Size of: ", stringify!(uffdio_poison))
973 );
974 assert_eq!(
975 ::std::mem::align_of::<uffdio_poison>(),
976 8usize,
977 concat!("Alignment of ", stringify!(uffdio_poison))
978 );
979 assert_eq!(
980 unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize },
981 0usize,
982 concat!(
983 "Offset of field: ",
984 stringify!(uffdio_poison),
985 "::",
986 stringify!(range)
987 )
988 );
989 assert_eq!(
990 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
991 16usize,
992 concat!(
993 "Offset of field: ",
994 stringify!(uffdio_poison),
995 "::",
996 stringify!(mode)
997 )
998 );
999 assert_eq!(
1000 unsafe { ::std::ptr::addr_of!((*ptr).updated) as usize - ptr as usize },
1001 24usize,
1002 concat!(
1003 "Offset of field: ",
1004 stringify!(uffdio_poison),
1005 "::",
1006 stringify!(updated)
1007 )
1008 );
1009 }
1010 #[repr(C)]
1011 #[derive(Debug, Copy, Clone)]
1012 pub struct uffdio_move {
1013 pub dst: __u64,
1014 pub src: __u64,
1015 pub len: __u64,
1016 pub mode: __u64,
1017 pub move_: __s64,
1018 }
1019 #[test]
bindgen_test_layout_uffdio_move()1020 fn bindgen_test_layout_uffdio_move() {
1021 const UNINIT: ::std::mem::MaybeUninit<uffdio_move> = ::std::mem::MaybeUninit::uninit();
1022 let ptr = UNINIT.as_ptr();
1023 assert_eq!(
1024 ::std::mem::size_of::<uffdio_move>(),
1025 40usize,
1026 concat!("Size of: ", stringify!(uffdio_move))
1027 );
1028 assert_eq!(
1029 ::std::mem::align_of::<uffdio_move>(),
1030 8usize,
1031 concat!("Alignment of ", stringify!(uffdio_move))
1032 );
1033 assert_eq!(
1034 unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize },
1035 0usize,
1036 concat!(
1037 "Offset of field: ",
1038 stringify!(uffdio_move),
1039 "::",
1040 stringify!(dst)
1041 )
1042 );
1043 assert_eq!(
1044 unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize },
1045 8usize,
1046 concat!(
1047 "Offset of field: ",
1048 stringify!(uffdio_move),
1049 "::",
1050 stringify!(src)
1051 )
1052 );
1053 assert_eq!(
1054 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
1055 16usize,
1056 concat!(
1057 "Offset of field: ",
1058 stringify!(uffdio_move),
1059 "::",
1060 stringify!(len)
1061 )
1062 );
1063 assert_eq!(
1064 unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
1065 24usize,
1066 concat!(
1067 "Offset of field: ",
1068 stringify!(uffdio_move),
1069 "::",
1070 stringify!(mode)
1071 )
1072 );
1073 assert_eq!(
1074 unsafe { ::std::ptr::addr_of!((*ptr).move_) as usize - ptr as usize },
1075 32usize,
1076 concat!(
1077 "Offset of field: ",
1078 stringify!(uffdio_move),
1079 "::",
1080 stringify!(move_)
1081 )
1082 );
1083 }
1084