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