| /* automatically generated by rust-bindgen 0.63.0 */ |
| |
| #[repr(C)] |
| #[derive(Default)] |
| pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]); |
| impl<T> __IncompleteArrayField<T> { |
| #[inline] |
| pub const fn new() -> Self { |
| __IncompleteArrayField(::std::marker::PhantomData, []) |
| } |
| #[inline] |
| pub fn as_ptr(&self) -> *const T { |
| self as *const _ as *const T |
| } |
| #[inline] |
| pub fn as_mut_ptr(&mut self) -> *mut T { |
| self as *mut _ as *mut T |
| } |
| #[inline] |
| pub unsafe fn as_slice(&self, len: usize) -> &[T] { |
| ::std::slice::from_raw_parts(self.as_ptr(), len) |
| } |
| #[inline] |
| pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { |
| ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) |
| } |
| } |
| impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> { |
| fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
| fmt.write_str("__IncompleteArrayField") |
| } |
| } |
| pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; |
| pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; |
| pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; |
| pub const VIRTIO_BLK_F_RO: u32 = 5; |
| pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; |
| pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; |
| pub const VIRTIO_BLK_F_MQ: u32 = 12; |
| pub const VIRTIO_BLK_F_DISCARD: u32 = 13; |
| pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; |
| pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; |
| pub const VIRTIO_BLK_F_ZONED: u32 = 17; |
| pub const VIRTIO_BLK_F_BARRIER: u32 = 0; |
| pub const VIRTIO_BLK_F_SCSI: u32 = 7; |
| pub const VIRTIO_BLK_F_FLUSH: u32 = 9; |
| pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; |
| pub const VIRTIO_BLK_F_WCE: u32 = 9; |
| pub const VIRTIO_BLK_ID_BYTES: u32 = 20; |
| pub const VIRTIO_BLK_T_IN: u32 = 0; |
| pub const VIRTIO_BLK_T_OUT: u32 = 1; |
| pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; |
| pub const VIRTIO_BLK_T_FLUSH: u32 = 4; |
| pub const VIRTIO_BLK_T_GET_ID: u32 = 8; |
| pub const VIRTIO_BLK_T_DISCARD: u32 = 11; |
| pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; |
| pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; |
| pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; |
| pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; |
| pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; |
| pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; |
| pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; |
| pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; |
| pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; |
| pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; |
| pub const VIRTIO_BLK_Z_NONE: u32 = 0; |
| pub const VIRTIO_BLK_Z_HM: u32 = 1; |
| pub const VIRTIO_BLK_Z_HA: u32 = 2; |
| pub const VIRTIO_BLK_ZT_CONV: u32 = 1; |
| pub const VIRTIO_BLK_ZT_SWR: u32 = 2; |
| pub const VIRTIO_BLK_ZT_SWP: u32 = 3; |
| pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; |
| pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; |
| pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; |
| pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; |
| pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; |
| pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; |
| pub const VIRTIO_BLK_ZS_FULL: u32 = 14; |
| pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; |
| pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; |
| pub const VIRTIO_BLK_S_OK: u32 = 0; |
| pub const VIRTIO_BLK_S_IOERR: u32 = 1; |
| pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; |
| pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; |
| pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; |
| pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; |
| pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; |
| pub type __u8 = ::std::os::raw::c_uchar; |
| pub type __u16 = ::std::os::raw::c_ushort; |
| pub type __u32 = ::std::os::raw::c_uint; |
| pub type __u64 = ::std::os::raw::c_ulonglong; |
| pub type __le32 = __u32; |
| pub type __le64 = __u64; |
| pub type __virtio16 = __u16; |
| pub type __virtio32 = __u32; |
| pub type __virtio64 = __u64; |
| #[repr(C, packed)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_config { |
| pub capacity: __virtio64, |
| pub size_max: __virtio32, |
| pub seg_max: __virtio32, |
| pub geometry: virtio_blk_config_virtio_blk_geometry, |
| pub blk_size: __virtio32, |
| pub physical_block_exp: __u8, |
| pub alignment_offset: __u8, |
| pub min_io_size: __virtio16, |
| pub opt_io_size: __virtio32, |
| pub wce: __u8, |
| pub unused: __u8, |
| pub num_queues: __virtio16, |
| pub max_discard_sectors: __virtio32, |
| pub max_discard_seg: __virtio32, |
| pub discard_sector_alignment: __virtio32, |
| pub max_write_zeroes_sectors: __virtio32, |
| pub max_write_zeroes_seg: __virtio32, |
| pub write_zeroes_may_unmap: __u8, |
| pub unused1: [__u8; 3usize], |
| pub max_secure_erase_sectors: __virtio32, |
| pub max_secure_erase_seg: __virtio32, |
| pub secure_erase_sector_alignment: __virtio32, |
| pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_config_virtio_blk_geometry { |
| pub cylinders: __virtio16, |
| pub heads: __u8, |
| pub sectors: __u8, |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_config_virtio_blk_geometry() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_config_virtio_blk_geometry> = |
| ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_config_virtio_blk_geometry>(), |
| 4usize, |
| concat!( |
| "Size of: ", |
| stringify!(virtio_blk_config_virtio_blk_geometry) |
| ) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_config_virtio_blk_geometry>(), |
| 2usize, |
| concat!( |
| "Alignment of ", |
| stringify!(virtio_blk_config_virtio_blk_geometry) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).cylinders) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_geometry), |
| "::", |
| stringify!(cylinders) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).heads) as usize - ptr as usize }, |
| 2usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_geometry), |
| "::", |
| stringify!(heads) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).sectors) as usize - ptr as usize }, |
| 3usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_geometry), |
| "::", |
| stringify!(sectors) |
| ) |
| ); |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_config_virtio_blk_zoned_characteristics { |
| pub zone_sectors: __virtio32, |
| pub max_open_zones: __virtio32, |
| pub max_active_zones: __virtio32, |
| pub max_append_sectors: __virtio32, |
| pub write_granularity: __virtio32, |
| pub model: __u8, |
| pub unused2: [__u8; 3usize], |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_config_virtio_blk_zoned_characteristics() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_config_virtio_blk_zoned_characteristics> = |
| ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_config_virtio_blk_zoned_characteristics>(), |
| 24usize, |
| concat!( |
| "Size of: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics) |
| ) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_config_virtio_blk_zoned_characteristics>(), |
| 4usize, |
| concat!( |
| "Alignment of ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).zone_sectors) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(zone_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_open_zones) as usize - ptr as usize }, |
| 4usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(max_open_zones) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_active_zones) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(max_active_zones) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_append_sectors) as usize - ptr as usize }, |
| 12usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(max_append_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).write_granularity) as usize - ptr as usize }, |
| 16usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(write_granularity) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, |
| 20usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(model) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).unused2) as usize - ptr as usize }, |
| 21usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config_virtio_blk_zoned_characteristics), |
| "::", |
| stringify!(unused2) |
| ) |
| ); |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_config() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_config> = ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_config>(), |
| 96usize, |
| concat!("Size of: ", stringify!(virtio_blk_config)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_config>(), |
| 1usize, |
| concat!("Alignment of ", stringify!(virtio_blk_config)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).capacity) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(capacity) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).size_max) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(size_max) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).seg_max) as usize - ptr as usize }, |
| 12usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(seg_max) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).geometry) as usize - ptr as usize }, |
| 16usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(geometry) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).blk_size) as usize - ptr as usize }, |
| 20usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(blk_size) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).physical_block_exp) as usize - ptr as usize }, |
| 24usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(physical_block_exp) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).alignment_offset) as usize - ptr as usize }, |
| 25usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(alignment_offset) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).min_io_size) as usize - ptr as usize }, |
| 26usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(min_io_size) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).opt_io_size) as usize - ptr as usize }, |
| 28usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(opt_io_size) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).wce) as usize - ptr as usize }, |
| 32usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(wce) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize }, |
| 33usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(unused) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).num_queues) as usize - ptr as usize }, |
| 34usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(num_queues) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_discard_sectors) as usize - ptr as usize }, |
| 36usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_discard_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_discard_seg) as usize - ptr as usize }, |
| 40usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_discard_seg) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).discard_sector_alignment) as usize - ptr as usize }, |
| 44usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(discard_sector_alignment) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_write_zeroes_sectors) as usize - ptr as usize }, |
| 48usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_write_zeroes_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_write_zeroes_seg) as usize - ptr as usize }, |
| 52usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_write_zeroes_seg) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).write_zeroes_may_unmap) as usize - ptr as usize }, |
| 56usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(write_zeroes_may_unmap) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).unused1) as usize - ptr as usize }, |
| 57usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(unused1) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_secure_erase_sectors) as usize - ptr as usize }, |
| 60usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_secure_erase_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).max_secure_erase_seg) as usize - ptr as usize }, |
| 64usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(max_secure_erase_seg) |
| ) |
| ); |
| assert_eq!( |
| unsafe { |
| ::std::ptr::addr_of!((*ptr).secure_erase_sector_alignment) as usize - ptr as usize |
| }, |
| 68usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(secure_erase_sector_alignment) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).zoned) as usize - ptr as usize }, |
| 72usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_config), |
| "::", |
| stringify!(zoned) |
| ) |
| ); |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_outhdr { |
| pub type_: __virtio32, |
| pub ioprio: __virtio32, |
| pub sector: __virtio64, |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_outhdr() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_outhdr> = ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_outhdr>(), |
| 16usize, |
| concat!("Size of: ", stringify!(virtio_blk_outhdr)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_outhdr>(), |
| 8usize, |
| concat!("Alignment of ", stringify!(virtio_blk_outhdr)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_outhdr), |
| "::", |
| stringify!(type_) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).ioprio) as usize - ptr as usize }, |
| 4usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_outhdr), |
| "::", |
| stringify!(ioprio) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).sector) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_outhdr), |
| "::", |
| stringify!(sector) |
| ) |
| ); |
| } |
| #[repr(C)] |
| #[derive(Debug, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_zone_descriptor { |
| pub z_cap: __virtio64, |
| pub z_start: __virtio64, |
| pub z_wp: __virtio64, |
| pub z_type: __u8, |
| pub z_state: __u8, |
| pub reserved: [__u8; 38usize], |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_zone_descriptor() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_zone_descriptor> = |
| ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_zone_descriptor>(), |
| 64usize, |
| concat!("Size of: ", stringify!(virtio_blk_zone_descriptor)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_zone_descriptor>(), |
| 8usize, |
| concat!("Alignment of ", stringify!(virtio_blk_zone_descriptor)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).z_cap) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(z_cap) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).z_start) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(z_start) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).z_wp) as usize - ptr as usize }, |
| 16usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(z_wp) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).z_type) as usize - ptr as usize }, |
| 24usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(z_type) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).z_state) as usize - ptr as usize }, |
| 25usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(z_state) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, |
| 26usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_descriptor), |
| "::", |
| stringify!(reserved) |
| ) |
| ); |
| } |
| impl Default for virtio_blk_zone_descriptor { |
| fn default() -> Self { |
| let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| #[repr(C)] |
| #[derive(Debug)] |
| pub struct virtio_blk_zone_report { |
| pub nr_zones: __virtio64, |
| pub reserved: [__u8; 56usize], |
| pub zones: __IncompleteArrayField<virtio_blk_zone_descriptor>, |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_zone_report() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_zone_report> = |
| ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_zone_report>(), |
| 64usize, |
| concat!("Size of: ", stringify!(virtio_blk_zone_report)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_zone_report>(), |
| 8usize, |
| concat!("Alignment of ", stringify!(virtio_blk_zone_report)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).nr_zones) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_report), |
| "::", |
| stringify!(nr_zones) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_report), |
| "::", |
| stringify!(reserved) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).zones) as usize - ptr as usize }, |
| 64usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_zone_report), |
| "::", |
| stringify!(zones) |
| ) |
| ); |
| } |
| impl Default for virtio_blk_zone_report { |
| fn default() -> Self { |
| let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); |
| unsafe { |
| ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); |
| s.assume_init() |
| } |
| } |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_blk_discard_write_zeroes { |
| pub sector: __le64, |
| pub num_sectors: __le32, |
| pub flags: __le32, |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_blk_discard_write_zeroes() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_blk_discard_write_zeroes> = |
| ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_blk_discard_write_zeroes>(), |
| 16usize, |
| concat!("Size of: ", stringify!(virtio_blk_discard_write_zeroes)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_blk_discard_write_zeroes>(), |
| 8usize, |
| concat!("Alignment of ", stringify!(virtio_blk_discard_write_zeroes)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).sector) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_discard_write_zeroes), |
| "::", |
| stringify!(sector) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).num_sectors) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_discard_write_zeroes), |
| "::", |
| stringify!(num_sectors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, |
| 12usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_blk_discard_write_zeroes), |
| "::", |
| stringify!(flags) |
| ) |
| ); |
| } |
| #[repr(C)] |
| #[derive(Debug, Default, Copy, Clone, PartialEq)] |
| pub struct virtio_scsi_inhdr { |
| pub errors: __virtio32, |
| pub data_len: __virtio32, |
| pub sense_len: __virtio32, |
| pub residual: __virtio32, |
| } |
| #[test] |
| fn bindgen_test_layout_virtio_scsi_inhdr() { |
| const UNINIT: ::std::mem::MaybeUninit<virtio_scsi_inhdr> = ::std::mem::MaybeUninit::uninit(); |
| let ptr = UNINIT.as_ptr(); |
| assert_eq!( |
| ::std::mem::size_of::<virtio_scsi_inhdr>(), |
| 16usize, |
| concat!("Size of: ", stringify!(virtio_scsi_inhdr)) |
| ); |
| assert_eq!( |
| ::std::mem::align_of::<virtio_scsi_inhdr>(), |
| 4usize, |
| concat!("Alignment of ", stringify!(virtio_scsi_inhdr)) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).errors) as usize - ptr as usize }, |
| 0usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_scsi_inhdr), |
| "::", |
| stringify!(errors) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).data_len) as usize - ptr as usize }, |
| 4usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_scsi_inhdr), |
| "::", |
| stringify!(data_len) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).sense_len) as usize - ptr as usize }, |
| 8usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_scsi_inhdr), |
| "::", |
| stringify!(sense_len) |
| ) |
| ); |
| assert_eq!( |
| unsafe { ::std::ptr::addr_of!((*ptr).residual) as usize - ptr as usize }, |
| 12usize, |
| concat!( |
| "Offset of field: ", |
| stringify!(virtio_scsi_inhdr), |
| "::", |
| stringify!(residual) |
| ) |
| ); |
| } |