pub type __u32 = ::core::ffi::c_uint;
pub type __u64 = ::core::ffi::c_ulonglong;
pub type __kernel_pid_t = ::core::ffi::c_int;
#[doc = " @brief structure describing a guest to host memory mapping"]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct vm_memslot {
#[doc = " Base physical address in the guest"]
pub base: __u64,
#[doc = " Host virtual address where the guest base resides in"]
pub host_base: __u64,
#[doc = " Size of the mapping"]
pub map_size: __u64,
}
#[test]
fn bindgen_test_layout_vm_memslot() {
const UNINIT: ::core::mem::MaybeUninit<vm_memslot> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<vm_memslot>(),
24usize,
concat!("Size of: ", stringify!(vm_memslot))
);
assert_eq!(
::core::mem::align_of::<vm_memslot>(),
8usize,
concat!("Alignment of ", stringify!(vm_memslot))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).base) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(vm_memslot),
"::",
stringify!(base)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).host_base) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(vm_memslot),
"::",
stringify!(host_base)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).map_size) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(vm_memslot),
"::",
stringify!(map_size)
)
);
}
#[doc = " @brief structure describing the virtual machine"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct vm_info {
#[doc = " PID of userspace VM monitor."]
pub userspace_pid: __kernel_pid_t,
#[doc = " Number of memory slots allocated by userspace. After MEMFLOW_VM_INFO ioctl -\n number of slots in the VM"]
pub slot_count: __u32,
#[doc = " The memory slots, sorted by base address"]
pub slots: *mut vm_memslot,
}
#[test]
fn bindgen_test_layout_vm_info() {
const UNINIT: ::core::mem::MaybeUninit<vm_info> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<vm_info>(),
16usize,
concat!("Size of: ", stringify!(vm_info))
);
assert_eq!(
::core::mem::align_of::<vm_info>(),
8usize,
concat!("Alignment of ", stringify!(vm_info))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).userspace_pid) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(vm_info),
"::",
stringify!(userspace_pid)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).slot_count) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(vm_info),
"::",
stringify!(slot_count)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).slots) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(vm_info),
"::",
stringify!(slots)
)
);
}
impl Default for vm_info {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[doc = " @brief structure describing memory layout of the mapped virtual machine"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct vm_map_info {
#[doc = " Number of memory slots that were allocated. After MEMFLOW_MAP_VM ioctl -\n number of slots that were mapped in the VM"]
pub slot_count: __u32,
#[doc = " The mapped memory slots, sorted by base address. Slots only include the regions that were mapped in,\n so the first, and the last slots may not be the full KVM memslots, if not everything is mapped in"]
pub slots: *mut vm_memslot,
}
#[test]
fn bindgen_test_layout_vm_map_info() {
const UNINIT: ::core::mem::MaybeUninit<vm_map_info> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<vm_map_info>(),
16usize,
concat!("Size of: ", stringify!(vm_map_info))
);
assert_eq!(
::core::mem::align_of::<vm_map_info>(),
8usize,
concat!("Alignment of ", stringify!(vm_map_info))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).slot_count) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(vm_map_info),
"::",
stringify!(slot_count)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).slots) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(vm_map_info),
"::",
stringify!(slots)
)
);
}
impl Default for vm_map_info {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub const IO_MEMFLOW_OPEN_VM: usize = 2147773696;
pub const IO_MEMFLOW_VM_INFO: usize = 3222301953;
pub const IO_MEMFLOW_MAP_VM: usize = 3222301954;