1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* automatically generated by rust-bindgen 0.69.1 */

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;