Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"
publish = false

[dependencies]
bindgen = { version = "0.70.1", default-features = false }
tempfile = "3.12.0"
bindgen = { version = "0.71.1", default-features = false }
tempfile = "3.16.0"
2 changes: 1 addition & 1 deletion src/aarch64/bootparam.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */


2 changes: 1 addition & 1 deletion src/aarch64/btrfs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/elf_uapi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/errno.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub const EPERM: u32 = 1;
pub const ENOENT: u32 = 2;
Expand Down
130 changes: 122 additions & 8 deletions src/aarch64/general.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down Expand Up @@ -2896,26 +2896,48 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
let mask = 1 << bit_index;
byte & mask == mask
if val {
byte | mask
} else {
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
Expand All @@ -2932,6 +2954,20 @@ val |= 1 << index;
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
Expand All @@ -2943,6 +2979,18 @@ let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else {
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
impl<T> __IncompleteArrayField<T> {
#[inline]
Expand Down Expand Up @@ -2987,6 +3035,17 @@ self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn seg_32bit_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 0usize, 1u8) as u32) }
}
#[inline]
pub unsafe fn set_seg_32bit_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 0usize, 1u8, val as u64)
}
}
#[inline]
pub fn contents(&self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u32) }
}
Expand All @@ -2998,6 +3057,17 @@ self._bitfield_1.set(1usize, 2u8, val as u64)
}
}
#[inline]
pub unsafe fn contents_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 1usize, 2u8) as u32) }
}
#[inline]
pub unsafe fn set_contents_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 1usize, 2u8, val as u64)
}
}
#[inline]
pub fn read_exec_only(&self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
}
Expand All @@ -3009,6 +3079,17 @@ self._bitfield_1.set(3usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn read_exec_only_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 3usize, 1u8) as u32) }
}
#[inline]
pub unsafe fn set_read_exec_only_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 3usize, 1u8, val as u64)
}
}
#[inline]
pub fn limit_in_pages(&self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
}
Expand All @@ -3020,6 +3101,17 @@ self._bitfield_1.set(4usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn limit_in_pages_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 4usize, 1u8) as u32) }
}
#[inline]
pub unsafe fn set_limit_in_pages_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 4usize, 1u8, val as u64)
}
}
#[inline]
pub fn seg_not_present(&self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
}
Expand All @@ -3031,6 +3123,17 @@ self._bitfield_1.set(5usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn seg_not_present_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 5usize, 1u8) as u32) }
}
#[inline]
pub unsafe fn set_seg_not_present_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 5usize, 1u8, val as u64)
}
}
#[inline]
pub fn useable(&self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
}
Expand All @@ -3042,6 +3145,17 @@ self._bitfield_1.set(6usize, 1u8, val as u64)
}
}
#[inline]
pub unsafe fn useable_raw(this: *const Self) -> crate::ctypes::c_uint {
unsafe { ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(::core::ptr::addr_of!((*this)._bitfield_1), 6usize, 1u8) as u32) }
}
#[inline]
pub unsafe fn set_useable_raw(this: *mut Self, val: crate::ctypes::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(::core::ptr::addr_of_mut!((*this)._bitfield_1), 6usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(seg_32bit: crate::ctypes::c_uint, contents: crate::ctypes::c_uint, read_exec_only: crate::ctypes::c_uint, limit_in_pages: crate::ctypes::c_uint, seg_not_present: crate::ctypes::c_uint, useable: crate::ctypes::c_uint) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/if_arp.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/if_ether.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/if_packet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/image.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/io_uring.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/ioctl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub const FIONREAD: u32 = 21531;
pub const FIONBIO: u32 = 21537;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/landlock.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/loop_device.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub type __kernel_old_uid_t = crate::ctypes::c_ushort;
pub type __kernel_old_gid_t = crate::ctypes::c_ushort;
Expand Down
2 changes: 1 addition & 1 deletion src/aarch64/mempolicy.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */

pub const EPERM: u32 = 1;
pub const ENOENT: u32 = 2;
Expand Down
Loading