Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate new bindings #162

Merged
merged 2 commits into from
Aug 29, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mshv-bindings/src/arm64/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14171,7 +14171,8 @@ fn bindgen_test_layout_hv_input_set_partition_property() {
}
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_REGISTERS: hv_vp_state_page_type = 0;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_INTERCEPT_MESSAGE: hv_vp_state_page_type = 1;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 2;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_GHCB: hv_vp_state_page_type = 2;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 3;
pub type hv_vp_state_page_type = ::std::os::raw::c_uint;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
Expand Down Expand Up @@ -20803,6 +20804,11 @@ fn bindgen_test_layout_mshv_root_hvcall() {
)
);
}
pub const MSHV_VP_MMAP_OFFSET_REGISTERS: _bindgen_ty_12 = 0;
pub const MSHV_VP_MMAP_OFFSET_INTERCEPT_MESSAGE: _bindgen_ty_12 = 1;
pub const MSHV_VP_MMAP_OFFSET_GHCB: _bindgen_ty_12 = 2;
pub const MSHV_VP_MMAP_OFFSET_COUNT: _bindgen_ty_12 = 3;
pub type _bindgen_ty_12 = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
pub struct mshv_run_vp {
Expand Down
23 changes: 15 additions & 8 deletions mshv-bindings/src/x86_64/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ pub const HV_X64_HYPERV_NESTED: u32 = 4096;
pub const HV_X64_ENLIGHTENED_VMCS_RECOMMENDED: u32 = 16384;
pub const HV_SHARED_GPA_BOUNDARY_ACTIVE: u32 = 32;
pub const HV_VP_DISPATCH_INTERRUPT_INJECTION_AVAILABLE: u32 = 512;
pub const HV_VP_GHCB_ROOT_MAPPING_AVAILABLE: u32 = 1024;
pub const HV_MAXIMUM_PROCESSORS: u32 = 2048;
pub const HV_MAX_VP_INDEX: u32 = 2047;
pub const HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: u32 = 2;
Expand Down Expand Up @@ -16705,7 +16706,8 @@ fn bindgen_test_layout_hv_input_set_partition_property() {
}
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_REGISTERS: hv_vp_state_page_type = 0;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_INTERCEPT_MESSAGE: hv_vp_state_page_type = 1;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 2;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_GHCB: hv_vp_state_page_type = 2;
pub const hv_vp_state_page_type_HV_VP_STATE_PAGE_COUNT: hv_vp_state_page_type = 3;
pub type hv_vp_state_page_type = ::std::os::raw::c_uint;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
Expand Down Expand Up @@ -27373,6 +27375,11 @@ fn bindgen_test_layout_mshv_root_hvcall() {
)
);
}
pub const MSHV_VP_MMAP_OFFSET_REGISTERS: _bindgen_ty_12 = 0;
pub const MSHV_VP_MMAP_OFFSET_INTERCEPT_MESSAGE: _bindgen_ty_12 = 1;
pub const MSHV_VP_MMAP_OFFSET_GHCB: _bindgen_ty_12 = 2;
pub const MSHV_VP_MMAP_OFFSET_COUNT: _bindgen_ty_12 = 3;
pub type _bindgen_ty_12 = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
pub struct mshv_run_vp {
Expand Down Expand Up @@ -27412,13 +27419,13 @@ impl Default for mshv_run_vp {
}
}
}
pub const MSHV_VP_STATE_LAPIC: _bindgen_ty_12 = 0;
pub const MSHV_VP_STATE_XSAVE: _bindgen_ty_12 = 1;
pub const MSHV_VP_STATE_SIMP: _bindgen_ty_12 = 2;
pub const MSHV_VP_STATE_SIEFP: _bindgen_ty_12 = 3;
pub const MSHV_VP_STATE_SYNTHETIC_TIMERS: _bindgen_ty_12 = 4;
pub const MSHV_VP_STATE_COUNT: _bindgen_ty_12 = 5;
pub type _bindgen_ty_12 = ::std::os::raw::c_uint;
pub const MSHV_VP_STATE_LAPIC: _bindgen_ty_13 = 0;
pub const MSHV_VP_STATE_XSAVE: _bindgen_ty_13 = 1;
pub const MSHV_VP_STATE_SIMP: _bindgen_ty_13 = 2;
pub const MSHV_VP_STATE_SIEFP: _bindgen_ty_13 = 3;
pub const MSHV_VP_STATE_SYNTHETIC_TIMERS: _bindgen_ty_13 = 4;
pub const MSHV_VP_STATE_COUNT: _bindgen_ty_13 = 5;
pub type _bindgen_ty_13 = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
pub struct mshv_get_set_vp_state {
Expand Down
7 changes: 6 additions & 1 deletion scripts/generate_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ def main(args):

if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Generate Rust bindings from Hyper-V headers from Linux kernel"
description="Generate Rust bindings from Hyper-V headers from Linux kernel",
epilog="example:\n"
"./generate_binding.py -k /opt/linux-dom0\n"
"./generate_binding.py -k /opt/linux-dom0 --arch x86\n"
"./generate_binding.py --bindgen=\"--with-derive-eq --with-derive-partialeq --with-derive-ord\" -k /opt/linux-dom0",
formatter_class=argparse.RawTextHelpFormatter
)

parser.add_argument(
Expand Down