1 // Copyright 2021 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 /* automatically generated by rust-bindgen, though the exact command remains 6 * lost to history. Should be easy to duplicate, if needed. 7 */ 8 9 #![allow(dead_code)] 10 #![allow(non_camel_case_types)] 11 12 #[repr(C)] 13 #[derive(Default)] 14 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]); 15 impl<T> __IncompleteArrayField<T> { 16 #[inline] new() -> Self17 pub fn new() -> Self { 18 __IncompleteArrayField(::std::marker::PhantomData, []) 19 } 20 #[inline] as_ptr(&self) -> *const T21 pub unsafe fn as_ptr(&self) -> *const T { 22 ::std::mem::transmute(self) 23 } 24 #[inline] as_mut_ptr(&mut self) -> *mut T25 pub unsafe fn as_mut_ptr(&mut self) -> *mut T { 26 ::std::mem::transmute(self) 27 } 28 #[inline] as_slice(&self, len: usize) -> &[T]29 pub unsafe fn as_slice(&self, len: usize) -> &[T] { 30 ::std::slice::from_raw_parts(self.as_ptr(), len) 31 } 32 #[inline] as_mut_slice(&mut self, len: usize) -> &mut [T]33 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { 34 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) 35 } 36 } 37 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> { fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result38 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 39 fmt.write_str("__IncompleteArrayField") 40 } 41 } 42 impl<T> ::std::clone::Clone for __IncompleteArrayField<T> { 43 #[inline] clone(&self) -> Self44 fn clone(&self) -> Self { 45 Self::new() 46 } 47 } 48 pub const UDMABUF_FLAGS_CLOEXEC: u32 = 1; 49 pub type __u32 = ::std::os::raw::c_uint; 50 pub type __u64 = ::std::os::raw::c_ulonglong; 51 #[repr(C)] 52 #[derive(Debug, Default, Copy, Clone)] 53 pub struct udmabuf_create { 54 pub memfd: __u32, 55 pub flags: __u32, 56 pub offset: __u64, 57 pub size: __u64, 58 } 59 #[repr(C)] 60 #[derive(Debug, Default, Copy, Clone)] 61 pub struct udmabuf_create_item { 62 pub memfd: __u32, 63 pub __pad: __u32, 64 pub offset: __u64, 65 pub size: __u64, 66 } 67 #[repr(C)] 68 #[repr(align(8))] 69 #[derive(Debug, Default)] 70 pub struct udmabuf_create_list { 71 pub flags: __u32, 72 pub count: __u32, 73 pub list: __IncompleteArrayField<udmabuf_create_item>, 74 } 75