1 /* automatically generated by tools/bindgen-all-the-things */ 2 3 #![allow(clippy::missing_safety_doc)] 4 #![allow(clippy::undocumented_unsafe_blocks)] 5 #![allow(clippy::upper_case_acronyms)] 6 #![allow(non_upper_case_globals)] 7 #![allow(non_camel_case_types)] 8 #![allow(non_snake_case)] 9 #![allow(dead_code)] 10 11 #[repr(C)] 12 #[derive(Default)] 13 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]); 14 impl<T> __IncompleteArrayField<T> { 15 #[inline] new() -> Self16 pub const fn new() -> Self { 17 __IncompleteArrayField(::std::marker::PhantomData, []) 18 } 19 #[inline] as_ptr(&self) -> *const T20 pub fn as_ptr(&self) -> *const T { 21 self as *const _ as *const T 22 } 23 #[inline] as_mut_ptr(&mut self) -> *mut T24 pub fn as_mut_ptr(&mut self) -> *mut T { 25 self as *mut _ as *mut T 26 } 27 #[inline] as_slice(&self, len: usize) -> &[T]28 pub unsafe fn as_slice(&self, len: usize) -> &[T] { 29 ::std::slice::from_raw_parts(self.as_ptr(), len) 30 } 31 #[inline] as_mut_slice(&mut self, len: usize) -> &mut [T]32 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { 33 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) 34 } 35 } 36 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> { fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result37 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 38 fmt.write_str("__IncompleteArrayField") 39 } 40 } 41 pub const VHOST_VRING_F_LOG: u32 = 0; 42 pub const VHOST_ACCESS_RO: u32 = 1; 43 pub const VHOST_ACCESS_WO: u32 = 2; 44 pub const VHOST_ACCESS_RW: u32 = 3; 45 pub const VHOST_IOTLB_MISS: u32 = 1; 46 pub const VHOST_IOTLB_UPDATE: u32 = 2; 47 pub const VHOST_IOTLB_INVALIDATE: u32 = 3; 48 pub const VHOST_IOTLB_ACCESS_FAIL: u32 = 4; 49 pub const VHOST_IOTLB_BATCH_BEGIN: u32 = 5; 50 pub const VHOST_IOTLB_BATCH_END: u32 = 6; 51 pub const VHOST_IOTLB_MSG: u32 = 1; 52 pub const VHOST_IOTLB_MSG_V2: u32 = 2; 53 pub const VHOST_PAGE_SIZE: u32 = 4096; 54 pub const VHOST_SCSI_ABI_VERSION: u32 = 1; 55 pub const VHOST_F_LOG_ALL: u32 = 26; 56 pub const VHOST_NET_F_VIRTIO_NET_HDR: u32 = 27; 57 pub const VHOST_BACKEND_F_IOTLB_MSG_V2: u32 = 1; 58 pub const VHOST_BACKEND_F_IOTLB_BATCH: u32 = 2; 59 pub const VHOST_BACKEND_F_IOTLB_ASID: u32 = 3; 60 pub const VHOST_BACKEND_F_SUSPEND: u32 = 4; 61 pub const VHOST_BACKEND_F_RESUME: u32 = 5; 62 pub const VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK: u32 = 6; 63 pub const VHOST_BACKEND_F_DESC_ASID: u32 = 7; 64 pub const VHOST_BACKEND_F_IOTLB_PERSIST: u32 = 8; 65 pub const VHOST_FILE_UNBIND: i32 = -1; 66 pub const VHOST_VIRTIO: u32 = 175; 67 pub const VHOST_VRING_LITTLE_ENDIAN: u32 = 0; 68 pub const VHOST_VRING_BIG_ENDIAN: u32 = 1; 69 #[repr(C)] 70 #[derive(Debug, Default, Copy, Clone)] 71 pub struct vhost_vring_state { 72 pub index: ::std::os::raw::c_uint, 73 pub num: ::std::os::raw::c_uint, 74 } 75 #[repr(C)] 76 #[derive(Debug, Default, Copy, Clone)] 77 pub struct vhost_vring_file { 78 pub index: ::std::os::raw::c_uint, 79 pub fd: ::std::os::raw::c_int, 80 } 81 #[repr(C)] 82 #[derive(Debug, Default, Copy, Clone)] 83 pub struct vhost_vring_addr { 84 pub index: ::std::os::raw::c_uint, 85 pub flags: ::std::os::raw::c_uint, 86 pub desc_user_addr: u64, 87 pub used_user_addr: u64, 88 pub avail_user_addr: u64, 89 pub log_guest_addr: u64, 90 } 91 #[repr(C)] 92 #[derive(Debug, Default, Copy, Clone)] 93 pub struct vhost_worker_state { 94 pub worker_id: ::std::os::raw::c_uint, 95 } 96 #[repr(C)] 97 #[derive(Debug, Default, Copy, Clone)] 98 pub struct vhost_vring_worker { 99 pub index: ::std::os::raw::c_uint, 100 pub worker_id: ::std::os::raw::c_uint, 101 } 102 #[repr(C)] 103 #[derive(Debug, Default, Copy, Clone)] 104 pub struct vhost_iotlb_msg { 105 pub iova: u64, 106 pub size: u64, 107 pub uaddr: u64, 108 pub perm: u8, 109 pub type_: u8, 110 } 111 #[repr(C)] 112 #[derive(Copy, Clone)] 113 pub struct vhost_msg { 114 pub type_: ::std::os::raw::c_int, 115 pub __bindgen_anon_1: vhost_msg__bindgen_ty_1, 116 } 117 #[repr(C)] 118 #[derive(Copy, Clone)] 119 pub union vhost_msg__bindgen_ty_1 { 120 pub iotlb: vhost_iotlb_msg, 121 pub padding: [u8; 64usize], 122 } 123 impl Default for vhost_msg__bindgen_ty_1 { default() -> Self124 fn default() -> Self { 125 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 126 unsafe { 127 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 128 s.assume_init() 129 } 130 } 131 } 132 impl Default for vhost_msg { default() -> Self133 fn default() -> Self { 134 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 135 unsafe { 136 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 137 s.assume_init() 138 } 139 } 140 } 141 #[repr(C)] 142 #[derive(Copy, Clone)] 143 pub struct vhost_msg_v2 { 144 pub type_: u32, 145 pub asid: u32, 146 pub __bindgen_anon_1: vhost_msg_v2__bindgen_ty_1, 147 } 148 #[repr(C)] 149 #[derive(Copy, Clone)] 150 pub union vhost_msg_v2__bindgen_ty_1 { 151 pub iotlb: vhost_iotlb_msg, 152 pub padding: [u8; 64usize], 153 } 154 impl Default for vhost_msg_v2__bindgen_ty_1 { default() -> Self155 fn default() -> Self { 156 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 157 unsafe { 158 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 159 s.assume_init() 160 } 161 } 162 } 163 impl Default for vhost_msg_v2 { default() -> Self164 fn default() -> Self { 165 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 166 unsafe { 167 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 168 s.assume_init() 169 } 170 } 171 } 172 #[repr(C)] 173 #[derive(Debug, Default, Copy, Clone)] 174 pub struct vhost_memory_region { 175 pub guest_phys_addr: u64, 176 pub memory_size: u64, 177 pub userspace_addr: u64, 178 pub flags_padding: u64, 179 } 180 #[repr(C)] 181 #[derive(Debug, Default)] 182 pub struct vhost_memory { 183 pub nregions: u32, 184 pub padding: u32, 185 pub regions: __IncompleteArrayField<vhost_memory_region>, 186 } 187 #[repr(C)] 188 #[derive(Debug, Copy, Clone)] 189 pub struct vhost_scsi_target { 190 pub abi_version: ::std::os::raw::c_int, 191 pub vhost_wwpn: [::std::os::raw::c_char; 224usize], 192 pub vhost_tpgt: ::std::os::raw::c_ushort, 193 pub reserved: ::std::os::raw::c_ushort, 194 } 195 impl Default for vhost_scsi_target { default() -> Self196 fn default() -> Self { 197 let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); 198 unsafe { 199 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); 200 s.assume_init() 201 } 202 } 203 } 204 #[repr(C)] 205 #[derive(Debug, Default)] 206 pub struct vhost_vdpa_config { 207 pub off: u32, 208 pub len: u32, 209 pub buf: __IncompleteArrayField<u8>, 210 } 211 #[repr(C)] 212 #[derive(Debug, Default, Copy, Clone)] 213 pub struct vhost_vdpa_iova_range { 214 pub first: u64, 215 pub last: u64, 216 } 217