diff --git a/mshv-bindings/src/bindings.rs b/mshv-bindings/src/bindings.rs index a548fb6b..ca461651 100644 --- a/mshv-bindings/src/bindings.rs +++ b/mshv-bindings/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.66.1 */ +/* automatically generated by rust-bindgen 0.69.4 */ /* * Kernel (uapi) headers used for these bindings are as follows: * include/hyperv/hvgdk_mini.h @@ -143,7 +143,7 @@ impl ::std::default::Default for __BindgenUnionField { impl ::std::clone::Clone for __BindgenUnionField { #[inline] fn clone(&self) -> Self { - Self::new() + *self } } impl ::std::marker::Copy for __BindgenUnionField {} @@ -164,8 +164,36 @@ impl ::std::cmp::Eq for __BindgenUnionField {} pub const __BITS_PER_LONG: u32 = 64; pub const __FD_SETSIZE: u32 = 1024; pub const HVGDK_MINI_H_VERSION: u32 = 25294; +pub const HV_STATUS_SUCCESS: u32 = 0; +pub const HV_STATUS_INVALID_HYPERCALL_CODE: u32 = 2; +pub const HV_STATUS_INVALID_HYPERCALL_INPUT: u32 = 3; +pub const HV_STATUS_INVALID_ALIGNMENT: u32 = 4; +pub const HV_STATUS_INVALID_PARAMETER: u32 = 5; +pub const HV_STATUS_ACCESS_DENIED: u32 = 6; +pub const HV_STATUS_INVALID_PARTITION_STATE: u32 = 7; +pub const HV_STATUS_OPERATION_DENIED: u32 = 8; +pub const HV_STATUS_UNKNOWN_PROPERTY: u32 = 9; +pub const HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE: u32 = 10; +pub const HV_STATUS_INSUFFICIENT_MEMORY: u32 = 11; +pub const HV_STATUS_INVALID_PARTITION_ID: u32 = 13; +pub const HV_STATUS_INVALID_VP_INDEX: u32 = 14; +pub const HV_STATUS_NOT_FOUND: u32 = 16; +pub const HV_STATUS_INVALID_PORT_ID: u32 = 17; +pub const HV_STATUS_INVALID_CONNECTION_ID: u32 = 18; +pub const HV_STATUS_INSUFFICIENT_BUFFERS: u32 = 19; +pub const HV_STATUS_NOT_ACKNOWLEDGED: u32 = 20; +pub const HV_STATUS_INVALID_VP_STATE: u32 = 21; +pub const HV_STATUS_NO_RESOURCES: u32 = 29; +pub const HV_STATUS_PROCESSOR_FEATURE_NOT_SUPPORTED: u32 = 32; +pub const HV_STATUS_INVALID_LP_INDEX: u32 = 65; +pub const HV_STATUS_INVALID_REGISTER_VALUE: u32 = 80; +pub const HV_STATUS_OPERATION_FAILED: u32 = 113; +pub const HV_STATUS_CALL_PENDING: u32 = 121; pub const HV_LINUX_VENDOR_ID: u32 = 33024; pub const HV_HYP_PAGE_SHIFT: u32 = 12; +pub const HV_HYP_PAGE_SIZE: u32 = 4096; +pub const HV_HYP_PAGE_MASK: i32 = -4096; +pub const HV_HYP_LARGE_PAGE_SHIFT: u32 = 21; pub const HV_X64_MSR_GUEST_OS_ID: u32 = 1073741824; pub const HV_X64_MSR_HYPERCALL: u32 = 1073741825; pub const HV_X64_MSR_VP_INDEX: u32 = 1073741826; @@ -222,13 +250,80 @@ pub const HV_X64_MSR_CRASH_P2: u32 = 1073742082; pub const HV_X64_MSR_CRASH_P3: u32 = 1073742083; pub const HV_X64_MSR_CRASH_P4: u32 = 1073742084; pub const HV_X64_MSR_CRASH_CTL: u32 = 1073742085; +pub const HV_IPI_LOW_VECTOR: u32 = 16; +pub const HV_IPI_HIGH_VECTOR: u32 = 255; pub const HV_X64_MSR_REENLIGHTENMENT_CONTROL: u32 = 1073742086; pub const HV_X64_MSR_TSC_EMULATION_CONTROL: u32 = 1073742087; pub const HV_X64_MSR_TSC_EMULATION_STATUS: u32 = 1073742088; pub const HV_X64_MSR_TSC_INVARIANT_CONTROL: u32 = 1073742104; pub const HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS: u32 = 1073741824; +pub const HYPERV_CPUID_INTERFACE: u32 = 1073741825; pub const HYPERV_CPUID_VERSION: u32 = 1073741826; +pub const HYPERV_CPUID_FEATURES: u32 = 1073741827; +pub const HYPERV_CPUID_ENLIGHTMENT_INFO: u32 = 1073741828; +pub const HYPERV_CPUID_IMPLEMENT_LIMITS: u32 = 1073741829; +pub const HYPERV_CPUID_CPU_MANAGEMENT_FEATURES: u32 = 1073741831; +pub const HYPERV_CPUID_NESTED_FEATURES: u32 = 1073741834; +pub const HYPERV_CPUID_ISOLATION_CONFIG: u32 = 1073741836; +pub const HYPERV_CPUID_VIRT_STACK_INTERFACE: u32 = 1073741953; +pub const HYPERV_VS_INTERFACE_EAX_SIGNATURE: u32 = 824398678; +pub const HYPERV_CPUID_VIRT_STACK_PROPERTIES: u32 = 1073741954; +pub const HYPERV_VS_PROPERTIES_EAX_EXTENDED_IOAPIC_RTE: u32 = 4; +pub const HYPERV_HYPERVISOR_PRESENT_BIT: u32 = 2147483648; +pub const HYPERV_CPUID_MIN: u32 = 1073741829; +pub const HYPERV_CPUID_MAX: u32 = 1073807359; +pub const HV_MSR_VP_RUNTIME_AVAILABLE: u32 = 1; +pub const HV_MSR_TIME_REF_COUNT_AVAILABLE: u32 = 2; +pub const HV_MSR_SYNIC_AVAILABLE: u32 = 4; +pub const HV_MSR_SYNTIMER_AVAILABLE: u32 = 8; +pub const HV_MSR_APIC_ACCESS_AVAILABLE: u32 = 16; +pub const HV_MSR_HYPERCALL_AVAILABLE: u32 = 32; +pub const HV_MSR_VP_INDEX_AVAILABLE: u32 = 64; +pub const HV_MSR_RESET_AVAILABLE: u32 = 128; +pub const HV_MSR_STAT_PAGES_AVAILABLE: u32 = 256; +pub const HV_MSR_REFERENCE_TSC_AVAILABLE: u32 = 512; +pub const HV_MSR_GUEST_IDLE_AVAILABLE: u32 = 1024; +pub const HV_ACCESS_FREQUENCY_MSRS: u32 = 2048; +pub const HV_ACCESS_REENLIGHTENMENT: u32 = 8192; +pub const HV_ACCESS_TSC_INVARIANT: u32 = 32768; +pub const HV_CREATE_PARTITIONS: u32 = 1; +pub const HV_ACCESS_PARTITION_ID: u32 = 2; +pub const HV_ACCESS_MEMORY_POOL: u32 = 4; +pub const HV_ADJUST_MESSAGE_BUFFERS: u32 = 8; +pub const HV_POST_MESSAGES: u32 = 16; +pub const HV_SIGNAL_EVENTS: u32 = 32; +pub const HV_CREATE_PORT: u32 = 64; +pub const HV_CONNECT_PORT: u32 = 128; +pub const HV_ACCESS_STATS: u32 = 256; +pub const HV_DEBUGGING: u32 = 2048; +pub const HV_CPU_MANAGEMENT: u32 = 4096; +pub const HV_ENABLE_EXTENDED_HYPERCALLS: u32 = 1048576; +pub const HV_ISOLATION: u32 = 4194304; +pub const HV_X64_MWAIT_AVAILABLE: u32 = 1; +pub const HV_X64_GUEST_DEBUGGING_AVAILABLE: u32 = 2; +pub const HV_X64_PERF_MONITOR_AVAILABLE: u32 = 4; +pub const HV_X64_CPU_DYNAMIC_PARTITIONING_AVAILABLE: u32 = 8; +pub const HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE: u32 = 16; +pub const HV_X64_GUEST_IDLE_STATE_AVAILABLE: u32 = 32; +pub const HV_FEATURE_FREQUENCY_MSRS_AVAILABLE: u32 = 256; +pub const HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE: u32 = 1024; +pub const HV_FEATURE_DEBUG_MSRS_AVAILABLE: u32 = 2048; +pub const HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE: u32 = 32768; +pub const HV_STIMER_DIRECT_MODE_AVAILABLE: u32 = 524288; +pub const HV_DEVICE_DOMAIN_AVAILABLE: u32 = 16777216; +pub const HV_S1_DEVICE_DOMAIN_AVAILABLE: u32 = 33554432; +pub const HV_X64_AS_SWITCH_RECOMMENDED: u32 = 1; +pub const HV_X64_LOCAL_TLB_FLUSH_RECOMMENDED: u32 = 2; +pub const HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED: u32 = 4; +pub const HV_X64_APIC_ACCESS_RECOMMENDED: u32 = 8; +pub const HV_X64_SYSTEM_RESET_RECOMMENDED: u32 = 16; +pub const HV_X64_RELAXED_TIMING_RECOMMENDED: u32 = 32; pub const HV_DEPRECATING_AEOI_RECOMMENDED: u32 = 512; +pub const HV_X64_CLUSTER_IPI_RECOMMENDED: u32 = 1024; +pub const HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED: u32 = 2048; +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_MAXIMUM_PROCESSORS: u32 = 2048; pub const HV_MAX_VP_INDEX: u32 = 2047; pub const HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: u32 = 2; @@ -252,6 +347,7 @@ pub const HVCALL_MAP_GPA_PAGES: u32 = 75; pub const HVCALL_UNMAP_GPA_PAGES: u32 = 76; pub const HVCALL_INSTALL_INTERCEPT: u32 = 77; pub const HVCALL_CREATE_VP: u32 = 78; +pub const HVCALL_DELETE_VP: u32 = 79; pub const HVCALL_GET_VP_REGISTERS: u32 = 80; pub const HVCALL_SET_VP_REGISTERS: u32 = 81; pub const HVCALL_TRANSLATE_VIRTUAL_ADDRESS: u32 = 82; @@ -282,8 +378,10 @@ pub const HVCALL_GET_SYSTEM_PROPERTY: u32 = 123; pub const HVCALL_MAP_DEVICE_INTERRUPT: u32 = 124; pub const HVCALL_UNMAP_DEVICE_INTERRUPT: u32 = 125; pub const HVCALL_RETARGET_INTERRUPT: u32 = 126; -pub const HVCALL_NOTIFY_PARTITION_EVENT: u32 = 135; +pub const HVCALL_ATTACH_DEVICE: u32 = 130; +pub const HVCALL_DETACH_DEVICE: u32 = 131; pub const HVCALL_ENTER_SLEEP_STATE: u32 = 132; +pub const HVCALL_NOTIFY_PARTITION_EVENT: u32 = 135; pub const HVCALL_NOTIFY_PORT_RING_EMPTY: u32 = 139; pub const HVCALL_REGISTER_INTERCEPT_RESULT: u32 = 145; pub const HVCALL_ASSERT_VIRTUAL_INTERRUPT: u32 = 148; @@ -291,7 +389,6 @@ pub const HVCALL_CREATE_PORT: u32 = 149; pub const HVCALL_CONNECT_PORT: u32 = 150; pub const HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE: u32 = 175; pub const HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST: u32 = 176; -pub const HVCALL_GET_GPA_PAGES_ACCESS_STATES: u32 = 201; pub const HVCALL_CREATE_DEVICE_DOMAIN: u32 = 177; pub const HVCALL_ATTACH_DEVICE_DOMAIN: u32 = 178; pub const HVCALL_MAP_DEVICE_GPA_PAGES: u32 = 179; @@ -304,6 +401,7 @@ pub const HVCALL_DELETE_DEVICE_DOMAIN: u32 = 197; pub const HVCALL_QUERY_DEVICE_DOMAIN: u32 = 198; pub const HVCALL_MAP_SPARSE_DEVICE_GPA_PAGES: u32 = 199; pub const HVCALL_UNMAP_SPARSE_DEVICE_GPA_PAGES: u32 = 200; +pub const HVCALL_GET_GPA_PAGES_ACCESS_STATES: u32 = 201; pub const HVCALL_CONFIGURE_DEVICE_DOMAIN: u32 = 206; pub const HVCALL_FLUSH_DEVICE_DOMAIN: u32 = 208; pub const HVCALL_ACQUIRE_SPARSE_SPA_PAGE_HOST_ACCESS: u32 = 215; @@ -317,6 +415,14 @@ pub const HVCALL_COMPLETE_ISOLATED_IMPORT: u32 = 241; pub const HVCALL_ISSUE_SNP_PSP_GUEST_REQUEST: u32 = 242; pub const HVCALL_GET_VP_CPUID_VALUES: u32 = 244; pub const HVCALL_LOG_HYPERVISOR_SYSTEM_CONFIG: u32 = 248; +pub const HVCALL_DISABLE_HYP_EX: u32 = 271; +pub const HV_MAX_FLUSH_PAGES: u32 = 2048; +pub const HV_GPA_PAGE_RANGE_PAGE_SIZE_2MB: u32 = 0; +pub const HV_GPA_PAGE_RANGE_PAGE_SIZE_1GB: u32 = 1; +pub const HV_FLUSH_ALL_PROCESSORS: u32 = 1; +pub const HV_FLUSH_ALL_VIRTUAL_ADDRESS_SPACES: u32 = 2; +pub const HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY: u32 = 4; +pub const HV_FLUSH_USE_EXTENDED_RANGE_FORMAT: u32 = 8; pub const HV_SYNIC_SINT_COUNT: u32 = 16; pub const HV_SYNIC_INTERCEPTION_SINT_INDEX: u32 = 0; pub const HV_SYNIC_IOMMU_FAULT_SINT_INDEX: u32 = 1; @@ -330,28 +436,31 @@ pub const HV_SYNIC_STIMER_COUNT: u32 = 4; pub const HV_MESSAGE_SIZE: u32 = 256; pub const HV_MESSAGE_PAYLOAD_BYTE_COUNT: u32 = 240; pub const HV_MESSAGE_PAYLOAD_QWORD_COUNT: u32 = 30; -pub const HV_SYN_REG_VP_INDEX: u32 = 1073741826; -pub const HV_SYN_REG_TIME_REF_COUNT: u32 = 1073741856; -pub const HV_SYN_REG_REFERENCE_TSC: u32 = 1073741857; -pub const HV_SYN_REG_STIMER0_CONFIG: u32 = 1073742000; -pub const HV_SYN_REG_STIMER0_COUNT: u32 = 1073742001; -pub const HV_SYN_REG_SCONTROL: u32 = 1073741952; -pub const HV_SYN_REG_SIEFP: u32 = 1073741954; -pub const HV_SYN_REG_SIMP: u32 = 1073741955; -pub const HV_SYN_REG_SIRBP: u32 = 1073741957; -pub const HV_SYN_REG_EOM: u32 = 1073741956; -pub const HV_SYN_REG_SINT0: u32 = 1073741968; -pub const HV_SYN_REG_NESTED_SCONTROL: u32 = 1073746048; -pub const HV_SYN_REG_NESTED_SIEFP: u32 = 1073746050; -pub const HV_SYN_REG_NESTED_SIMP: u32 = 1073746051; -pub const HV_SYN_REG_NESTED_EOM: u32 = 1073746052; -pub const HV_SYN_REG_NESTED_SINT0: u32 = 1073746064; -pub const HV_SYN_REG_CRASH_P0: u32 = 1073742080; -pub const HV_SYN_REG_CRASH_P1: u32 = 1073742081; -pub const HV_SYN_REG_CRASH_P2: u32 = 1073742082; -pub const HV_SYN_REG_CRASH_P3: u32 = 1073742083; -pub const HV_SYN_REG_CRASH_P4: u32 = 1073742084; -pub const HV_SYN_REG_CRASH_CTL: u32 = 1073742085; +pub const HV_MSR_CRASH_P0: u32 = 1073742080; +pub const HV_MSR_CRASH_P1: u32 = 1073742081; +pub const HV_MSR_CRASH_P2: u32 = 1073742082; +pub const HV_MSR_CRASH_P3: u32 = 1073742083; +pub const HV_MSR_CRASH_P4: u32 = 1073742084; +pub const HV_MSR_CRASH_CTL: u32 = 1073742085; +pub const HV_MSR_VP_INDEX: u32 = 1073741826; +pub const HV_MSR_TIME_REF_COUNT: u32 = 1073741856; +pub const HV_MSR_REFERENCE_TSC: u32 = 1073741857; +pub const HV_MSR_SINT0: u32 = 1073741968; +pub const HV_MSR_SVERSION: u32 = 1073741953; +pub const HV_MSR_SCONTROL: u32 = 1073741952; +pub const HV_MSR_SIEFP: u32 = 1073741954; +pub const HV_MSR_SIMP: u32 = 1073741955; +pub const HV_MSR_EOM: u32 = 1073741956; +pub const HV_MSR_SIRBP: u32 = 1073741957; +pub const HV_MSR_NESTED_SCONTROL: u32 = 1073746048; +pub const HV_MSR_NESTED_SVERSION: u32 = 1073746049; +pub const HV_MSR_NESTED_SIEFP: u32 = 1073746050; +pub const HV_MSR_NESTED_SIMP: u32 = 1073746051; +pub const HV_MSR_NESTED_EOM: u32 = 1073746052; +pub const HV_MSR_NESTED_SINT0: u32 = 1073746064; +pub const HV_MSR_STIMER0_CONFIG: u32 = 1073742000; +pub const HV_MSR_STIMER0_COUNT: u32 = 1073742001; +pub const HV_UNMAP_GPA_LARGE_PAGE: u32 = 2; pub const HV_INTERCEPT_ACCESS_MASK_NONE: u32 = 0; pub const HV_INTERCEPT_ACCESS_MASK_READ: u32 = 1; pub const HV_INTERCEPT_ACCESS_MASK_WRITE: u32 = 2; @@ -370,6 +479,7 @@ pub const HV_DOORBELL_FLAG_TRIGGER_SIZE_QWORD: u32 = 4; pub const HV_DOORBELL_FLAG_TRIGGER_ANY_VALUE: u32 = 2147483648; pub const HV_GENERIC_SET_SHIFT: u32 = 6; pub const HV_GENERIC_SET_MASK: u32 = 63; +pub const HV_PFN_RNG_PAGEBITS: u32 = 24; pub const HV_MAP_GPA_PERMISSIONS_NONE: u32 = 0; pub const HV_MAP_GPA_READABLE: u32 = 1; pub const HV_MAP_GPA_WRITABLE: u32 = 2; @@ -379,6 +489,14 @@ pub const HV_MAP_GPA_EXECUTABLE: u32 = 12; pub const HV_MAP_GPA_PERMISSIONS_MASK: u32 = 15; pub const HV_MAP_GPA_ADJUSTABLE: u32 = 32768; pub const HV_MAP_GPA_NOT_CACHED: u32 = 2097152; +pub const HV_MAP_GPA_LARGE_PAGE: u32 = 2147483648; +pub const HV_SOURCE_SHADOW_NONE: u32 = 0; +pub const HV_SOURCE_SHADOW_BRIDGE_BUS_RANGE: u32 = 1; +pub const HV_DEVICE_DOMAIN_TYPE_S2: u32 = 0; +pub const HV_DEVICE_DOMAIN_TYPE_S1: u32 = 1; +pub const HV_DEVICE_DOMAIN_TYPE_SOC: u32 = 2; +pub const HV_DEVICE_DOMAIN_ID_S2_DEFAULT: u32 = 0; +pub const HV_DEVICE_DOMAIN_ID_S2_NULL: u32 = 4294967295; pub const HVHDK_H_VERSION: u32 = 25212; pub const HV_X64_REGISTER_CLASS_GENERAL: u32 = 0; pub const HV_X64_REGISTER_CLASS_IP: u32 = 1; @@ -410,8 +528,6 @@ pub const HV_TRANSLATE_GVA_USER_ACCESS: u32 = 128; pub const HV_TRANSLATE_GVA_ENFORCE_SMAP: u32 = 256; pub const HV_TRANSLATE_GVA_OVERRIDE_SMAP: u32 = 512; pub const HV_TRANSLATE_GVA_SHADOW_STACK: u32 = 1024; -pub const HV_EVENT_FLAGS_COUNT: u32 = 2048; -pub const HV_EVENT_FLAGS_BYTE_COUNT: u32 = 256; pub const HV_SYNIC_EVENT_RING_MESSAGE_COUNT: u32 = 63; pub const HV_HYPERCALL_INTERCEPT_MAX_XMM_REGISTERS: u32 = 6; pub const HV_UNSUPPORTED_FEATURE_INTERCEPT: u32 = 1; @@ -435,10 +551,7 @@ pub const HV_MODIFY_SPA_PAGE_HOST_ACCESS_LARGE_PAGE: u32 = 4; pub const HV_MODIFY_SPA_PAGE_HOST_ACCESS_HUGE_PAGE: u32 = 8; pub const HV_PSP_CPUID_LEAF_COUNT_MAX: u32 = 64; pub const HV_READ_WRITE_GPA_MAX_SIZE: u32 = 16; -pub const MSHV_CAP_CORE_API_STABLE: u32 = 0; -pub const MSHV_CAP_REGISTER_PAGE: u32 = 1; -pub const MSHV_CAP_VTL_RETURN_ACTION: u32 = 2; -pub const MSHV_CAP_DR6_SHARED: u32 = 3; +pub const MSHV_API_VERSION: u32 = 0; pub const MAX_RUN_MSG_SIZE: u32 = 256; pub const MSHV_VP_MAX_REGISTERS: u32 = 128; pub const MSHV_IRQFD_FLAG_DEASSIGN: u32 = 1; @@ -603,459 +716,368 @@ fn bindgen_test_layout_hv_u128() { ) ); } -pub const hv_status_HV_STATUS_SUCCESS: hv_status = 0; -pub const hv_status_HV_STATUS_INVALID_HYPERCALL_CODE: hv_status = 2; -pub const hv_status_HV_STATUS_INVALID_HYPERCALL_INPUT: hv_status = 3; -pub const hv_status_HV_STATUS_INVALID_ALIGNMENT: hv_status = 4; -pub const hv_status_HV_STATUS_INVALID_PARAMETER: hv_status = 5; -pub const hv_status_HV_STATUS_ACCESS_DENIED: hv_status = 6; -pub const hv_status_HV_STATUS_INVALID_PARTITION_STATE: hv_status = 7; -pub const hv_status_HV_STATUS_OPERATION_DENIED: hv_status = 8; -pub const hv_status_HV_STATUS_UNKNOWN_PROPERTY: hv_status = 9; -pub const hv_status_HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE: hv_status = 10; -pub const hv_status_HV_STATUS_INSUFFICIENT_MEMORY: hv_status = 11; -pub const hv_status_HV_STATUS_INVALID_PARTITION_ID: hv_status = 13; -pub const hv_status_HV_STATUS_INVALID_VP_INDEX: hv_status = 14; -pub const hv_status_HV_STATUS_NOT_FOUND: hv_status = 16; -pub const hv_status_HV_STATUS_INVALID_PORT_ID: hv_status = 17; -pub const hv_status_HV_STATUS_INVALID_CONNECTION_ID: hv_status = 18; -pub const hv_status_HV_STATUS_INSUFFICIENT_BUFFERS: hv_status = 19; -pub const hv_status_HV_STATUS_NOT_ACKNOWLEDGED: hv_status = 20; -pub const hv_status_HV_STATUS_INVALID_VP_STATE: hv_status = 21; -pub const hv_status_HV_STATUS_NO_RESOURCES: hv_status = 29; -pub const hv_status_HV_STATUS_PROCESSOR_FEATURE_NOT_SUPPORTED: hv_status = 32; -pub const hv_status_HV_STATUS_INVALID_LP_INDEX: hv_status = 65; -pub const hv_status_HV_STATUS_INVALID_REGISTER_VALUE: hv_status = 80; -pub const hv_status_HV_STATUS_OPERATION_FAILED: hv_status = 113; -pub const hv_status_HV_STATUS_CALL_PENDING: hv_status = 121; -pub type hv_status = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_hypervisor_version_info { - pub __bindgen_anon_1: hv_hypervisor_version_info__bindgen_ty_1, - pub __bindgen_anon_2: hv_hypervisor_version_info__bindgen_ty_2, -} -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_hypervisor_version_info__bindgen_ty_1 { - pub build_number: __u32, - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub service_pack: __u32, - pub _bitfield_align_2: [u32; 0], - pub _bitfield_2: __BindgenBitfieldUnit<[u8; 4usize]>, +pub struct hv_reenlightenment_control { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_hypervisor_version_info__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_reenlightenment_control() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_reenlightenment_control)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(hv_hypervisor_version_info__bindgen_ty_1) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_reenlightenment_control)) ); +} +impl hv_reenlightenment_control { + #[inline] + pub fn vector(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u64) } + } + #[inline] + pub fn set_vector(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn reserved1(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u64) } + } + #[inline] + pub fn set_reserved1(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn enabled(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } + } + #[inline] + pub fn set_enabled(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved2(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 15u8) as u64) } + } + #[inline] + pub fn set_reserved2(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 15u8, val as u64) + } + } + #[inline] + pub fn target_vp(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) } + } + #[inline] + pub fn set_target_vp(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 32u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + vector: __u64, + reserved1: __u64, + enabled: __u64, + reserved2: __u64, + target_vp: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let vector: u64 = unsafe { ::std::mem::transmute(vector) }; + vector as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let reserved1: u64 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; + enabled as u64 + }); + __bindgen_bitfield_unit.set(17usize, 15u8, { + let reserved2: u64 = unsafe { ::std::mem::transmute(reserved2) }; + reserved2 as u64 + }); + __bindgen_bitfield_unit.set(32usize, 32u8, { + let target_vp: u64 = unsafe { ::std::mem::transmute(target_vp) }; + target_vp as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_tsc_emulation_status { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_tsc_emulation_status() { assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).build_number) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_1), - "::", - stringify!(build_number) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_tsc_emulation_status)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).service_pack) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_1), - "::", - stringify!(service_pack) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_tsc_emulation_status)) ); } -impl hv_hypervisor_version_info__bindgen_ty_1 { +impl hv_tsc_emulation_status { #[inline] - pub fn minor_version(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u32) } + pub fn inprogress(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_minor_version(&mut self, val: __u32) { + pub fn set_inprogress(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 16u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn major_version(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } } #[inline] - pub fn set_major_version(&mut self, val: __u32) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) } } #[inline] pub fn new_bitfield_1( - minor_version: __u32, - major_version: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 16u8, { - let minor_version: u32 = unsafe { ::std::mem::transmute(minor_version) }; - minor_version as u64 + inprogress: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let inprogress: u64 = unsafe { ::std::mem::transmute(inprogress) }; + inprogress as u64 }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let major_version: u32 = unsafe { ::std::mem::transmute(major_version) }; - major_version as u64 + __bindgen_bitfield_unit.set(1usize, 63u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 }); __bindgen_bitfield_unit } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_tsc_emulation_control { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_tsc_emulation_control() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_tsc_emulation_control)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_tsc_emulation_control)) + ); +} +impl hv_tsc_emulation_control { #[inline] - pub fn service_number(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 24u8) as u32) } + pub fn enabled(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_service_number(&mut self, val: __u32) { + pub fn set_enabled(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_2.set(0usize, 24u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn service_branch(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_2.get(24usize, 8u8) as u32) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } } #[inline] - pub fn set_service_branch(&mut self, val: __u32) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_2.set(24usize, 8u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) } } #[inline] - pub fn new_bitfield_2( - service_number: __u32, - service_branch: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 24u8, { - let service_number: u32 = unsafe { ::std::mem::transmute(service_number) }; - service_number as u64 + pub fn new_bitfield_1(enabled: __u64, reserved: __u64) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; + enabled as u64 }); - __bindgen_bitfield_unit.set(24usize, 8u8, { - let service_branch: u32 = unsafe { ::std::mem::transmute(service_branch) }; - service_branch as u64 + __bindgen_bitfield_unit.set(1usize, 63u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 }); __bindgen_bitfield_unit } } -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_hypervisor_version_info__bindgen_ty_2 { - pub eax: __u32, - pub ebx: __u32, - pub ecx: __u32, - pub edx: __u32, +pub struct hv_get_partition_id { + pub partition_id: __u64, } #[test] -fn bindgen_test_layout_hv_hypervisor_version_info__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_get_partition_id() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_get_partition_id)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2) - ) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_get_partition_id)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2), - "::", - stringify!(eax) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2), - "::", - stringify!(ebx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2), - "::", - stringify!(ecx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hv_hypervisor_version_info__bindgen_ty_2), + stringify!(hv_get_partition_id), "::", - stringify!(edx) + stringify!(partition_id) ) ); } -#[test] -fn bindgen_test_layout_hv_hypervisor_version_info() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_hypervisor_version_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(hv_hypervisor_version_info)) - ); -} -impl Default for hv_hypervisor_version_info { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_FIXED: hv_interrupt_type = 0; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOWESTPRIORITY: hv_interrupt_type = 1; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_SMI: hv_interrupt_type = 2; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_REMOTEREAD: hv_interrupt_type = 3; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_NMI: hv_interrupt_type = 4; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_INIT: hv_interrupt_type = 5; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_SIPI: hv_interrupt_type = 6; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_EXTINT: hv_interrupt_type = 7; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOCALINT0: hv_interrupt_type = 8; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOCALINT1: hv_interrupt_type = 9; -pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_MAXIMUM: hv_interrupt_type = 10; -pub type hv_interrupt_type = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] -pub union hv_synic_sint { +pub union hv_reference_tsc_msr { pub as_uint64: __u64, - pub __bindgen_anon_1: hv_synic_sint__bindgen_ty_1, + pub __bindgen_anon_1: hv_reference_tsc_msr__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_synic_sint__bindgen_ty_1 { +pub struct hv_reference_tsc_msr__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_synic_sint__bindgen_ty_1() { +fn bindgen_test_layout_hv_reference_tsc_msr__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_synic_sint__bindgen_ty_1)) + concat!("Size of: ", stringify!(hv_reference_tsc_msr__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_synic_sint__bindgen_ty_1)) + concat!( + "Alignment of ", + stringify!(hv_reference_tsc_msr__bindgen_ty_1) + ) ); } -impl hv_synic_sint__bindgen_ty_1 { - #[inline] - pub fn vector(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u64) } - } - #[inline] - pub fn set_vector(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 8u8, val as u64) - } - } - #[inline] - pub fn reserved1(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u64) } - } - #[inline] - pub fn set_reserved1(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 8u8, val as u64) - } - } - #[inline] - pub fn masked(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } - } - #[inline] - pub fn set_masked(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 1u8, val as u64) - } - } - #[inline] - pub fn auto_eoi(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } - } - #[inline] - pub fn set_auto_eoi(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(17usize, 1u8, val as u64) - } - } - #[inline] - pub fn polling(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } - } - #[inline] - pub fn set_polling(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(18usize, 1u8, val as u64) - } - } +impl hv_reference_tsc_msr__bindgen_ty_1 { #[inline] - pub fn as_intercept(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + pub fn enable(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_as_intercept(&mut self, val: __u64) { + pub fn set_enable(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(19usize, 1u8, val as u64) + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn proxy(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_proxy(&mut self, val: __u64) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(20usize, 1u8, val as u64) + self._bitfield_1.set(1usize, 11u8, val as u64) } } #[inline] - pub fn reserved2(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 43u8) as u64) } + pub fn pfn(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } } #[inline] - pub fn set_reserved2(&mut self, val: __u64) { + pub fn set_pfn(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(21usize, 43u8, val as u64) + self._bitfield_1.set(12usize, 52u8, val as u64) } } #[inline] pub fn new_bitfield_1( - vector: __u64, - reserved1: __u64, - masked: __u64, - auto_eoi: __u64, - polling: __u64, - as_intercept: __u64, - proxy: __u64, - reserved2: __u64, + enable: __u64, + reserved: __u64, + pfn: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let vector: u64 = unsafe { ::std::mem::transmute(vector) }; - vector as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let reserved1: u64 = unsafe { ::std::mem::transmute(reserved1) }; - reserved1 as u64 - }); - __bindgen_bitfield_unit.set(16usize, 1u8, { - let masked: u64 = unsafe { ::std::mem::transmute(masked) }; - masked as u64 - }); - __bindgen_bitfield_unit.set(17usize, 1u8, { - let auto_eoi: u64 = unsafe { ::std::mem::transmute(auto_eoi) }; - auto_eoi as u64 - }); - __bindgen_bitfield_unit.set(18usize, 1u8, { - let polling: u64 = unsafe { ::std::mem::transmute(polling) }; - polling as u64 - }); - __bindgen_bitfield_unit.set(19usize, 1u8, { - let as_intercept: u64 = unsafe { ::std::mem::transmute(as_intercept) }; - as_intercept as u64 + __bindgen_bitfield_unit.set(0usize, 1u8, { + let enable: u64 = unsafe { ::std::mem::transmute(enable) }; + enable as u64 }); - __bindgen_bitfield_unit.set(20usize, 1u8, { - let proxy: u64 = unsafe { ::std::mem::transmute(proxy) }; - proxy as u64 + __bindgen_bitfield_unit.set(1usize, 11u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 }); - __bindgen_bitfield_unit.set(21usize, 43u8, { - let reserved2: u64 = unsafe { ::std::mem::transmute(reserved2) }; - reserved2 as u64 + __bindgen_bitfield_unit.set(12usize, 52u8, { + let pfn: u64 = unsafe { ::std::mem::transmute(pfn) }; + pfn as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_synic_sint() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_reference_tsc_msr() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_synic_sint)) + concat!("Size of: ", stringify!(hv_reference_tsc_msr)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_synic_sint)) + concat!("Alignment of ", stringify!(hv_reference_tsc_msr)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_synic_sint), + stringify!(hv_reference_tsc_msr), "::", stringify!(as_uint64) ) ); } -impl Default for hv_synic_sint { +impl Default for hv_reference_tsc_msr { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1064,377 +1086,413 @@ impl Default for hv_synic_sint { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_xsave_xfem_register { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_xsave_xfem_register__bindgen_ty_1, - pub __bindgen_anon_2: hv_x64_xsave_xfem_register__bindgen_ty_2, -} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_xsave_xfem_register__bindgen_ty_1 { - pub low_uint32: __u32, - pub high_uint32: __u32, +pub struct hv_vpset { + pub format: __u64, + pub valid_bank_mask: __u64, + pub bank_contents: __IncompleteArrayField<__u64>, } #[test] -fn bindgen_test_layout_hv_x64_xsave_xfem_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_vpset() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_vpset)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1) - ) + concat!("Alignment of ", stringify!(hv_vpset)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).low_uint32) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1), + stringify!(hv_vpset), "::", - stringify!(low_uint32) + stringify!(format) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).high_uint32) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).valid_bank_mask) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1), + stringify!(hv_vpset), "::", - stringify!(high_uint32) + stringify!(valid_bank_mask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bank_contents) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_vpset), + "::", + stringify!(bank_contents) ) ); } -#[repr(C, packed)] +impl Default for hv_vpset { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_hypervisor_version_info { + pub __bindgen_anon_1: hv_hypervisor_version_info__bindgen_ty_1, + pub __bindgen_anon_2: hv_hypervisor_version_info__bindgen_ty_2, +} +#[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_xsave_xfem_register__bindgen_ty_2 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +pub struct hv_hypervisor_version_info__bindgen_ty_1 { + pub build_number: __u32, + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub service_pack: __u32, + pub _bitfield_align_2: [u32; 0], + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 4usize]>, } #[test] -fn bindgen_test_layout_hv_x64_xsave_xfem_register__bindgen_ty_2() { +fn bindgen_test_layout_hv_hypervisor_version_info__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 16usize, concat!( "Size of: ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_2) + stringify!(hv_hypervisor_version_info__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + ::std::mem::align_of::(), + 4usize, concat!( "Alignment of ", - stringify!(hv_x64_xsave_xfem_register__bindgen_ty_2) + stringify!(hv_hypervisor_version_info__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).build_number) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_1), + "::", + stringify!(build_number) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).service_pack) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_1), + "::", + stringify!(service_pack) ) ); } -impl hv_x64_xsave_xfem_register__bindgen_ty_2 { +impl hv_hypervisor_version_info__bindgen_ty_1 { #[inline] - pub fn legacy_x87(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn minor_version(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u32) } } #[inline] - pub fn set_legacy_x87(&mut self, val: __u64) { + pub fn set_minor_version(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 16u8, val as u64) } } #[inline] - pub fn legacy_sse(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + pub fn major_version(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } } #[inline] - pub fn set_legacy_sse(&mut self, val: __u64) { + pub fn set_major_version(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) } } #[inline] - pub fn avx(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } - } - #[inline] - pub fn set_avx(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } + pub fn new_bitfield_1( + minor_version: __u32, + major_version: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 16u8, { + let minor_version: u32 = unsafe { ::std::mem::transmute(minor_version) }; + minor_version as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let major_version: u32 = unsafe { ::std::mem::transmute(major_version) }; + major_version as u64 + }); + __bindgen_bitfield_unit } #[inline] - pub fn mpx_bndreg(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + pub fn service_number(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(0usize, 24u8) as u32) } } #[inline] - pub fn set_mpx_bndreg(&mut self, val: __u64) { + pub fn set_service_number(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_2.set(0usize, 24u8, val as u64) } } #[inline] - pub fn mpx_bndcsr(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } + pub fn service_branch(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_2.get(24usize, 8u8) as u32) } } #[inline] - pub fn set_mpx_bndcsr(&mut self, val: __u64) { + pub fn set_service_branch(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_2.set(24usize, 8u8, val as u64) } } #[inline] - pub fn avx_512_op_mask(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + pub fn new_bitfield_2( + service_number: __u32, + service_branch: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let service_number: u32 = unsafe { ::std::mem::transmute(service_number) }; + service_number as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let service_branch: u32 = unsafe { ::std::mem::transmute(service_branch) }; + service_branch as u64 + }); + __bindgen_bitfield_unit } - #[inline] - pub fn set_avx_512_op_mask(&mut self, val: __u64) { +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_hypervisor_version_info__bindgen_ty_2 { + pub eax: __u32, + pub ebx: __u32, + pub ecx: __u32, + pub edx: __u32, +} +#[test] +fn bindgen_test_layout_hv_hypervisor_version_info__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2), + "::", + stringify!(eax) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2), + "::", + stringify!(ebx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2), + "::", + stringify!(ecx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hv_hypervisor_version_info__bindgen_ty_2), + "::", + stringify!(edx) + ) + ); +} +#[test] +fn bindgen_test_layout_hv_hypervisor_version_info() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_hypervisor_version_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hv_hypervisor_version_info)) + ); +} +impl Default for hv_hypervisor_version_info { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } +} +pub const hv_isolation_type_HV_ISOLATION_TYPE_NONE: hv_isolation_type = 0; +pub const hv_isolation_type_HV_ISOLATION_TYPE_VBS: hv_isolation_type = 1; +pub const hv_isolation_type_HV_ISOLATION_TYPE_SNP: hv_isolation_type = 2; +pub type hv_isolation_type = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_msr_hypercall_contents { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_x64_msr_hypercall_contents__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_msr_hypercall_contents__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_x64_msr_hypercall_contents__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_msr_hypercall_contents__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_msr_hypercall_contents__bindgen_ty_1) + ) + ); +} +impl hv_x64_msr_hypercall_contents__bindgen_ty_1 { #[inline] - pub fn avx_512_zmmhi(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } - } - #[inline] - pub fn set_avx_512_zmmhi(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn avx_512_zmm16_31(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } - } - #[inline] - pub fn set_avx_512_zmm16_31(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn rsvd8_9(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u64) } - } - #[inline] - pub fn set_rsvd8_9(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 2u8, val as u64) - } - } - #[inline] - pub fn pasid(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } - } - #[inline] - pub fn set_pasid(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 1u8, val as u64) - } - } - #[inline] - pub fn cet_u(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } - } - #[inline] - pub fn set_cet_u(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(11usize, 1u8, val as u64) - } - } - #[inline] - pub fn cet_s(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } - } - #[inline] - pub fn set_cet_s(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 1u8, val as u64) - } - } - #[inline] - pub fn rsvd13_16(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 4u8) as u64) } - } - #[inline] - pub fn set_rsvd13_16(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(13usize, 4u8, val as u64) - } - } - #[inline] - pub fn xtile_cfg(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + pub fn enable(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_xtile_cfg(&mut self, val: __u64) { + pub fn set_enable(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(17usize, 1u8, val as u64) + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn xtile_data(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_xtile_data(&mut self, val: __u64) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(18usize, 1u8, val as u64) + self._bitfield_1.set(1usize, 11u8, val as u64) } } #[inline] - pub fn rsvd19_63(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 45u8) as u64) } + pub fn guest_physical_address(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } } #[inline] - pub fn set_rsvd19_63(&mut self, val: __u64) { + pub fn set_guest_physical_address(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(19usize, 45u8, val as u64) + self._bitfield_1.set(12usize, 52u8, val as u64) } } #[inline] pub fn new_bitfield_1( - legacy_x87: __u64, - legacy_sse: __u64, - avx: __u64, - mpx_bndreg: __u64, - mpx_bndcsr: __u64, - avx_512_op_mask: __u64, - avx_512_zmmhi: __u64, - avx_512_zmm16_31: __u64, - rsvd8_9: __u64, - pasid: __u64, - cet_u: __u64, - cet_s: __u64, - rsvd13_16: __u64, - xtile_cfg: __u64, - xtile_data: __u64, - rsvd19_63: __u64, + enable: __u64, + reserved: __u64, + guest_physical_address: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let legacy_x87: u64 = unsafe { ::std::mem::transmute(legacy_x87) }; - legacy_x87 as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let legacy_sse: u64 = unsafe { ::std::mem::transmute(legacy_sse) }; - legacy_sse as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let avx: u64 = unsafe { ::std::mem::transmute(avx) }; - avx as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let mpx_bndreg: u64 = unsafe { ::std::mem::transmute(mpx_bndreg) }; - mpx_bndreg as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let mpx_bndcsr: u64 = unsafe { ::std::mem::transmute(mpx_bndcsr) }; - mpx_bndcsr as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let avx_512_op_mask: u64 = unsafe { ::std::mem::transmute(avx_512_op_mask) }; - avx_512_op_mask as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let avx_512_zmmhi: u64 = unsafe { ::std::mem::transmute(avx_512_zmmhi) }; - avx_512_zmmhi as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let avx_512_zmm16_31: u64 = unsafe { ::std::mem::transmute(avx_512_zmm16_31) }; - avx_512_zmm16_31 as u64 - }); - __bindgen_bitfield_unit.set(8usize, 2u8, { - let rsvd8_9: u64 = unsafe { ::std::mem::transmute(rsvd8_9) }; - rsvd8_9 as u64 - }); - __bindgen_bitfield_unit.set(10usize, 1u8, { - let pasid: u64 = unsafe { ::std::mem::transmute(pasid) }; - pasid as u64 - }); - __bindgen_bitfield_unit.set(11usize, 1u8, { - let cet_u: u64 = unsafe { ::std::mem::transmute(cet_u) }; - cet_u as u64 - }); - __bindgen_bitfield_unit.set(12usize, 1u8, { - let cet_s: u64 = unsafe { ::std::mem::transmute(cet_s) }; - cet_s as u64 - }); - __bindgen_bitfield_unit.set(13usize, 4u8, { - let rsvd13_16: u64 = unsafe { ::std::mem::transmute(rsvd13_16) }; - rsvd13_16 as u64 - }); - __bindgen_bitfield_unit.set(17usize, 1u8, { - let xtile_cfg: u64 = unsafe { ::std::mem::transmute(xtile_cfg) }; - xtile_cfg as u64 + let enable: u64 = unsafe { ::std::mem::transmute(enable) }; + enable as u64 }); - __bindgen_bitfield_unit.set(18usize, 1u8, { - let xtile_data: u64 = unsafe { ::std::mem::transmute(xtile_data) }; - xtile_data as u64 + __bindgen_bitfield_unit.set(1usize, 11u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 }); - __bindgen_bitfield_unit.set(19usize, 45u8, { - let rsvd19_63: u64 = unsafe { ::std::mem::transmute(rsvd19_63) }; - rsvd19_63 as u64 + __bindgen_bitfield_unit.set(12usize, 52u8, { + let guest_physical_address: u64 = + unsafe { ::std::mem::transmute(guest_physical_address) }; + guest_physical_address as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_x64_xsave_xfem_register() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_msr_hypercall_contents() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_x64_xsave_xfem_register)) + concat!("Size of: ", stringify!(hv_x64_msr_hypercall_contents)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_x64_xsave_xfem_register)) + concat!("Alignment of ", stringify!(hv_x64_msr_hypercall_contents)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_xsave_xfem_register), + stringify!(hv_x64_msr_hypercall_contents), "::", stringify!(as_uint64) ) ); } -impl Default for hv_x64_xsave_xfem_register { +impl Default for hv_x64_msr_hypercall_contents { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1445,102 +1503,118 @@ impl Default for hv_x64_xsave_xfem_register { } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_port_id { - pub asu32: __u32, - pub u: hv_port_id__bindgen_ty_1, +pub union hv_vp_assist_msr_contents { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_vp_assist_msr_contents__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_port_id__bindgen_ty_1 { +pub struct hv_vp_assist_msr_contents__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_port_id__bindgen_ty_1() { +fn bindgen_test_layout_hv_vp_assist_msr_contents__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_port_id__bindgen_ty_1)) + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_vp_assist_msr_contents__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_port_id__bindgen_ty_1)) + concat!( + "Alignment of ", + stringify!(hv_vp_assist_msr_contents__bindgen_ty_1) + ) ); } -impl hv_port_id__bindgen_ty_1 { +impl hv_vp_assist_msr_contents__bindgen_ty_1 { #[inline] - pub fn id(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + pub fn enable(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_id(&mut self, val: __u32) { + pub fn set_enable(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 24u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_reserved(&mut self, val: __u32) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(24usize, 8u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 11u8, val as u64) } } #[inline] - pub fn new_bitfield_1(id: __u32, reserved: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 24u8, { - let id: u32 = unsafe { ::std::mem::transmute(id) }; - id as u64 - }); - __bindgen_bitfield_unit.set(24usize, 8u8, { - let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + pub fn pfn(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } + } + #[inline] + pub fn set_pfn(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 52u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + enable: __u64, + reserved: __u64, + pfn: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let enable: u64 = unsafe { ::std::mem::transmute(enable) }; + enable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 11u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; reserved as u64 }); + __bindgen_bitfield_unit.set(12usize, 52u8, { + let pfn: u64 = unsafe { ::std::mem::transmute(pfn) }; + pfn as u64 + }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_port_id() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_vp_assist_msr_contents() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_port_id)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(hv_port_id)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_vp_assist_msr_contents)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).asu32) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_port_id), - "::", - stringify!(asu32) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_vp_assist_msr_contents)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_port_id), + stringify!(hv_vp_assist_msr_contents), "::", - stringify!(u) + stringify!(as_uint64) ) ); } -impl Default for hv_port_id { +impl Default for hv_vp_assist_msr_contents { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1549,90 +1623,103 @@ impl Default for hv_port_id { } } } -pub const hv_message_type_HVMSG_NONE: hv_message_type = 0; -pub const hv_message_type_HVMSG_UNMAPPED_GPA: hv_message_type = 2147483648; -pub const hv_message_type_HVMSG_GPA_INTERCEPT: hv_message_type = 2147483649; -pub const hv_message_type_HVMSG_UNACCEPTED_GPA: hv_message_type = 2147483651; -pub const hv_message_type_HVMSG_GPA_ATTRIBUTE_INTERCEPT: hv_message_type = 2147483652; -pub const hv_message_type_HVMSG_TIMER_EXPIRED: hv_message_type = 2147483664; -pub const hv_message_type_HVMSG_INVALID_VP_REGISTER_VALUE: hv_message_type = 2147483680; -pub const hv_message_type_HVMSG_UNRECOVERABLE_EXCEPTION: hv_message_type = 2147483681; -pub const hv_message_type_HVMSG_UNSUPPORTED_FEATURE: hv_message_type = 2147483682; -pub const hv_message_type_HVMSG_OPAQUE_INTERCEPT: hv_message_type = 2147483711; -pub const hv_message_type_HVMSG_EVENTLOG_BUFFERCOMPLETE: hv_message_type = 2147483712; -pub const hv_message_type_HVMSG_HYPERCALL_INTERCEPT: hv_message_type = 2147483728; -pub const hv_message_type_HVMSG_SYNIC_EVENT_INTERCEPT: hv_message_type = 2147483744; -pub const hv_message_type_HVMSG_SYNIC_SINT_INTERCEPT: hv_message_type = 2147483745; -pub const hv_message_type_HVMSG_SYNIC_SINT_DELIVERABLE: hv_message_type = 2147483746; -pub const hv_message_type_HVMSG_ASYNC_CALL_COMPLETION: hv_message_type = 2147483760; -pub const hv_message_type_HVMSG_SCHEDULER_VP_SIGNAL_BITSET: hv_message_type = 2147483904; -pub const hv_message_type_HVMSG_SCHEDULER_VP_SIGNAL_PAIR: hv_message_type = 2147483905; -pub const hv_message_type_HVMSG_X64_IO_PORT_INTERCEPT: hv_message_type = 2147549184; -pub const hv_message_type_HVMSG_X64_MSR_INTERCEPT: hv_message_type = 2147549185; -pub const hv_message_type_HVMSG_X64_CPUID_INTERCEPT: hv_message_type = 2147549186; -pub const hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT: hv_message_type = 2147549187; -pub const hv_message_type_HVMSG_X64_APIC_EOI: hv_message_type = 2147549188; -pub const hv_message_type_HVMSG_X64_LEGACY_FP_ERROR: hv_message_type = 2147549189; -pub const hv_message_type_HVMSG_X64_IOMMU_PRQ: hv_message_type = 2147549190; -pub const hv_message_type_HVMSG_X64_HALT: hv_message_type = 2147549191; -pub const hv_message_type_HVMSG_X64_INTERRUPTION_DELIVERABLE: hv_message_type = 2147549192; -pub const hv_message_type_HVMSG_X64_SIPI_INTERCEPT: hv_message_type = 2147549193; -pub const hv_message_type_HVMSG_X64_SEV_VMGEXIT_INTERCEPT: hv_message_type = 2147549203; -pub type hv_message_type = ::std::os::raw::c_uint; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_guest_mapping_flush { + pub address_space: __u64, + pub flags: __u64, +} +#[test] +fn bindgen_test_layout_hv_guest_mapping_flush() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_guest_mapping_flush)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_guest_mapping_flush)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).address_space) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_guest_mapping_flush), + "::", + stringify!(address_space) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_guest_mapping_flush), + "::", + stringify!(flags) + ) + ); +} #[repr(C)] #[derive(Copy, Clone)] -pub union hv_synic_simp { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_synic_simp__bindgen_ty_1, +pub union hv_gpa_page_range { + pub address_space: __u64, + pub page: hv_gpa_page_range__bindgen_ty_1, + pub __bindgen_anon_1: hv_gpa_page_range__bindgen_ty_2, } -#[repr(C, packed)] +#[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_synic_simp__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], +pub struct hv_gpa_page_range__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_synic_simp__bindgen_ty_1() { +fn bindgen_test_layout_hv_gpa_page_range__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_synic_simp__bindgen_ty_1)) + concat!("Size of: ", stringify!(hv_gpa_page_range__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_synic_simp__bindgen_ty_1)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_gpa_page_range__bindgen_ty_1)) ); } -impl hv_synic_simp__bindgen_ty_1 { +impl hv_gpa_page_range__bindgen_ty_1 { #[inline] - pub fn simp_enabled(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn additional_pages(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 11u8) as u64) } } #[inline] - pub fn set_simp_enabled(&mut self, val: __u64) { + pub fn set_additional_pages(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) + self._bitfield_1.set(0usize, 11u8, val as u64) } } #[inline] - pub fn preserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } + pub fn largepage(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } } #[inline] - pub fn set_preserved(&mut self, val: __u64) { + pub fn set_largepage(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 11u8, val as u64) + self._bitfield_1.set(11usize, 1u8, val as u64) } } #[inline] - pub fn base_simp_gpa(&self) -> __u64 { + pub fn basepfn(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } } #[inline] - pub fn set_base_simp_gpa(&mut self, val: __u64) { + pub fn set_basepfn(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(12usize, 52u8, val as u64) @@ -1640,211 +1727,153 @@ impl hv_synic_simp__bindgen_ty_1 { } #[inline] pub fn new_bitfield_1( - simp_enabled: __u64, - preserved: __u64, - base_simp_gpa: __u64, + additional_pages: __u64, + largepage: __u64, + basepfn: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let simp_enabled: u64 = unsafe { ::std::mem::transmute(simp_enabled) }; - simp_enabled as u64 + __bindgen_bitfield_unit.set(0usize, 11u8, { + let additional_pages: u64 = unsafe { ::std::mem::transmute(additional_pages) }; + additional_pages as u64 }); - __bindgen_bitfield_unit.set(1usize, 11u8, { - let preserved: u64 = unsafe { ::std::mem::transmute(preserved) }; - preserved as u64 + __bindgen_bitfield_unit.set(11usize, 1u8, { + let largepage: u64 = unsafe { ::std::mem::transmute(largepage) }; + largepage as u64 }); __bindgen_bitfield_unit.set(12usize, 52u8, { - let base_simp_gpa: u64 = unsafe { ::std::mem::transmute(base_simp_gpa) }; - base_simp_gpa as u64 + let basepfn: u64 = unsafe { ::std::mem::transmute(basepfn) }; + basepfn as u64 }); __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_hv_synic_simp() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_synic_simp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_synic_simp)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_synic_simp), - "::", - stringify!(as_uint64) - ) - ); -} -impl Default for hv_synic_simp { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[repr(C)] -#[derive(Copy, Clone)] -pub union hv_message_flags { - pub asu8: __u8, - pub __bindgen_anon_1: hv_message_flags__bindgen_ty_1, -} -#[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_message_flags__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +pub struct hv_gpa_page_range__bindgen_ty_2 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_message_flags__bindgen_ty_1() { +fn bindgen_test_layout_hv_gpa_page_range__bindgen_ty_2() { assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(hv_message_flags__bindgen_ty_1)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_gpa_page_range__bindgen_ty_2)) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_message_flags__bindgen_ty_1)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_gpa_page_range__bindgen_ty_2)) ); } -impl hv_message_flags__bindgen_ty_1 { +impl hv_gpa_page_range__bindgen_ty_2 { #[inline] - pub fn msg_pending(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 12u8) as u64) } } #[inline] - pub fn set_msg_pending(&mut self, val: __u8) { + pub fn set_reserved(&mut self, val: __u64) { unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 12u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + pub fn page_size(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } } #[inline] - pub fn set_reserved(&mut self, val: __u8) { + pub fn set_page_size(&mut self, val: __u64) { unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 7u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved1(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 8u8) as u64) } + } + #[inline] + pub fn set_reserved1(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 8u8, val as u64) + } + } + #[inline] + pub fn base_large_pfn(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 43u8) as u64) } + } + #[inline] + pub fn set_base_large_pfn(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 43u8, val as u64) } } #[inline] pub fn new_bitfield_1( - msg_pending: __u8, - reserved: __u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let msg_pending: u8 = unsafe { ::std::mem::transmute(msg_pending) }; - msg_pending as u64 - }); - __bindgen_bitfield_unit.set(1usize, 7u8, { - let reserved: u8 = unsafe { ::std::mem::transmute(reserved) }; + reserved: __u64, + page_size: __u64, + reserved1: __u64, + base_large_pfn: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 12u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; reserved as u64 }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let page_size: u64 = unsafe { ::std::mem::transmute(page_size) }; + page_size as u64 + }); + __bindgen_bitfield_unit.set(13usize, 8u8, { + let reserved1: u64 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit.set(21usize, 43u8, { + let base_large_pfn: u64 = unsafe { ::std::mem::transmute(base_large_pfn) }; + base_large_pfn as u64 + }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_message_flags() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(hv_message_flags)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_message_flags)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).asu8) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_message_flags), - "::", - stringify!(asu8) - ) - ); -} -impl Default for hv_message_flags { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_message_header { - pub message_type: __u32, - pub payload_size: __u8, - pub message_flags: hv_message_flags, - pub reserved: [__u8; 2usize], - pub __bindgen_anon_1: hv_message_header__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_message_header__bindgen_ty_1 { - pub sender: __u64, - pub port: hv_port_id, -} -#[test] -fn bindgen_test_layout_hv_message_header__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_gpa_page_range() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_message_header__bindgen_ty_1)) + concat!("Size of: ", stringify!(hv_gpa_page_range)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_message_header__bindgen_ty_1)) + concat!("Alignment of ", stringify!(hv_gpa_page_range)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sender) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).address_space) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_message_header__bindgen_ty_1), + stringify!(hv_gpa_page_range), "::", - stringify!(sender) + stringify!(address_space) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).page) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_message_header__bindgen_ty_1), + stringify!(hv_gpa_page_range), "::", - stringify!(port) + stringify!(page) ) ); } -impl Default for hv_message_header__bindgen_ty_1 { +impl Default for hv_gpa_page_range { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1853,139 +1882,205 @@ impl Default for hv_message_header__bindgen_ty_1 { } } } -#[test] -fn bindgen_test_layout_hv_message_header() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_message_header)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_message_header)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).message_type) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_message_header), - "::", - stringify!(message_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).payload_size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_message_header), - "::", - stringify!(payload_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).message_flags) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(hv_message_header), - "::", - stringify!(message_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(hv_message_header), - "::", - stringify!(reserved) - ) - ); -} -impl Default for hv_message_header { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_FIXED: hv_interrupt_type = 0; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOWESTPRIORITY: hv_interrupt_type = 1; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_SMI: hv_interrupt_type = 2; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_REMOTEREAD: hv_interrupt_type = 3; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_NMI: hv_interrupt_type = 4; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_INIT: hv_interrupt_type = 5; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_SIPI: hv_interrupt_type = 6; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_EXTINT: hv_interrupt_type = 7; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOCALINT0: hv_interrupt_type = 8; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_LOCALINT1: hv_interrupt_type = 9; +pub const hv_interrupt_type_HV_X64_INTERRUPT_TYPE_MAXIMUM: hv_interrupt_type = 10; +pub type hv_interrupt_type = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_synic_sint { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_synic_sint__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_notification_message_payload { - pub sint_index: __u32, +pub struct hv_synic_sint__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_notification_message_payload() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_synic_sint__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_notification_message_payload)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_synic_sint__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_notification_message_payload)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sint_index) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_notification_message_payload), - "::", - stringify!(sint_index) - ) + concat!("Alignment of ", stringify!(hv_synic_sint__bindgen_ty_1)) ); } -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_message { - pub header: hv_message_header, - pub u: hv_message__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_message__bindgen_ty_1 { - pub payload: [__u64; 30usize], +impl hv_synic_sint__bindgen_ty_1 { + #[inline] + pub fn vector(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u64) } + } + #[inline] + pub fn set_vector(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn reserved1(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u64) } + } + #[inline] + pub fn set_reserved1(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn masked(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } + } + #[inline] + pub fn set_masked(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub fn auto_eoi(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + } + #[inline] + pub fn set_auto_eoi(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub fn polling(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + } + #[inline] + pub fn set_polling(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub fn as_intercept(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + } + #[inline] + pub fn set_as_intercept(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub fn proxy(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + } + #[inline] + pub fn set_proxy(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved2(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 43u8) as u64) } + } + #[inline] + pub fn set_reserved2(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 43u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + vector: __u64, + reserved1: __u64, + masked: __u64, + auto_eoi: __u64, + polling: __u64, + as_intercept: __u64, + proxy: __u64, + reserved2: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let vector: u64 = unsafe { ::std::mem::transmute(vector) }; + vector as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let reserved1: u64 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let masked: u64 = unsafe { ::std::mem::transmute(masked) }; + masked as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let auto_eoi: u64 = unsafe { ::std::mem::transmute(auto_eoi) }; + auto_eoi as u64 + }); + __bindgen_bitfield_unit.set(18usize, 1u8, { + let polling: u64 = unsafe { ::std::mem::transmute(polling) }; + polling as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let as_intercept: u64 = unsafe { ::std::mem::transmute(as_intercept) }; + as_intercept as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let proxy: u64 = unsafe { ::std::mem::transmute(proxy) }; + proxy as u64 + }); + __bindgen_bitfield_unit.set(21usize, 43u8, { + let reserved2: u64 = unsafe { ::std::mem::transmute(reserved2) }; + reserved2 as u64 + }); + __bindgen_bitfield_unit + } } #[test] -fn bindgen_test_layout_hv_message__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_synic_sint() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 240usize, - concat!("Size of: ", stringify!(hv_message__bindgen_ty_1)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_synic_sint)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_message__bindgen_ty_1)) + concat!("Alignment of ", stringify!(hv_synic_sint)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).payload) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_message__bindgen_ty_1), + stringify!(hv_synic_sint), "::", - stringify!(payload) + stringify!(as_uint64) ) ); } -impl Default for hv_message__bindgen_ty_1 { +impl Default for hv_synic_sint { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1994,314 +2089,377 @@ impl Default for hv_message__bindgen_ty_1 { } } } +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_xsave_xfem_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_x64_xsave_xfem_register__bindgen_ty_1, + pub __bindgen_anon_2: hv_x64_xsave_xfem_register__bindgen_ty_2, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_xsave_xfem_register__bindgen_ty_1 { + pub low_uint32: __u32, + pub high_uint32: __u32, +} #[test] -fn bindgen_test_layout_hv_message() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_x64_xsave_xfem_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 256usize, - concat!("Size of: ", stringify!(hv_message)) + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_message)) + concat!( + "Alignment of ", + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).low_uint32) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_message), + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1), "::", - stringify!(header) + stringify!(low_uint32) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).high_uint32) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_message), + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_1), "::", - stringify!(u) + stringify!(high_uint32) ) ); } -impl Default for hv_message { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_message_page { - pub sint_message: [hv_message; 16usize], +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_xsave_xfem_register__bindgen_ty_2 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_message_page() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_x64_xsave_xfem_register__bindgen_ty_2() { assert_eq!( - ::std::mem::size_of::(), - 4096usize, - concat!("Size of: ", stringify!(hv_message_page)) + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_2) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_message_page)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sint_message) as usize - ptr as usize }, - 0usize, concat!( - "Offset of field: ", - stringify!(hv_message_page), - "::", - stringify!(sint_message) + "Alignment of ", + stringify!(hv_x64_xsave_xfem_register__bindgen_ty_2) ) ); } -impl Default for hv_message_page { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_x64_segment_register { - pub base: __u64, - pub limit: __u32, - pub selector: __u16, - pub __bindgen_anon_1: hv_x64_segment_register__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_segment_register__bindgen_ty_1 { - pub __bindgen_anon_1: hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1, - pub attributes: __u16, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[test] -fn bindgen_test_layout_hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!( - "Size of: ", - stringify!(hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1) - ) - ); -} -impl hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1 { +impl hv_x64_xsave_xfem_register__bindgen_ty_2 { #[inline] - pub fn segment_type(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) } + pub fn legacy_x87(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_segment_type(&mut self, val: __u16) { + pub fn set_legacy_x87(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn non_system_segment(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } + pub fn legacy_sse(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } } #[inline] - pub fn set_non_system_segment(&mut self, val: __u16) { + pub fn set_legacy_sse(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn avx(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_avx(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn mpx_bndreg(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_mpx_bndreg(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn mpx_bndcsr(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } + } + #[inline] + pub fn set_mpx_bndcsr(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn descriptor_privilege_level(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 2u8) as u16) } + pub fn avx_512_op_mask(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } } #[inline] - pub fn set_descriptor_privilege_level(&mut self, val: __u16) { + pub fn set_avx_512_op_mask(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 2u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) } } #[inline] - pub fn present(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } + pub fn avx_512_zmmhi(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } } #[inline] - pub fn set_present(&mut self, val: __u16) { + pub fn set_avx_512_zmmhi(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub fn avx_512_zmm16_31(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + } + #[inline] + pub fn set_avx_512_zmm16_31(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(7usize, 1u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u16) } + pub fn rsvd8_9(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u64) } } #[inline] - pub fn set_reserved(&mut self, val: __u16) { + pub fn set_rsvd8_9(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 4u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 2u8, val as u64) } } #[inline] - pub fn available(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) } + pub fn pasid(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } } #[inline] - pub fn set_available(&mut self, val: __u16) { + pub fn set_pasid(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub fn cet_u(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + } + #[inline] + pub fn set_cet_u(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn cet_s(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_cet_s(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(12usize, 1u8, val as u64) } } #[inline] - pub fn _long(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) } + pub fn rsvd13_16(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 4u8) as u64) } } #[inline] - pub fn set__long(&mut self, val: __u16) { + pub fn set_rsvd13_16(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(13usize, 1u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 4u8, val as u64) } } #[inline] - pub fn _default(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) } + pub fn xtile_cfg(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } } #[inline] - pub fn set__default(&mut self, val: __u16) { + pub fn set_xtile_cfg(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(14usize, 1u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) } } #[inline] - pub fn granularity(&self) -> __u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) } + pub fn xtile_data(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } } #[inline] - pub fn set_granularity(&mut self, val: __u16) { + pub fn set_xtile_data(&mut self, val: __u64) { unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(15usize, 1u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub fn rsvd19_63(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 45u8) as u64) } + } + #[inline] + pub fn set_rsvd19_63(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 45u8, val as u64) } } #[inline] pub fn new_bitfield_1( - segment_type: __u16, - non_system_segment: __u16, - descriptor_privilege_level: __u16, - present: __u16, - reserved: __u16, - available: __u16, - _long: __u16, - _default: __u16, - granularity: __u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 4u8, { - let segment_type: u16 = unsafe { ::std::mem::transmute(segment_type) }; - segment_type as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let non_system_segment: u16 = unsafe { ::std::mem::transmute(non_system_segment) }; - non_system_segment as u64 + legacy_x87: __u64, + legacy_sse: __u64, + avx: __u64, + mpx_bndreg: __u64, + mpx_bndcsr: __u64, + avx_512_op_mask: __u64, + avx_512_zmmhi: __u64, + avx_512_zmm16_31: __u64, + rsvd8_9: __u64, + pasid: __u64, + cet_u: __u64, + cet_s: __u64, + rsvd13_16: __u64, + xtile_cfg: __u64, + xtile_data: __u64, + rsvd19_63: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let legacy_x87: u64 = unsafe { ::std::mem::transmute(legacy_x87) }; + legacy_x87 as u64 }); - __bindgen_bitfield_unit.set(5usize, 2u8, { - let descriptor_privilege_level: u16 = - unsafe { ::std::mem::transmute(descriptor_privilege_level) }; - descriptor_privilege_level as u64 + __bindgen_bitfield_unit.set(1usize, 1u8, { + let legacy_sse: u64 = unsafe { ::std::mem::transmute(legacy_sse) }; + legacy_sse as u64 }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let present: u16 = unsafe { ::std::mem::transmute(present) }; - present as u64 + __bindgen_bitfield_unit.set(2usize, 1u8, { + let avx: u64 = unsafe { ::std::mem::transmute(avx) }; + avx as u64 }); - __bindgen_bitfield_unit.set(8usize, 4u8, { - let reserved: u16 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 + __bindgen_bitfield_unit.set(3usize, 1u8, { + let mpx_bndreg: u64 = unsafe { ::std::mem::transmute(mpx_bndreg) }; + mpx_bndreg as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let mpx_bndcsr: u64 = unsafe { ::std::mem::transmute(mpx_bndcsr) }; + mpx_bndcsr as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let avx_512_op_mask: u64 = unsafe { ::std::mem::transmute(avx_512_op_mask) }; + avx_512_op_mask as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let avx_512_zmmhi: u64 = unsafe { ::std::mem::transmute(avx_512_zmmhi) }; + avx_512_zmmhi as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let avx_512_zmm16_31: u64 = unsafe { ::std::mem::transmute(avx_512_zmm16_31) }; + avx_512_zmm16_31 as u64 + }); + __bindgen_bitfield_unit.set(8usize, 2u8, { + let rsvd8_9: u64 = unsafe { ::std::mem::transmute(rsvd8_9) }; + rsvd8_9 as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let pasid: u64 = unsafe { ::std::mem::transmute(pasid) }; + pasid as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let cet_u: u64 = unsafe { ::std::mem::transmute(cet_u) }; + cet_u as u64 }); __bindgen_bitfield_unit.set(12usize, 1u8, { - let available: u16 = unsafe { ::std::mem::transmute(available) }; - available as u64 + let cet_s: u64 = unsafe { ::std::mem::transmute(cet_s) }; + cet_s as u64 }); - __bindgen_bitfield_unit.set(13usize, 1u8, { - let _long: u16 = unsafe { ::std::mem::transmute(_long) }; - _long as u64 + __bindgen_bitfield_unit.set(13usize, 4u8, { + let rsvd13_16: u64 = unsafe { ::std::mem::transmute(rsvd13_16) }; + rsvd13_16 as u64 }); - __bindgen_bitfield_unit.set(14usize, 1u8, { - let _default: u16 = unsafe { ::std::mem::transmute(_default) }; - _default as u64 + __bindgen_bitfield_unit.set(17usize, 1u8, { + let xtile_cfg: u64 = unsafe { ::std::mem::transmute(xtile_cfg) }; + xtile_cfg as u64 }); - __bindgen_bitfield_unit.set(15usize, 1u8, { - let granularity: u16 = unsafe { ::std::mem::transmute(granularity) }; - granularity as u64 + __bindgen_bitfield_unit.set(18usize, 1u8, { + let xtile_data: u64 = unsafe { ::std::mem::transmute(xtile_data) }; + xtile_data as u64 + }); + __bindgen_bitfield_unit.set(19usize, 45u8, { + let rsvd19_63: u64 = unsafe { ::std::mem::transmute(rsvd19_63) }; + rsvd19_63 as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_x64_segment_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_xsave_xfem_register() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!( - "Size of: ", - stringify!(hv_x64_segment_register__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_x64_xsave_xfem_register)) ); assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!( - "Alignment of ", - stringify!(hv_x64_segment_register__bindgen_ty_1) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_x64_xsave_xfem_register)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_segment_register__bindgen_ty_1), + stringify!(hv_x64_xsave_xfem_register), "::", - stringify!(attributes) + stringify!(as_uint64) ) ); } -impl Default for hv_x64_segment_register__bindgen_ty_1 { +impl Default for hv_x64_xsave_xfem_register { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2310,53 +2468,209 @@ impl Default for hv_x64_segment_register__bindgen_ty_1 { } } } +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_stimer_config { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_stimer_config__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_stimer_config__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} #[test] -fn bindgen_test_layout_hv_x64_segment_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_stimer_config__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_segment_register)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_stimer_config__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_x64_segment_register)) + concat!("Alignment of ", stringify!(hv_stimer_config__bindgen_ty_1)) ); +} +impl hv_stimer_config__bindgen_ty_1 { + #[inline] + pub fn enable(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_enable(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn periodic(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_periodic(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn lazy(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_lazy(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn auto_enable(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_auto_enable(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn apic_vector(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 8u8) as u64) } + } + #[inline] + pub fn set_apic_vector(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 8u8, val as u64) + } + } + #[inline] + pub fn direct_mode(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_direct_mode(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved_z0(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u64) } + } + #[inline] + pub fn set_reserved_z0(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 3u8, val as u64) + } + } + #[inline] + pub fn sintx(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u64) } + } + #[inline] + pub fn set_sintx(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 4u8, val as u64) + } + } + #[inline] + pub fn reserved_z1(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 44u8) as u64) } + } + #[inline] + pub fn set_reserved_z1(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 44u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + enable: __u64, + periodic: __u64, + lazy: __u64, + auto_enable: __u64, + apic_vector: __u64, + direct_mode: __u64, + reserved_z0: __u64, + sintx: __u64, + reserved_z1: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let enable: u64 = unsafe { ::std::mem::transmute(enable) }; + enable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let periodic: u64 = unsafe { ::std::mem::transmute(periodic) }; + periodic as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let lazy: u64 = unsafe { ::std::mem::transmute(lazy) }; + lazy as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let auto_enable: u64 = unsafe { ::std::mem::transmute(auto_enable) }; + auto_enable as u64 + }); + __bindgen_bitfield_unit.set(4usize, 8u8, { + let apic_vector: u64 = unsafe { ::std::mem::transmute(apic_vector) }; + apic_vector as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let direct_mode: u64 = unsafe { ::std::mem::transmute(direct_mode) }; + direct_mode as u64 + }); + __bindgen_bitfield_unit.set(13usize, 3u8, { + let reserved_z0: u64 = unsafe { ::std::mem::transmute(reserved_z0) }; + reserved_z0 as u64 + }); + __bindgen_bitfield_unit.set(16usize, 4u8, { + let sintx: u64 = unsafe { ::std::mem::transmute(sintx) }; + sintx as u64 + }); + __bindgen_bitfield_unit.set(20usize, 44u8, { + let reserved_z1: u64 = unsafe { ::std::mem::transmute(reserved_z1) }; + reserved_z1 as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_stimer_config() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_segment_register), - "::", - stringify!(base) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_stimer_config)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + ::std::mem::align_of::(), 8usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_segment_register), - "::", - stringify!(limit) - ) + concat!("Alignment of ", stringify!(hv_stimer_config)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selector) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_segment_register), + stringify!(hv_stimer_config), "::", - stringify!(selector) + stringify!(as_uint64) ) ); } -impl Default for hv_x64_segment_register { +impl Default for hv_stimer_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2365,181 +2679,104 @@ impl Default for hv_x64_segment_register { } } } +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_port_id { + pub as__u32: __u32, + pub u: hv_port_id__bindgen_ty_1, +} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_table_register { - pub pad: [__u16; 3usize], - pub limit: __u16, - pub base: __u64, +pub struct hv_port_id__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } #[test] -fn bindgen_test_layout_hv_x64_table_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_port_id__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_table_register)) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_port_id__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_x64_table_register)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_table_register), - "::", - stringify!(pad) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_table_register), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_table_register), - "::", - stringify!(base) - ) + concat!("Alignment of ", stringify!(hv_port_id__bindgen_ty_1)) ); } -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub union hv_x64_fp_control_status_register { - pub as_uint128: hv_u128, - pub __bindgen_anon_1: hv_x64_fp_control_status_register__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_x64_fp_control_status_register__bindgen_ty_1 { - pub fp_control: __u16, - pub fp_status: __u16, - pub fp_tag: __u8, - pub reserved: __u8, - pub last_fp_op: __u16, - pub __bindgen_anon_1: hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1 { - pub last_fp_rip: __u64, - pub __bindgen_anon_1: - hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { - pub last_fp_eip: __u32, - pub last_fp_cs: __u16, - pub padding: __u16, +impl hv_port_id__bindgen_ty_1 { + #[inline] + pub fn id(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set_id(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(id: __u32, reserved: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let id: u32 = unsafe { ::std::mem::transmute(id) }; + id as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } } #[test] -fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() -{ - const UNINIT: ::std::mem::MaybeUninit< - hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - > = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_port_id() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::< - hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - >(), - 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::< - hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - >(), - 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_eip) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(last_fp_eip) - ) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_port_id)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_cs) as usize - ptr as usize }, + ::std::mem::align_of::(), 4usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(last_fp_cs) - ) + concat!("Alignment of ", stringify!(hv_port_id)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 6usize, + unsafe { ::std::ptr::addr_of!((*ptr).as__u32) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), + stringify!(hv_port_id), "::", - stringify!(padding) - ) - ); -} -#[test] -fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit< - hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1, - > = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1) + stringify!(as__u32) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_rip) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1), + stringify!(hv_port_id), "::", - stringify!(last_fp_rip) + stringify!(u) ) ); } -impl Default for hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1 { +impl Default for hv_port_id { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2548,79 +2785,143 @@ impl Default for hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1 { } } } +pub const hv_message_type_HVMSG_NONE: hv_message_type = 0; +pub const hv_message_type_HVMSG_UNMAPPED_GPA: hv_message_type = 2147483648; +pub const hv_message_type_HVMSG_GPA_INTERCEPT: hv_message_type = 2147483649; +pub const hv_message_type_HVMSG_UNACCEPTED_GPA: hv_message_type = 2147483651; +pub const hv_message_type_HVMSG_GPA_ATTRIBUTE_INTERCEPT: hv_message_type = 2147483652; +pub const hv_message_type_HVMSG_TIMER_EXPIRED: hv_message_type = 2147483664; +pub const hv_message_type_HVMSG_INVALID_VP_REGISTER_VALUE: hv_message_type = 2147483680; +pub const hv_message_type_HVMSG_UNRECOVERABLE_EXCEPTION: hv_message_type = 2147483681; +pub const hv_message_type_HVMSG_UNSUPPORTED_FEATURE: hv_message_type = 2147483682; +pub const hv_message_type_HVMSG_OPAQUE_INTERCEPT: hv_message_type = 2147483711; +pub const hv_message_type_HVMSG_EVENTLOG_BUFFERCOMPLETE: hv_message_type = 2147483712; +pub const hv_message_type_HVMSG_HYPERCALL_INTERCEPT: hv_message_type = 2147483728; +pub const hv_message_type_HVMSG_SYNIC_EVENT_INTERCEPT: hv_message_type = 2147483744; +pub const hv_message_type_HVMSG_SYNIC_SINT_INTERCEPT: hv_message_type = 2147483745; +pub const hv_message_type_HVMSG_SYNIC_SINT_DELIVERABLE: hv_message_type = 2147483746; +pub const hv_message_type_HVMSG_ASYNC_CALL_COMPLETION: hv_message_type = 2147483760; +pub const hv_message_type_HVMSG_SCHEDULER_VP_SIGNAL_BITSET: hv_message_type = 2147483904; +pub const hv_message_type_HVMSG_SCHEDULER_VP_SIGNAL_PAIR: hv_message_type = 2147483905; +pub const hv_message_type_HVMSG_X64_IO_PORT_INTERCEPT: hv_message_type = 2147549184; +pub const hv_message_type_HVMSG_X64_MSR_INTERCEPT: hv_message_type = 2147549185; +pub const hv_message_type_HVMSG_X64_CPUID_INTERCEPT: hv_message_type = 2147549186; +pub const hv_message_type_HVMSG_X64_EXCEPTION_INTERCEPT: hv_message_type = 2147549187; +pub const hv_message_type_HVMSG_X64_APIC_EOI: hv_message_type = 2147549188; +pub const hv_message_type_HVMSG_X64_LEGACY_FP_ERROR: hv_message_type = 2147549189; +pub const hv_message_type_HVMSG_X64_IOMMU_PRQ: hv_message_type = 2147549190; +pub const hv_message_type_HVMSG_X64_HALT: hv_message_type = 2147549191; +pub const hv_message_type_HVMSG_X64_INTERRUPTION_DELIVERABLE: hv_message_type = 2147549192; +pub const hv_message_type_HVMSG_X64_SIPI_INTERCEPT: hv_message_type = 2147549193; +pub const hv_message_type_HVMSG_X64_SEV_VMGEXIT_INTERCEPT: hv_message_type = 2147549203; +pub type hv_message_type = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_synic_simp { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_synic_simp__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_synic_simp__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} #[test] -fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_synic_simp__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_synic_simp__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_control) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), - "::", - stringify!(fp_control) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_status) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), - "::", - stringify!(fp_status) - ) + concat!("Alignment of ", stringify!(hv_synic_simp__bindgen_ty_1)) ); +} +impl hv_synic_simp__bindgen_ty_1 { + #[inline] + pub fn simp_enabled(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_simp_enabled(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn preserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } + } + #[inline] + pub fn set_preserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 11u8, val as u64) + } + } + #[inline] + pub fn base_simp_gpa(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } + } + #[inline] + pub fn set_base_simp_gpa(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 52u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + simp_enabled: __u64, + preserved: __u64, + base_simp_gpa: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let simp_enabled: u64 = unsafe { ::std::mem::transmute(simp_enabled) }; + simp_enabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 11u8, { + let preserved: u64 = unsafe { ::std::mem::transmute(preserved) }; + preserved as u64 + }); + __bindgen_bitfield_unit.set(12usize, 52u8, { + let base_simp_gpa: u64 = unsafe { ::std::mem::transmute(base_simp_gpa) }; + base_simp_gpa as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_synic_simp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_tag) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), - "::", - stringify!(fp_tag) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_synic_simp)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), - "::", - stringify!(reserved) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_synic_simp)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_op) as usize - ptr as usize }, - 6usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), + stringify!(hv_synic_simp), "::", - stringify!(last_fp_op) + stringify!(as_uint64) ) ); } -impl Default for hv_x64_fp_control_status_register__bindgen_ty_1 { +impl Default for hv_synic_simp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2629,36 +2930,97 @@ impl Default for hv_x64_fp_control_status_register__bindgen_ty_1 { } } } +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_message_flags { + pub asu8: __u8, + pub __bindgen_anon_1: hv_message_flags__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_message_flags__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} #[test] -fn bindgen_test_layout_hv_x64_fp_control_status_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_message_flags__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hv_message_flags__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_message_flags__bindgen_ty_1)) + ); +} +impl hv_message_flags__bindgen_ty_1 { + #[inline] + pub fn msg_pending(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_msg_pending(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + msg_pending: __u8, + reserved: __u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let msg_pending: u8 = unsafe { ::std::mem::transmute(msg_pending) }; + msg_pending as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let reserved: u8 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_message_flags() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_fp_control_status_register)) + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hv_message_flags)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_fp_control_status_register) - ) + concat!("Alignment of ", stringify!(hv_message_flags)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).asu8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_fp_control_status_register), + stringify!(hv_message_flags), "::", - stringify!(as_uint128) + stringify!(asu8) ) ); } -impl Default for hv_x64_fp_control_status_register { +impl Default for hv_message_flags { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2669,133 +3031,120 @@ impl Default for hv_x64_fp_control_status_register { } #[repr(C, packed)] #[derive(Copy, Clone)] -pub union hv_x64_xmm_control_status_register { - pub as_uint128: hv_u128, - pub __bindgen_anon_1: hv_x64_xmm_control_status_register__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_x64_xmm_control_status_register__bindgen_ty_1 { - pub __bindgen_anon_1: hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1, - pub xmm_status_control: __u32, - pub xmm_status_control_mask: __u32, +pub struct hv_message_header { + pub message_type: __u32, + pub payload_size: __u8, + pub message_flags: hv_message_flags, + pub reserved: [__u8; 2usize], + pub __bindgen_anon_1: hv_message_header__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1 { - pub last_fp_rdp: __u64, - pub __bindgen_anon_1: - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { - pub last_fp_dp: __u32, - pub last_fp_ds: __u16, - pub padding: __u16, +pub union hv_message_header__bindgen_ty_1 { + pub sender: __u64, + pub port: hv_port_id, } #[test] -fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1( -) { - const UNINIT: ::std::mem::MaybeUninit< - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - > = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_message_header__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::< - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - >(), + ::std::mem::size_of::(), 8usize, - concat!( - "Size of: ", - stringify!( - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 - ) - ) + concat!("Size of: ", stringify!(hv_message_header__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::< - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, - >(), - 1usize, - concat!( - "Alignment of ", - stringify!( - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 - ) - ) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_message_header__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_dp) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sender) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!( - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 - ), + stringify!(hv_message_header__bindgen_ty_1), "::", - stringify!(last_fp_dp) + stringify!(sender) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_ds) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!( - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 - ), + stringify!(hv_message_header__bindgen_ty_1), "::", - stringify!(last_fp_ds) + stringify!(port) ) ); +} +impl Default for hv_message_header__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_message_header() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_message_header)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 6usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_message_header)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).message_type) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!( - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 - ), + stringify!(hv_message_header), "::", - stringify!(padding) + stringify!(message_type) ) ); -} -#[test] -fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit< - hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1, - > = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).payload_size) as usize - ptr as usize }, + 4usize, concat!( - "Size of: ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_message_header), + "::", + stringify!(payload_size) ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).message_flags) as usize - ptr as usize }, + 5usize, concat!( - "Alignment of ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_message_header), + "::", + stringify!(message_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last_fp_rdp) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 6usize, concat!( "Offset of field: ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1), + stringify!(hv_message_header), "::", - stringify!(last_fp_rdp) + stringify!(reserved) ) ); } -impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1 { +impl Default for hv_message_header { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2804,49 +3153,75 @@ impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1 } } } +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_notification_message_payload { + pub sint_index: __u32, +} #[test] -fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_notification_message_payload() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1) - ) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_notification_message_payload)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1) - ) + concat!("Alignment of ", stringify!(hv_notification_message_payload)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_status_control) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).sint_index) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1), + stringify!(hv_notification_message_payload), "::", - stringify!(xmm_status_control) + stringify!(sint_index) ) ); +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_message { + pub header: hv_message_header, + pub u: hv_message__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_message__bindgen_ty_1 { + pub payload: [__u64; 30usize], +} +#[test] +fn bindgen_test_layout_hv_message__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 240usize, + concat!("Size of: ", stringify!(hv_message__bindgen_ty_1)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_status_control_mask) as usize - ptr as usize }, - 12usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_message__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).payload) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1), + stringify!(hv_message__bindgen_ty_1), "::", - stringify!(xmm_status_control_mask) + stringify!(payload) ) ); } -impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1 { +impl Default for hv_message__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2856,35 +3231,41 @@ impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1 { } } #[test] -fn bindgen_test_layout_hv_x64_xmm_control_status_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_message() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_xmm_control_status_register)) + ::std::mem::size_of::(), + 256usize, + concat!("Size of: ", stringify!(hv_message)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_message)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_x64_xmm_control_status_register) + "Offset of field: ", + stringify!(hv_message), + "::", + stringify!(header) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_x64_xmm_control_status_register), + stringify!(hv_message), "::", - stringify!(as_uint128) + stringify!(u) ) ); } -impl Default for hv_x64_xmm_control_status_register { +impl Default for hv_message { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2895,400 +3276,268 @@ impl Default for hv_x64_xmm_control_status_register { } #[repr(C, packed)] #[derive(Copy, Clone)] -pub union hv_x64_fp_register { - pub as_uint128: hv_u128, - pub __bindgen_anon_1: hv_x64_fp_register__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_fp_register__bindgen_ty_1 { - pub mantissa: __u64, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +pub struct hv_message_page { + pub sint_message: [hv_message; 16usize], } #[test] -fn bindgen_test_layout_hv_x64_fp_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_message_page() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_fp_register__bindgen_ty_1)) + ::std::mem::size_of::(), + 4096usize, + concat!("Size of: ", stringify!(hv_message_page)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_fp_register__bindgen_ty_1) - ) + concat!("Alignment of ", stringify!(hv_message_page)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mantissa) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sint_message) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_fp_register__bindgen_ty_1), + stringify!(hv_message_page), "::", - stringify!(mantissa) + stringify!(sint_message) ) ); } -impl hv_x64_fp_register__bindgen_ty_1 { - #[inline] - pub fn biased_exponent(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 15u8) as u64) } - } - #[inline] - pub fn set_biased_exponent(&mut self, val: __u64) { +impl Default for hv_message_page { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 15u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn sign(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u64) } - } - #[inline] - pub fn set_sign(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(15usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 48u8) as u64) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 48u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - biased_exponent: __u64, - sign: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 15u8, { - let biased_exponent: u64 = unsafe { ::std::mem::transmute(biased_exponent) }; - biased_exponent as u64 - }); - __bindgen_bitfield_unit.set(15usize, 1u8, { - let sign: u64 = unsafe { ::std::mem::transmute(sign) }; - sign as u64 - }); - __bindgen_bitfield_unit.set(16usize, 48u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } -} -#[test] -fn bindgen_test_layout_hv_x64_fp_register() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_x64_fp_register)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_x64_fp_register)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_fp_register), - "::", - stringify!(as_uint128) - ) - ); } -impl Default for hv_x64_fp_register { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_x64_segment_register { + pub base: __u64, + pub limit: __u32, + pub selector: __u16, + pub __bindgen_anon_1: hv_x64_segment_register__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_x64_msr_npiep_config_contents { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_msr_npiep_config_contents__bindgen_ty_1, +pub union hv_x64_segment_register__bindgen_ty_1 { + pub __bindgen_anon_1: hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1, + pub attributes: __u16, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_msr_npiep_config_contents__bindgen_ty_1 { +pub struct hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, } #[test] -fn bindgen_test_layout_hv_x64_msr_npiep_config_contents__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 2usize, concat!( "Size of: ", - stringify!(hv_x64_msr_npiep_config_contents__bindgen_ty_1) + stringify!(hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_x64_msr_npiep_config_contents__bindgen_ty_1) + stringify!(hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1) ) ); } -impl hv_x64_msr_npiep_config_contents__bindgen_ty_1 { +impl hv_x64_segment_register__bindgen_ty_1__bindgen_ty_1 { #[inline] - pub fn prevents_gdt(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn segment_type(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) } } #[inline] - pub fn set_prevents_gdt(&mut self, val: __u64) { + pub fn set_segment_type(&mut self, val: __u16) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) } } #[inline] - pub fn prevents_idt(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + pub fn non_system_segment(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } } #[inline] - pub fn set_prevents_idt(&mut self, val: __u64) { + pub fn set_non_system_segment(&mut self, val: __u16) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn prevents_ldt(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + pub fn descriptor_privilege_level(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 2u8) as u16) } } #[inline] - pub fn set_prevents_ldt(&mut self, val: __u64) { + pub fn set_descriptor_privilege_level(&mut self, val: __u16) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 2u8, val as u64) } } #[inline] - pub fn prevents_tr(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + pub fn present(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } } #[inline] - pub fn set_prevents_tr(&mut self, val: __u64) { + pub fn set_present(&mut self, val: __u16) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } + pub fn reserved(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u16) } } #[inline] - pub fn set_reserved(&mut self, val: __u64) { + pub fn set_reserved(&mut self, val: __u16) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 60u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 4u8, val as u64) } } #[inline] - pub fn new_bitfield_1( - prevents_gdt: __u64, - prevents_idt: __u64, - prevents_ldt: __u64, - prevents_tr: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let prevents_gdt: u64 = unsafe { ::std::mem::transmute(prevents_gdt) }; - prevents_gdt as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let prevents_idt: u64 = unsafe { ::std::mem::transmute(prevents_idt) }; - prevents_idt as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let prevents_ldt: u64 = unsafe { ::std::mem::transmute(prevents_ldt) }; - prevents_ldt as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let prevents_tr: u64 = unsafe { ::std::mem::transmute(prevents_tr) }; - prevents_tr as u64 - }); - __bindgen_bitfield_unit.set(4usize, 60u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit + pub fn available(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) } } -} -#[test] -fn bindgen_test_layout_hv_x64_msr_npiep_config_contents() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_x64_msr_npiep_config_contents)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(hv_x64_msr_npiep_config_contents) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_msr_npiep_config_contents), - "::", - stringify!(as_uint64) - ) - ); -} -impl Default for hv_x64_msr_npiep_config_contents { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); + #[inline] + pub fn set_available(&mut self, val: __u16) { unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) } } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub union hv_input_vtl { - pub as_uint8: __u8, - pub __bindgen_anon_1: hv_input_vtl__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_input_vtl__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -#[test] -fn bindgen_test_layout_hv_input_vtl__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(hv_input_vtl__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_vtl__bindgen_ty_1)) - ); -} -impl hv_input_vtl__bindgen_ty_1 { #[inline] - pub fn target_vtl(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + pub fn _long(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) } } #[inline] - pub fn set_target_vtl(&mut self, val: __u8) { + pub fn set__long(&mut self, val: __u16) { unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) } } #[inline] - pub fn use_target_vtl(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + pub fn _default(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) } } #[inline] - pub fn set_use_target_vtl(&mut self, val: __u8) { + pub fn set__default(&mut self, val: __u16) { unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) } } #[inline] - pub fn reserved_z(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } + pub fn granularity(&self) -> __u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) } } #[inline] - pub fn set_reserved_z(&mut self, val: __u8) { + pub fn set_granularity(&mut self, val: __u16) { unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) } } #[inline] pub fn new_bitfield_1( - target_vtl: __u8, - use_target_vtl: __u8, - reserved_z: __u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + segment_type: __u16, + non_system_segment: __u16, + descriptor_privilege_level: __u16, + present: __u16, + reserved: __u16, + available: __u16, + _long: __u16, + _default: __u16, + granularity: __u16, + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 4u8, { - let target_vtl: u8 = unsafe { ::std::mem::transmute(target_vtl) }; - target_vtl as u64 + let segment_type: u16 = unsafe { ::std::mem::transmute(segment_type) }; + segment_type as u64 }); __bindgen_bitfield_unit.set(4usize, 1u8, { - let use_target_vtl: u8 = unsafe { ::std::mem::transmute(use_target_vtl) }; - use_target_vtl as u64 + let non_system_segment: u16 = unsafe { ::std::mem::transmute(non_system_segment) }; + non_system_segment as u64 }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let reserved_z: u8 = unsafe { ::std::mem::transmute(reserved_z) }; - reserved_z as u64 + __bindgen_bitfield_unit.set(5usize, 2u8, { + let descriptor_privilege_level: u16 = + unsafe { ::std::mem::transmute(descriptor_privilege_level) }; + descriptor_privilege_level as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let present: u16 = unsafe { ::std::mem::transmute(present) }; + present as u64 + }); + __bindgen_bitfield_unit.set(8usize, 4u8, { + let reserved: u16 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let available: u16 = unsafe { ::std::mem::transmute(available) }; + available as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let _long: u16 = unsafe { ::std::mem::transmute(_long) }; + _long as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let _default: u16 = unsafe { ::std::mem::transmute(_default) }; + _default as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let granularity: u16 = unsafe { ::std::mem::transmute(granularity) }; + granularity as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_input_vtl() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_x64_segment_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(hv_input_vtl)) + ::std::mem::size_of::(), + 2usize, + concat!( + "Size of: ", + stringify!(hv_x64_segment_register__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_vtl)) + ::std::mem::align_of::(), + 2usize, + concat!( + "Alignment of ", + stringify!(hv_x64_segment_register__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint8) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_vtl), + stringify!(hv_x64_segment_register__bindgen_ty_1), "::", - stringify!(as_uint8) + stringify!(attributes) ) ); } -impl Default for hv_input_vtl { +impl Default for hv_x64_segment_register__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -3297,676 +3546,581 @@ impl Default for hv_input_vtl { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_register_vsm_partition_config { - pub as_u64: __u64, - pub __bindgen_anon_1: hv_register_vsm_partition_config__bindgen_ty_1, -} -#[repr(C)] -#[repr(align(8))] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_register_vsm_partition_config__bindgen_ty_1 { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} #[test] -fn bindgen_test_layout_hv_register_vsm_partition_config__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_segment_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_segment_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_x64_segment_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_register_vsm_partition_config__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_x64_segment_register), + "::", + stringify!(base) ) ); assert_eq!( - ::std::mem::align_of::(), + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, 8usize, concat!( - "Alignment of ", - stringify!(hv_register_vsm_partition_config__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_x64_segment_register), + "::", + stringify!(limit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).selector) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_segment_register), + "::", + stringify!(selector) ) ); } -impl hv_register_vsm_partition_config__bindgen_ty_1 { - #[inline] - pub fn enable_vtl_protection(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_enable_vtl_protection(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn default_vtl_protection_mask(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u64) } - } - #[inline] - pub fn set_default_vtl_protection_mask(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 4u8, val as u64) - } - } - #[inline] - pub fn zero_memory_on_reset(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } - } - #[inline] - pub fn set_zero_memory_on_reset(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn deny_lower_vtl_startup(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } - } - #[inline] - pub fn set_deny_lower_vtl_startup(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_acceptance(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_acceptance(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_enable_vtl_protection(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_enable_vtl_protection(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_vp_startup(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_vp_startup(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_cpuid_unimplemented(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_cpuid_unimplemented(&mut self, val: __u64) { +impl Default for hv_x64_segment_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 1u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn intercept_unrecoverable_exception(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_unrecoverable_exception(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(11usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_page(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_page(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_restore_partition_time(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_restore_partition_time(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(13usize, 1u8, val as u64) - } - } - #[inline] - pub fn intercept_not_present(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } - } - #[inline] - pub fn set_intercept_not_present(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(14usize, 1u8, val as u64) - } - } - #[inline] - pub fn mbz(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 49u8) as u64) } - } - #[inline] - pub fn set_mbz(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(15usize, 49u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - enable_vtl_protection: __u64, - default_vtl_protection_mask: __u64, - zero_memory_on_reset: __u64, - deny_lower_vtl_startup: __u64, - intercept_acceptance: __u64, - intercept_enable_vtl_protection: __u64, - intercept_vp_startup: __u64, - intercept_cpuid_unimplemented: __u64, - intercept_unrecoverable_exception: __u64, - intercept_page: __u64, - intercept_restore_partition_time: __u64, - intercept_not_present: __u64, - mbz: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let enable_vtl_protection: u64 = - unsafe { ::std::mem::transmute(enable_vtl_protection) }; - enable_vtl_protection as u64 - }); - __bindgen_bitfield_unit.set(1usize, 4u8, { - let default_vtl_protection_mask: u64 = - unsafe { ::std::mem::transmute(default_vtl_protection_mask) }; - default_vtl_protection_mask as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let zero_memory_on_reset: u64 = unsafe { ::std::mem::transmute(zero_memory_on_reset) }; - zero_memory_on_reset as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let deny_lower_vtl_startup: u64 = - unsafe { ::std::mem::transmute(deny_lower_vtl_startup) }; - deny_lower_vtl_startup as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let intercept_acceptance: u64 = unsafe { ::std::mem::transmute(intercept_acceptance) }; - intercept_acceptance as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let intercept_enable_vtl_protection: u64 = - unsafe { ::std::mem::transmute(intercept_enable_vtl_protection) }; - intercept_enable_vtl_protection as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let intercept_vp_startup: u64 = unsafe { ::std::mem::transmute(intercept_vp_startup) }; - intercept_vp_startup as u64 - }); - __bindgen_bitfield_unit.set(10usize, 1u8, { - let intercept_cpuid_unimplemented: u64 = - unsafe { ::std::mem::transmute(intercept_cpuid_unimplemented) }; - intercept_cpuid_unimplemented as u64 - }); - __bindgen_bitfield_unit.set(11usize, 1u8, { - let intercept_unrecoverable_exception: u64 = - unsafe { ::std::mem::transmute(intercept_unrecoverable_exception) }; - intercept_unrecoverable_exception as u64 - }); - __bindgen_bitfield_unit.set(12usize, 1u8, { - let intercept_page: u64 = unsafe { ::std::mem::transmute(intercept_page) }; - intercept_page as u64 - }); - __bindgen_bitfield_unit.set(13usize, 1u8, { - let intercept_restore_partition_time: u64 = - unsafe { ::std::mem::transmute(intercept_restore_partition_time) }; - intercept_restore_partition_time as u64 - }); - __bindgen_bitfield_unit.set(14usize, 1u8, { - let intercept_not_present: u64 = - unsafe { ::std::mem::transmute(intercept_not_present) }; - intercept_not_present as u64 - }); - __bindgen_bitfield_unit.set(15usize, 49u8, { - let mbz: u64 = unsafe { ::std::mem::transmute(mbz) }; - mbz as u64 - }); - __bindgen_bitfield_unit - } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_table_register { + pub pad: [__u16; 3usize], + pub limit: __u16, + pub base: __u64, } #[test] -fn bindgen_test_layout_hv_register_vsm_partition_config() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_table_register() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_register_vsm_partition_config)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_table_register)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_x64_table_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pad) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_register_vsm_partition_config) + "Offset of field: ", + stringify!(hv_x64_table_register), + "::", + stringify!(pad) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_u64) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, + 6usize, concat!( "Offset of field: ", - stringify!(hv_register_vsm_partition_config), + stringify!(hv_x64_table_register), "::", - stringify!(as_u64) + stringify!(limit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_table_register), + "::", + stringify!(base) ) ); } -impl Default for hv_register_vsm_partition_config { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_x64_fp_control_status_register { + pub as_uint128: hv_u128, + pub __bindgen_anon_1: hv_x64_fp_control_status_register__bindgen_ty_1, } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_nested_enlightenments_control { - pub features: hv_nested_enlightenments_control__bindgen_ty_1, - pub hypercall_controls: hv_nested_enlightenments_control__bindgen_ty_2, +#[derive(Copy, Clone)] +pub struct hv_x64_fp_control_status_register__bindgen_ty_1 { + pub fp_control: __u16, + pub fp_status: __u16, + pub fp_tag: __u8, + pub reserved: __u8, + pub last_fp_op: __u16, + pub __bindgen_anon_1: hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1 { + pub last_fp_rip: __u64, + pub __bindgen_anon_1: + hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_nested_enlightenments_control__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +pub struct hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub last_fp_eip: __u32, + pub last_fp_cs: __u16, + pub padding: __u16, } #[test] -fn bindgen_test_layout_hv_nested_enlightenments_control__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() +{ + const UNINIT: ::std::mem::MaybeUninit< + hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + > = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, + ::std::mem::size_of::< + hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + >(), + 8usize, concat!( "Size of: ", - stringify!(hv_nested_enlightenments_control__bindgen_ty_1) + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::< + hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + >(), 1usize, concat!( "Alignment of ", - stringify!(hv_nested_enlightenments_control__bindgen_ty_1) + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) ) ); -} -impl hv_nested_enlightenments_control__bindgen_ty_1 { - #[inline] - pub fn directhypercall(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_directhypercall(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 31u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - directhypercall: __u32, - reserved: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let directhypercall: u32 = unsafe { ::std::mem::transmute(directhypercall) }; - directhypercall as u64 - }); - __bindgen_bitfield_unit.set(1usize, 31u8, { - let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_nested_enlightenments_control__bindgen_ty_2 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -#[test] -fn bindgen_test_layout_hv_nested_enlightenments_control__bindgen_ty_2() { assert_eq!( - ::std::mem::size_of::(), + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_eip) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(last_fp_eip) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_cs) as usize - ptr as usize }, 4usize, concat!( - "Size of: ", - stringify!(hv_nested_enlightenments_control__bindgen_ty_2) + "Offset of field: ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(last_fp_cs) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 6usize, concat!( - "Alignment of ", - stringify!(hv_nested_enlightenments_control__bindgen_ty_2) + "Offset of field: ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(padding) ) ); } -impl hv_nested_enlightenments_control__bindgen_ty_2 { - #[inline] - pub fn inter_partition_comm(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_inter_partition_comm(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 31u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - inter_partition_comm: __u32, - reserved: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let inter_partition_comm: u32 = unsafe { ::std::mem::transmute(inter_partition_comm) }; - inter_partition_comm as u64 - }); - __bindgen_bitfield_unit.set(1usize, 31u8, { - let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } -} #[test] -fn bindgen_test_layout_hv_nested_enlightenments_control() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit< + hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1, + > = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_nested_enlightenments_control)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, concat!( - "Alignment of ", - stringify!(hv_nested_enlightenments_control) + "Size of: ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, - 0usize, + ::std::mem::align_of::(), + 8usize, concat!( - "Offset of field: ", - stringify!(hv_nested_enlightenments_control), - "::", - stringify!(features) + "Alignment of ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hypercall_controls) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_rip) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_nested_enlightenments_control), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(hypercall_controls) + stringify!(last_fp_rip) ) ); } -#[repr(C, packed)] -#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_vp_assist_page { - pub apic_assist: __u32, - pub reserved1: __u32, - pub vtl_entry_reason: __u32, - pub vtl_reserved: __u32, - pub vtl_ret_x64rax: __u64, - pub vtl_ret_x64rcx: __u64, - pub nested_control: hv_nested_enlightenments_control, - pub enlighten_vmentry: __u8, - pub reserved2: [__u8; 7usize], - pub current_nested_vmcs: __u64, - pub synthetic_time_unhalted_timer_expired: __u8, - pub reserved3: [__u8; 7usize], - pub virtualization_fault_information: [__u8; 40usize], - pub reserved4: [__u8; 8usize], - pub intercept_message: [__u8; 256usize], - pub vtl_ret_actions: [__u8; 256usize], +impl Default for hv_x64_fp_control_status_register__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } } #[test] -fn bindgen_test_layout_hv_vp_assist_page() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_x64_fp_control_status_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 624usize, - concat!("Size of: ", stringify!(hv_vp_assist_page)) + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_vp_assist_page)) + concat!( + "Alignment of ", + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_assist) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).fp_control) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), "::", - stringify!(apic_assist) + stringify!(fp_control) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).fp_status) as usize - ptr as usize }, + 2usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), "::", - stringify!(reserved1) + stringify!(fp_status) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtl_entry_reason) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).fp_tag) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), "::", - stringify!(vtl_entry_reason) + stringify!(fp_tag) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtl_reserved) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 5usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), "::", - stringify!(vtl_reserved) + stringify!(reserved) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_x64rax) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_op) as usize - ptr as usize }, + 6usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register__bindgen_ty_1), "::", - stringify!(vtl_ret_x64rax) + stringify!(last_fp_op) ) ); +} +impl Default for hv_x64_fp_control_status_register__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_x64_fp_control_status_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_fp_control_status_register)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_x64rcx) as usize - ptr as usize }, - 24usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_vp_assist_page), - "::", - stringify!(vtl_ret_x64rcx) + "Alignment of ", + stringify!(hv_x64_fp_control_status_register) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nested_control) as usize - ptr as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_fp_control_status_register), "::", - stringify!(nested_control) + stringify!(as_uint128) ) ); +} +impl Default for hv_x64_fp_control_status_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_x64_xmm_control_status_register { + pub as_uint128: hv_u128, + pub __bindgen_anon_1: hv_x64_xmm_control_status_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_x64_xmm_control_status_register__bindgen_ty_1 { + pub __bindgen_anon_1: hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1, + pub xmm_status_control: __u32, + pub xmm_status_control_mask: __u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1 { + pub last_fp_rdp: __u64, + pub __bindgen_anon_1: + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub last_fp_dp: __u32, + pub last_fp_ds: __u16, + pub padding: __u16, +} +#[test] +fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1( +) { + const UNINIT: ::std::mem::MaybeUninit< + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + > = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enlighten_vmentry) as usize - ptr as usize }, - 40usize, + ::std::mem::size_of::< + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + >(), + 8usize, concat!( - "Offset of field: ", - stringify!(hv_vp_assist_page), - "::", - stringify!(enlighten_vmentry) + "Size of: ", + stringify!( + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 + ) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, - 41usize, + ::std::mem::align_of::< + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + >(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_vp_assist_page), - "::", - stringify!(reserved2) + "Alignment of ", + stringify!( + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 + ) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).current_nested_vmcs) as usize - ptr as usize }, - 48usize, + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_dp) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!( + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 + ), "::", - stringify!(current_nested_vmcs) + stringify!(last_fp_dp) ) ); assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).synthetic_time_unhalted_timer_expired) as usize - - ptr as usize - }, - 56usize, + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_ds) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!( + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 + ), "::", - stringify!(synthetic_time_unhalted_timer_expired) + stringify!(last_fp_ds) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, - 57usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 6usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!( + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 + ), "::", - stringify!(reserved3) + stringify!(padding) + ) + ); +} +#[test] +fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit< + hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1, + > = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).virtualization_fault_information) as usize - ptr as usize - }, - 64usize, + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).last_fp_rdp) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1), "::", - stringify!(virtualization_fault_information) + stringify!(last_fp_rdp) ) ); +} +impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_x64_xmm_control_status_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved4) as usize - ptr as usize }, - 104usize, + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xmm_status_control) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1), "::", - stringify!(reserved4) + stringify!(xmm_status_control) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_message) as usize - ptr as usize }, - 112usize, + unsafe { ::std::ptr::addr_of!((*ptr).xmm_status_control_mask) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_xmm_control_status_register__bindgen_ty_1), "::", - stringify!(intercept_message) + stringify!(xmm_status_control_mask) + ) + ); +} +impl Default for hv_x64_xmm_control_status_register__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_x64_xmm_control_status_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_xmm_control_status_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_xmm_control_status_register) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_actions) as usize - ptr as usize }, - 368usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_vp_assist_page), + stringify!(hv_x64_xmm_control_status_register), "::", - stringify!(vtl_ret_actions) + stringify!(as_uint128) ) ); } -impl Default for hv_vp_assist_page { +impl Default for hv_x64_xmm_control_status_register { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -3975,40 +4129,1122 @@ impl Default for hv_vp_assist_page { } } } -pub const hv_register_name_HV_REGISTER_EXPLICIT_SUSPEND: hv_register_name = 0; -pub const hv_register_name_HV_REGISTER_INTERCEPT_SUSPEND: hv_register_name = 1; -pub const hv_register_name_HV_REGISTER_INSTRUCTION_EMULATION_HINTS: hv_register_name = 2; -pub const hv_register_name_HV_REGISTER_DISPATCH_SUSPEND: hv_register_name = 3; -pub const hv_register_name_HV_REGISTER_INTERNAL_ACTIVITY_STATE: hv_register_name = 4; -pub const hv_register_name_HV_REGISTER_HYPERVISOR_VERSION: hv_register_name = 256; -pub const hv_register_name_HV_REGISTER_PRIVILEGES_AND_FEATURES_INFO: hv_register_name = 512; -pub const hv_register_name_HV_REGISTER_FEATURES_INFO: hv_register_name = 513; -pub const hv_register_name_HV_REGISTER_IMPLEMENTATION_LIMITS_INFO: hv_register_name = 514; -pub const hv_register_name_HV_REGISTER_HARDWARE_FEATURES_INFO: hv_register_name = 515; -pub const hv_register_name_HV_REGISTER_CPU_MANAGEMENT_FEATURES_INFO: hv_register_name = 516; -pub const hv_register_name_HV_REGISTER_SVM_FEATURES_INFO: hv_register_name = 517; -pub const hv_register_name_HV_REGISTER_SKIP_LEVEL_FEATURES_INFO: hv_register_name = 518; -pub const hv_register_name_HV_REGISTER_NESTED_VIRT_FEATURES_INFO: hv_register_name = 519; -pub const hv_register_name_HV_REGISTER_IPT_FEATURES_INFO: hv_register_name = 520; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P0: hv_register_name = 528; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P1: hv_register_name = 529; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P2: hv_register_name = 530; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P3: hv_register_name = 531; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P4: hv_register_name = 532; -pub const hv_register_name_HV_REGISTER_GUEST_CRASH_CTL: hv_register_name = 533; -pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C1: hv_register_name = 544; -pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C1: hv_register_name = 545; -pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C2: hv_register_name = 546; -pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C2: hv_register_name = 547; -pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C3: hv_register_name = 548; -pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C3: hv_register_name = 549; -pub const hv_register_name_HV_REGISTER_PROCESSOR_CLOCK_FREQUENCY: hv_register_name = 576; -pub const hv_register_name_HV_REGISTER_INTERRUPT_CLOCK_FREQUENCY: hv_register_name = 577; -pub const hv_register_name_HV_REGISTER_GUEST_IDLE: hv_register_name = 592; +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_x64_fp_register { + pub as_uint128: hv_u128, + pub __bindgen_anon_1: hv_x64_fp_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_fp_register__bindgen_ty_1 { + pub mantissa: __u64, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_x64_fp_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_fp_register__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_fp_register__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mantissa) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_fp_register__bindgen_ty_1), + "::", + stringify!(mantissa) + ) + ); +} +impl hv_x64_fp_register__bindgen_ty_1 { + #[inline] + pub fn biased_exponent(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 15u8) as u64) } + } + #[inline] + pub fn set_biased_exponent(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 15u8, val as u64) + } + } + #[inline] + pub fn sign(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u64) } + } + #[inline] + pub fn set_sign(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 48u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 48u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + biased_exponent: __u64, + sign: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 15u8, { + let biased_exponent: u64 = unsafe { ::std::mem::transmute(biased_exponent) }; + biased_exponent as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let sign: u64 = unsafe { ::std::mem::transmute(sign) }; + sign as u64 + }); + __bindgen_bitfield_unit.set(16usize, 48u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_x64_fp_register() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_fp_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_x64_fp_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint128) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_fp_register), + "::", + stringify!(as_uint128) + ) + ); +} +impl Default for hv_x64_fp_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_msr_npiep_config_contents { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_x64_msr_npiep_config_contents__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_msr_npiep_config_contents__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_x64_msr_npiep_config_contents__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_msr_npiep_config_contents__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_msr_npiep_config_contents__bindgen_ty_1) + ) + ); +} +impl hv_x64_msr_npiep_config_contents__bindgen_ty_1 { + #[inline] + pub fn prevents_gdt(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_prevents_gdt(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn prevents_idt(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_prevents_idt(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn prevents_ldt(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_prevents_ldt(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn prevents_tr(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_prevents_tr(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 60u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + prevents_gdt: __u64, + prevents_idt: __u64, + prevents_ldt: __u64, + prevents_tr: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let prevents_gdt: u64 = unsafe { ::std::mem::transmute(prevents_gdt) }; + prevents_gdt as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let prevents_idt: u64 = unsafe { ::std::mem::transmute(prevents_idt) }; + prevents_idt as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let prevents_ldt: u64 = unsafe { ::std::mem::transmute(prevents_ldt) }; + prevents_ldt as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let prevents_tr: u64 = unsafe { ::std::mem::transmute(prevents_tr) }; + prevents_tr as u64 + }); + __bindgen_bitfield_unit.set(4usize, 60u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_x64_msr_npiep_config_contents() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_x64_msr_npiep_config_contents)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(hv_x64_msr_npiep_config_contents) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_msr_npiep_config_contents), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_x64_msr_npiep_config_contents { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_input_vtl { + pub as_uint8: __u8, + pub __bindgen_anon_1: hv_input_vtl__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_vtl__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[test] +fn bindgen_test_layout_hv_input_vtl__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hv_input_vtl__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_vtl__bindgen_ty_1)) + ); +} +impl hv_input_vtl__bindgen_ty_1 { + #[inline] + pub fn target_vtl(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_target_vtl(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn use_target_vtl(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + } + #[inline] + pub fn set_use_target_vtl(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved_z(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } + } + #[inline] + pub fn set_reserved_z(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 3u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + target_vtl: __u8, + use_target_vtl: __u8, + reserved_z: __u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let target_vtl: u8 = unsafe { ::std::mem::transmute(target_vtl) }; + target_vtl as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let use_target_vtl: u8 = unsafe { ::std::mem::transmute(use_target_vtl) }; + use_target_vtl as u64 + }); + __bindgen_bitfield_unit.set(5usize, 3u8, { + let reserved_z: u8 = unsafe { ::std::mem::transmute(reserved_z) }; + reserved_z as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_input_vtl() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hv_input_vtl)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_vtl)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_input_vtl), + "::", + stringify!(as_uint8) + ) + ); +} +impl Default for hv_input_vtl { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_register_vsm_partition_config { + pub as_u64: __u64, + pub __bindgen_anon_1: hv_register_vsm_partition_config__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_register_vsm_partition_config__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_register_vsm_partition_config__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_register_vsm_partition_config__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(hv_register_vsm_partition_config__bindgen_ty_1) + ) + ); +} +impl hv_register_vsm_partition_config__bindgen_ty_1 { + #[inline] + pub fn enable_vtl_protection(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_enable_vtl_protection(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn default_vtl_protection_mask(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u64) } + } + #[inline] + pub fn set_default_vtl_protection_mask(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 4u8, val as u64) + } + } + #[inline] + pub fn zero_memory_on_reset(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + } + #[inline] + pub fn set_zero_memory_on_reset(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub fn deny_lower_vtl_startup(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } + } + #[inline] + pub fn set_deny_lower_vtl_startup(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_acceptance(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_acceptance(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_enable_vtl_protection(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_enable_vtl_protection(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_vp_startup(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_vp_startup(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_cpuid_unimplemented(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_cpuid_unimplemented(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_unrecoverable_exception(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_unrecoverable_exception(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_page(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_page(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_restore_partition_time(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_restore_partition_time(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub fn intercept_not_present(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } + } + #[inline] + pub fn set_intercept_not_present(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub fn mbz(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 49u8) as u64) } + } + #[inline] + pub fn set_mbz(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 49u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + enable_vtl_protection: __u64, + default_vtl_protection_mask: __u64, + zero_memory_on_reset: __u64, + deny_lower_vtl_startup: __u64, + intercept_acceptance: __u64, + intercept_enable_vtl_protection: __u64, + intercept_vp_startup: __u64, + intercept_cpuid_unimplemented: __u64, + intercept_unrecoverable_exception: __u64, + intercept_page: __u64, + intercept_restore_partition_time: __u64, + intercept_not_present: __u64, + mbz: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let enable_vtl_protection: u64 = + unsafe { ::std::mem::transmute(enable_vtl_protection) }; + enable_vtl_protection as u64 + }); + __bindgen_bitfield_unit.set(1usize, 4u8, { + let default_vtl_protection_mask: u64 = + unsafe { ::std::mem::transmute(default_vtl_protection_mask) }; + default_vtl_protection_mask as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let zero_memory_on_reset: u64 = unsafe { ::std::mem::transmute(zero_memory_on_reset) }; + zero_memory_on_reset as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let deny_lower_vtl_startup: u64 = + unsafe { ::std::mem::transmute(deny_lower_vtl_startup) }; + deny_lower_vtl_startup as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let intercept_acceptance: u64 = unsafe { ::std::mem::transmute(intercept_acceptance) }; + intercept_acceptance as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let intercept_enable_vtl_protection: u64 = + unsafe { ::std::mem::transmute(intercept_enable_vtl_protection) }; + intercept_enable_vtl_protection as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let intercept_vp_startup: u64 = unsafe { ::std::mem::transmute(intercept_vp_startup) }; + intercept_vp_startup as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let intercept_cpuid_unimplemented: u64 = + unsafe { ::std::mem::transmute(intercept_cpuid_unimplemented) }; + intercept_cpuid_unimplemented as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let intercept_unrecoverable_exception: u64 = + unsafe { ::std::mem::transmute(intercept_unrecoverable_exception) }; + intercept_unrecoverable_exception as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let intercept_page: u64 = unsafe { ::std::mem::transmute(intercept_page) }; + intercept_page as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let intercept_restore_partition_time: u64 = + unsafe { ::std::mem::transmute(intercept_restore_partition_time) }; + intercept_restore_partition_time as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let intercept_not_present: u64 = + unsafe { ::std::mem::transmute(intercept_not_present) }; + intercept_not_present as u64 + }); + __bindgen_bitfield_unit.set(15usize, 49u8, { + let mbz: u64 = unsafe { ::std::mem::transmute(mbz) }; + mbz as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_register_vsm_partition_config() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_register_vsm_partition_config)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(hv_register_vsm_partition_config) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_u64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_vsm_partition_config), + "::", + stringify!(as_u64) + ) + ); +} +impl Default for hv_register_vsm_partition_config { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_nested_enlightenments_control { + pub features: hv_nested_enlightenments_control__bindgen_ty_1, + pub hypercall_controls: hv_nested_enlightenments_control__bindgen_ty_2, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_nested_enlightenments_control__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[test] +fn bindgen_test_layout_hv_nested_enlightenments_control__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(hv_nested_enlightenments_control__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_nested_enlightenments_control__bindgen_ty_1) + ) + ); +} +impl hv_nested_enlightenments_control__bindgen_ty_1 { + #[inline] + pub fn directhypercall(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_directhypercall(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + directhypercall: __u32, + reserved: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let directhypercall: u32 = unsafe { ::std::mem::transmute(directhypercall) }; + directhypercall as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_nested_enlightenments_control__bindgen_ty_2 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[test] +fn bindgen_test_layout_hv_nested_enlightenments_control__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(hv_nested_enlightenments_control__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_nested_enlightenments_control__bindgen_ty_2) + ) + ); +} +impl hv_nested_enlightenments_control__bindgen_ty_2 { + #[inline] + pub fn inter_partition_comm(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_inter_partition_comm(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + inter_partition_comm: __u32, + reserved: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let inter_partition_comm: u32 = unsafe { ::std::mem::transmute(inter_partition_comm) }; + inter_partition_comm as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_nested_enlightenments_control() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_nested_enlightenments_control)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_nested_enlightenments_control) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_nested_enlightenments_control), + "::", + stringify!(features) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hypercall_controls) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_nested_enlightenments_control), + "::", + stringify!(hypercall_controls) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_vp_assist_page { + pub apic_assist: __u32, + pub reserved1: __u32, + pub vtl_entry_reason: __u32, + pub vtl_reserved: __u32, + pub vtl_ret_x64rax: __u64, + pub vtl_ret_x64rcx: __u64, + pub nested_control: hv_nested_enlightenments_control, + pub enlighten_vmentry: __u8, + pub reserved2: [__u8; 7usize], + pub current_nested_vmcs: __u64, + pub synthetic_time_unhalted_timer_expired: __u8, + pub reserved3: [__u8; 7usize], + pub virtualization_fault_information: [__u8; 40usize], + pub reserved4: [__u8; 8usize], + pub intercept_message: [__u8; 256usize], + pub vtl_ret_actions: [__u8; 256usize], +} +#[test] +fn bindgen_test_layout_hv_vp_assist_page() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 624usize, + concat!("Size of: ", stringify!(hv_vp_assist_page)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_vp_assist_page)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).apic_assist) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(apic_assist) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vtl_entry_reason) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(vtl_entry_reason) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vtl_reserved) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(vtl_reserved) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_x64rax) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(vtl_ret_x64rax) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_x64rcx) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(vtl_ret_x64rcx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nested_control) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(nested_control) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).enlighten_vmentry) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(enlighten_vmentry) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, + 41usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).current_nested_vmcs) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(current_nested_vmcs) + ) + ); + assert_eq!( + unsafe { + ::std::ptr::addr_of!((*ptr).synthetic_time_unhalted_timer_expired) as usize + - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(synthetic_time_unhalted_timer_expired) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, + 57usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + ::std::ptr::addr_of!((*ptr).virtualization_fault_information) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(virtualization_fault_information) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved4) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(reserved4) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).intercept_message) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(intercept_message) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vtl_ret_actions) as usize - ptr as usize }, + 368usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_assist_page), + "::", + stringify!(vtl_ret_actions) + ) + ); +} +impl Default for hv_vp_assist_page { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const hv_register_name_HV_REGISTER_EXPLICIT_SUSPEND: hv_register_name = 0; +pub const hv_register_name_HV_REGISTER_INTERCEPT_SUSPEND: hv_register_name = 1; +pub const hv_register_name_HV_REGISTER_INSTRUCTION_EMULATION_HINTS: hv_register_name = 2; +pub const hv_register_name_HV_REGISTER_DISPATCH_SUSPEND: hv_register_name = 3; +pub const hv_register_name_HV_REGISTER_INTERNAL_ACTIVITY_STATE: hv_register_name = 4; +pub const hv_register_name_HV_REGISTER_HYPERVISOR_VERSION: hv_register_name = 256; +pub const hv_register_name_HV_REGISTER_PRIVILEGES_AND_FEATURES_INFO: hv_register_name = 512; +pub const hv_register_name_HV_REGISTER_FEATURES_INFO: hv_register_name = 513; +pub const hv_register_name_HV_REGISTER_IMPLEMENTATION_LIMITS_INFO: hv_register_name = 514; +pub const hv_register_name_HV_REGISTER_HARDWARE_FEATURES_INFO: hv_register_name = 515; +pub const hv_register_name_HV_REGISTER_CPU_MANAGEMENT_FEATURES_INFO: hv_register_name = 516; +pub const hv_register_name_HV_REGISTER_SVM_FEATURES_INFO: hv_register_name = 517; +pub const hv_register_name_HV_REGISTER_SKIP_LEVEL_FEATURES_INFO: hv_register_name = 518; +pub const hv_register_name_HV_REGISTER_NESTED_VIRT_FEATURES_INFO: hv_register_name = 519; +pub const hv_register_name_HV_REGISTER_IPT_FEATURES_INFO: hv_register_name = 520; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P0: hv_register_name = 528; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P1: hv_register_name = 529; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P2: hv_register_name = 530; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P3: hv_register_name = 531; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_P4: hv_register_name = 532; +pub const hv_register_name_HV_REGISTER_GUEST_CRASH_CTL: hv_register_name = 533; +pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C1: hv_register_name = 544; +pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C1: hv_register_name = 545; +pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C2: hv_register_name = 546; +pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C2: hv_register_name = 547; +pub const hv_register_name_HV_REGISTER_POWER_STATE_CONFIG_C3: hv_register_name = 548; +pub const hv_register_name_HV_REGISTER_POWER_STATE_TRIGGER_C3: hv_register_name = 549; +pub const hv_register_name_HV_REGISTER_PROCESSOR_CLOCK_FREQUENCY: hv_register_name = 576; +pub const hv_register_name_HV_REGISTER_INTERRUPT_CLOCK_FREQUENCY: hv_register_name = 577; +pub const hv_register_name_HV_REGISTER_GUEST_IDLE: hv_register_name = 592; pub const hv_register_name_HV_REGISTER_DEBUG_DEVICE_OPTIONS: hv_register_name = 608; pub const hv_register_name_HV_REGISTER_MEMORY_ZEROING_CONTROL: hv_register_name = 624; pub const hv_register_name_HV_REGISTER_PENDING_EVENT0: hv_register_name = 65540; pub const hv_register_name_HV_REGISTER_PENDING_EVENT1: hv_register_name = 65541; +pub const hv_register_name_HV_REGISTER_DELIVERABILITY_NOTIFICATIONS: hv_register_name = 65542; pub const hv_register_name_HV_REGISTER_VP_RUNTIME: hv_register_name = 589824; pub const hv_register_name_HV_REGISTER_GUEST_OS_ID: hv_register_name = 589826; pub const hv_register_name_HV_REGISTER_VP_INDEX: hv_register_name = 589827; @@ -4040,8 +5276,8 @@ pub const hv_register_name_HV_REGISTER_SINT14: hv_register_name = 655374; pub const hv_register_name_HV_REGISTER_SINT15: hv_register_name = 655375; pub const hv_register_name_HV_REGISTER_SCONTROL: hv_register_name = 655376; pub const hv_register_name_HV_REGISTER_SVERSION: hv_register_name = 655377; -pub const hv_register_name_HV_REGISTER_SIFP: hv_register_name = 655378; -pub const hv_register_name_HV_REGISTER_SIPP: hv_register_name = 655379; +pub const hv_register_name_HV_REGISTER_SIEFP: hv_register_name = 655378; +pub const hv_register_name_HV_REGISTER_SIMP: hv_register_name = 655379; pub const hv_register_name_HV_REGISTER_EOM: hv_register_name = 655380; pub const hv_register_name_HV_REGISTER_SIRBP: hv_register_name = 655381; pub const hv_register_name_HV_REGISTER_NESTED_SINT0: hv_register_name = 659456; @@ -4308,102 +5544,1160 @@ pub const hv_register_name_HV_X64_REGISTER_CR_INTERCEPT_IA32_MISC_ENABLE_MASK: h pub type hv_register_name = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] -pub union hv_explicit_suspend_register { +pub union hv_explicit_suspend_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_explicit_suspend_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_explicit_suspend_register__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_explicit_suspend_register__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_explicit_suspend_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_explicit_suspend_register__bindgen_ty_1) + ) + ); +} +impl hv_explicit_suspend_register__bindgen_ty_1 { + #[inline] + pub fn suspended(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_suspended(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + suspended: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; + suspended as u64 + }); + __bindgen_bitfield_unit.set(1usize, 63u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_explicit_suspend_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_explicit_suspend_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_explicit_suspend_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_explicit_suspend_register), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_explicit_suspend_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_intercept_suspend_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_intercept_suspend_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_intercept_suspend_register__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_intercept_suspend_register__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_intercept_suspend_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_intercept_suspend_register__bindgen_ty_1) + ) + ); +} +impl hv_intercept_suspend_register__bindgen_ty_1 { + #[inline] + pub fn suspended(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_suspended(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + suspended: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; + suspended as u64 + }); + __bindgen_bitfield_unit.set(1usize, 63u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_intercept_suspend_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_intercept_suspend_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_intercept_suspend_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_suspend_register), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_intercept_suspend_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_dispatch_suspend_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_dispatch_suspend_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_dispatch_suspend_register__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_dispatch_suspend_register__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_dispatch_suspend_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_dispatch_suspend_register__bindgen_ty_1) + ) + ); +} +impl hv_dispatch_suspend_register__bindgen_ty_1 { + #[inline] + pub fn suspended(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_suspended(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + suspended: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; + suspended as u64 + }); + __bindgen_bitfield_unit.set(1usize, 63u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_dispatch_suspend_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_dispatch_suspend_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_dispatch_suspend_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_dispatch_suspend_register), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_dispatch_suspend_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_internal_activity_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_internal_activity_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_internal_activity_register__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_internal_activity_register__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_internal_activity_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_internal_activity_register__bindgen_ty_1) + ) + ); +} +impl hv_internal_activity_register__bindgen_ty_1 { + #[inline] + pub fn startup_suspend(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_startup_suspend(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn halt_suspend(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_halt_suspend(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn idle_suspend(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_idle_suspend(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn rsvd_z(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 61u8) as u64) } + } + #[inline] + pub fn set_rsvd_z(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 61u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + startup_suspend: __u64, + halt_suspend: __u64, + idle_suspend: __u64, + rsvd_z: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let startup_suspend: u64 = unsafe { ::std::mem::transmute(startup_suspend) }; + startup_suspend as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let halt_suspend: u64 = unsafe { ::std::mem::transmute(halt_suspend) }; + halt_suspend as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let idle_suspend: u64 = unsafe { ::std::mem::transmute(idle_suspend) }; + idle_suspend as u64 + }); + __bindgen_bitfield_unit.set(3usize, 61u8, { + let rsvd_z: u64 = unsafe { ::std::mem::transmute(rsvd_z) }; + rsvd_z as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_internal_activity_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_internal_activity_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_internal_activity_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_internal_activity_register), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_internal_activity_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_interrupt_state_register { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_x64_interrupt_state_register__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_interrupt_state_register__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_x64_interrupt_state_register__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_x64_interrupt_state_register__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_interrupt_state_register__bindgen_ty_1) + ) + ); +} +impl hv_x64_interrupt_state_register__bindgen_ty_1 { + #[inline] + pub fn interrupt_shadow(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_interrupt_shadow(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn nmi_masked(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_nmi_masked(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 62u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 62u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + interrupt_shadow: __u64, + nmi_masked: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let interrupt_shadow: u64 = unsafe { ::std::mem::transmute(interrupt_shadow) }; + interrupt_shadow as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let nmi_masked: u64 = unsafe { ::std::mem::transmute(nmi_masked) }; + nmi_masked as u64 + }); + __bindgen_bitfield_unit.set(2usize, 62u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_x64_interrupt_state_register() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_x64_interrupt_state_register)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_x64_interrupt_state_register)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_interrupt_state_register), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_x64_interrupt_state_register { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_pending_exception_event { + pub as_uint64: [__u64; 2usize], + pub __bindgen_anon_1: hv_x64_pending_exception_event__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_pending_exception_event__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub error_code: __u32, + pub exception_parameter: __u64, +} +#[test] +fn bindgen_test_layout_hv_x64_pending_exception_event__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_x64_pending_exception_event__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_pending_exception_event__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_exception_event__bindgen_ty_1), + "::", + stringify!(error_code) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exception_parameter) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_exception_event__bindgen_ty_1), + "::", + stringify!(exception_parameter) + ) + ); +} +impl hv_x64_pending_exception_event__bindgen_ty_1 { + #[inline] + pub fn event_pending(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_event_pending(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn event_type(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } + } + #[inline] + pub fn set_event_type(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 3u8, val as u64) + } + } + #[inline] + pub fn reserved0(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + } + #[inline] + pub fn set_reserved0(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn deliver_error_code(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + } + #[inline] + pub fn set_deliver_error_code(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved1(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 7u8) as u32) } + } + #[inline] + pub fn set_reserved1(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 7u8, val as u64) + } + } + #[inline] + pub fn vector(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_vector(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + event_pending: __u32, + event_type: __u32, + reserved0: __u32, + deliver_error_code: __u32, + reserved1: __u32, + vector: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let event_pending: u32 = unsafe { ::std::mem::transmute(event_pending) }; + event_pending as u64 + }); + __bindgen_bitfield_unit.set(1usize, 3u8, { + let event_type: u32 = unsafe { ::std::mem::transmute(event_type) }; + event_type as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; + reserved0 as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let deliver_error_code: u32 = unsafe { ::std::mem::transmute(deliver_error_code) }; + deliver_error_code as u64 + }); + __bindgen_bitfield_unit.set(9usize, 7u8, { + let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let vector: u32 = unsafe { ::std::mem::transmute(vector) }; + vector as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_x64_pending_exception_event() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_x64_pending_exception_event)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_x64_pending_exception_event)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_exception_event), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_x64_pending_exception_event { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_pending_virtualization_fault_event { + pub as_uint64: [__u64; 2usize], + pub __bindgen_anon_1: hv_x64_pending_virtualization_fault_event__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_x64_pending_virtualization_fault_event__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub code: __u32, + pub parameter1: __u64, +} +#[test] +fn bindgen_test_layout_hv_x64_pending_virtualization_fault_event__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1), + "::", + stringify!(code) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parameter1) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1), + "::", + stringify!(parameter1) + ) + ); +} +impl hv_x64_pending_virtualization_fault_event__bindgen_ty_1 { + #[inline] + pub fn event_pending(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_event_pending(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn event_type(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } + } + #[inline] + pub fn set_event_type(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 3u8, val as u64) + } + } + #[inline] + pub fn reserved0(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + } + #[inline] + pub fn set_reserved0(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn reserved1(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_reserved1(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn parameter0(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_parameter0(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + event_pending: __u32, + event_type: __u32, + reserved0: __u32, + reserved1: __u32, + parameter0: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let event_pending: u32 = unsafe { ::std::mem::transmute(event_pending) }; + event_pending as u64 + }); + __bindgen_bitfield_unit.set(1usize, 3u8, { + let event_type: u32 = unsafe { ::std::mem::transmute(event_type) }; + event_type as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; + reserved0 as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; + reserved1 as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let parameter0: u32 = unsafe { ::std::mem::transmute(parameter0) }; + parameter0 as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_x64_pending_virtualization_fault_event() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(hv_x64_pending_virtualization_fault_event) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(hv_x64_pending_virtualization_fault_event) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_virtualization_fault_event), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_x64_pending_virtualization_fault_event { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_x64_pending_interruption_register { pub as_uint64: __u64, - pub __bindgen_anon_1: hv_explicit_suspend_register__bindgen_ty_1, + pub __bindgen_anon_1: hv_x64_pending_interruption_register__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_explicit_suspend_register__bindgen_ty_1 { +pub struct hv_x64_pending_interruption_register__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub error_code: __u32, } #[test] -fn bindgen_test_layout_hv_explicit_suspend_register__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_pending_interruption_register__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, concat!( "Size of: ", - stringify!(hv_explicit_suspend_register__bindgen_ty_1) + stringify!(hv_x64_pending_interruption_register__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_explicit_suspend_register__bindgen_ty_1) + stringify!(hv_x64_pending_interruption_register__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_pending_interruption_register__bindgen_ty_1), + "::", + stringify!(error_code) ) ); } -impl hv_explicit_suspend_register__bindgen_ty_1 { +impl hv_x64_pending_interruption_register__bindgen_ty_1 { #[inline] - pub fn suspended(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn interruption_pending(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_suspended(&mut self, val: __u64) { + pub fn set_interruption_pending(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); + let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + pub fn interruption_type(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } } #[inline] - pub fn set_reserved(&mut self, val: __u64) { + pub fn set_interruption_type(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 63u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 3u8, val as u64) + } + } + #[inline] + pub fn deliver_error_code(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_deliver_error_code(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub fn instruction_length(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 4u8) as u32) } + } + #[inline] + pub fn set_instruction_length(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 4u8, val as u64) + } + } + #[inline] + pub fn nested_event(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + } + #[inline] + pub fn set_nested_event(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 6u8, val as u64) + } + } + #[inline] + pub fn interruption_vector(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_interruption_vector(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) } } #[inline] pub fn new_bitfield_1( - suspended: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + interruption_pending: __u32, + interruption_type: __u32, + deliver_error_code: __u32, + instruction_length: __u32, + nested_event: __u32, + reserved: __u32, + interruption_vector: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; - suspended as u64 + let interruption_pending: u32 = unsafe { ::std::mem::transmute(interruption_pending) }; + interruption_pending as u64 }); - __bindgen_bitfield_unit.set(1usize, 63u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + __bindgen_bitfield_unit.set(1usize, 3u8, { + let interruption_type: u32 = unsafe { ::std::mem::transmute(interruption_type) }; + interruption_type as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let deliver_error_code: u32 = unsafe { ::std::mem::transmute(deliver_error_code) }; + deliver_error_code as u64 + }); + __bindgen_bitfield_unit.set(5usize, 4u8, { + let instruction_length: u32 = unsafe { ::std::mem::transmute(instruction_length) }; + instruction_length as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let nested_event: u32 = unsafe { ::std::mem::transmute(nested_event) }; + nested_event as u64 + }); + __bindgen_bitfield_unit.set(10usize, 6u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; reserved as u64 }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let interruption_vector: u32 = unsafe { ::std::mem::transmute(interruption_vector) }; + interruption_vector as u64 + }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_explicit_suspend_register() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_pending_interruption_register() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_explicit_suspend_register)) + concat!( + "Size of: ", + stringify!(hv_x64_pending_interruption_register) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_explicit_suspend_register)) + concat!( + "Alignment of ", + stringify!(hv_x64_pending_interruption_register) + ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_explicit_suspend_register), + stringify!(hv_x64_pending_interruption_register), "::", stringify!(as_uint64) ) ); } -impl Default for hv_explicit_suspend_register { +impl Default for hv_x64_pending_interruption_register { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -4414,102 +6708,119 @@ impl Default for hv_explicit_suspend_register { } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_intercept_suspend_register { +pub union hv_x64_register_sev_control { pub as_uint64: __u64, - pub __bindgen_anon_1: hv_intercept_suspend_register__bindgen_ty_1, + pub __bindgen_anon_1: hv_x64_register_sev_control__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_intercept_suspend_register__bindgen_ty_1 { +pub struct hv_x64_register_sev_control__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_intercept_suspend_register__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_register_sev_control__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, concat!( "Size of: ", - stringify!(hv_intercept_suspend_register__bindgen_ty_1) + stringify!(hv_x64_register_sev_control__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_intercept_suspend_register__bindgen_ty_1) + stringify!(hv_x64_register_sev_control__bindgen_ty_1) ) ); } -impl hv_intercept_suspend_register__bindgen_ty_1 { +impl hv_x64_register_sev_control__bindgen_ty_1 { #[inline] - pub fn suspended(&self) -> __u64 { + pub fn enable_encrypted_state(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_suspended(&mut self, val: __u64) { + pub fn set_enable_encrypted_state(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + pub fn reserved_z(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_reserved(&mut self, val: __u64) { + pub fn set_reserved_z(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 63u8, val as u64) + self._bitfield_1.set(1usize, 11u8, val as u64) + } + } + #[inline] + pub fn vmsa_gpa_page_number(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } + } + #[inline] + pub fn set_vmsa_gpa_page_number(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 52u8, val as u64) } } #[inline] pub fn new_bitfield_1( - suspended: __u64, - reserved: __u64, + enable_encrypted_state: __u64, + reserved_z: __u64, + vmsa_gpa_page_number: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; - suspended as u64 + let enable_encrypted_state: u64 = + unsafe { ::std::mem::transmute(enable_encrypted_state) }; + enable_encrypted_state as u64 }); - __bindgen_bitfield_unit.set(1usize, 63u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 + __bindgen_bitfield_unit.set(1usize, 11u8, { + let reserved_z: u64 = unsafe { ::std::mem::transmute(reserved_z) }; + reserved_z as u64 + }); + __bindgen_bitfield_unit.set(12usize, 52u8, { + let vmsa_gpa_page_number: u64 = unsafe { ::std::mem::transmute(vmsa_gpa_page_number) }; + vmsa_gpa_page_number as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_intercept_suspend_register() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_register_sev_control() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_intercept_suspend_register)) + concat!("Size of: ", stringify!(hv_x64_register_sev_control)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_intercept_suspend_register)) + concat!("Alignment of ", stringify!(hv_x64_register_sev_control)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_suspend_register), + stringify!(hv_x64_register_sev_control), "::", stringify!(as_uint64) ) ); } -impl Default for hv_intercept_suspend_register { +impl Default for hv_x64_register_sev_control { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -4520,240 +6831,246 @@ impl Default for hv_intercept_suspend_register { } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_dispatch_suspend_register { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_dispatch_suspend_register__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_dispatch_suspend_register__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +pub union hv_register_value { + pub reg128: hv_u128, + pub reg64: __u64, + pub reg32: __u32, + pub reg16: __u16, + pub reg8: __u8, + pub fp: hv_x64_fp_register, + pub fp_control_status: hv_x64_fp_control_status_register, + pub xmm_control_status: hv_x64_xmm_control_status_register, + pub segment: hv_x64_segment_register, + pub table: hv_x64_table_register, + pub explicit_suspend: hv_explicit_suspend_register, + pub intercept_suspend: hv_intercept_suspend_register, + pub dispatch_suspend: hv_dispatch_suspend_register, + pub internal_activity: hv_internal_activity_register, + pub interrupt_state: hv_x64_interrupt_state_register, + pub pending_interruption: hv_x64_pending_interruption_register, + pub npiep_config: hv_x64_msr_npiep_config_contents, + pub pending_exception_event: hv_x64_pending_exception_event, + pub pending_virtualization_fault_event: hv_x64_pending_virtualization_fault_event, + pub sev_control: hv_x64_register_sev_control, } #[test] -fn bindgen_test_layout_hv_dispatch_suspend_register__bindgen_ty_1() { +fn bindgen_test_layout_hv_register_value() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_register_value)) + ); + assert_eq!( + ::std::mem::align_of::(), 8usize, + concat!("Alignment of ", stringify!(hv_register_value)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reg128) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_dispatch_suspend_register__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(reg128) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).reg64) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_dispatch_suspend_register__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(reg64) ) ); -} -impl hv_dispatch_suspend_register__bindgen_ty_1 { - #[inline] - pub fn suspended(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_suspended(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 63u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - suspended: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let suspended: u64 = unsafe { ::std::mem::transmute(suspended) }; - suspended as u64 - }); - __bindgen_bitfield_unit.set(1usize, 63u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } -} -#[test] -fn bindgen_test_layout_hv_dispatch_suspend_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_dispatch_suspend_register)) + unsafe { ::std::ptr::addr_of!((*ptr).reg32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(reg32) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_dispatch_suspend_register)) + unsafe { ::std::ptr::addr_of!((*ptr).reg16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(reg16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reg8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(reg8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(fp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fp_control_status) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(fp_control_status) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xmm_control_status) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(xmm_control_status) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).segment) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(segment) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).table) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(table) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).explicit_suspend) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(explicit_suspend) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).intercept_suspend) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(intercept_suspend) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).dispatch_suspend) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(dispatch_suspend) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).internal_activity) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(internal_activity) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).interrupt_state) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_dispatch_suspend_register), + stringify!(hv_register_value), "::", - stringify!(as_uint64) + stringify!(interrupt_state) ) ); -} -impl Default for hv_dispatch_suspend_register { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_internal_activity_register { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_internal_activity_register__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_internal_activity_register__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} -#[test] -fn bindgen_test_layout_hv_internal_activity_register__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pending_interruption) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_internal_activity_register__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(pending_interruption) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).npiep_config) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_internal_activity_register__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(npiep_config) ) ); -} -impl hv_internal_activity_register__bindgen_ty_1 { - #[inline] - pub fn startup_suspend(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_startup_suspend(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn halt_suspend(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } - } - #[inline] - pub fn set_halt_suspend(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn idle_suspend(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } - } - #[inline] - pub fn set_idle_suspend(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn rsvd_z(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 61u8) as u64) } - } - #[inline] - pub fn set_rsvd_z(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 61u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - startup_suspend: __u64, - halt_suspend: __u64, - idle_suspend: __u64, - rsvd_z: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let startup_suspend: u64 = unsafe { ::std::mem::transmute(startup_suspend) }; - startup_suspend as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let halt_suspend: u64 = unsafe { ::std::mem::transmute(halt_suspend) }; - halt_suspend as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let idle_suspend: u64 = unsafe { ::std::mem::transmute(idle_suspend) }; - idle_suspend as u64 - }); - __bindgen_bitfield_unit.set(3usize, 61u8, { - let rsvd_z: u64 = unsafe { ::std::mem::transmute(rsvd_z) }; - rsvd_z as u64 - }); - __bindgen_bitfield_unit - } -} -#[test] -fn bindgen_test_layout_hv_internal_activity_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_internal_activity_register)) + unsafe { ::std::ptr::addr_of!((*ptr).pending_exception_event) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(pending_exception_event) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_internal_activity_register)) + unsafe { + ::std::ptr::addr_of!((*ptr).pending_virtualization_fault_event) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_register_value), + "::", + stringify!(pending_virtualization_fault_event) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sev_control) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_internal_activity_register), + stringify!(hv_register_value), "::", - stringify!(as_uint64) + stringify!(sev_control) ) ); } -impl Default for hv_internal_activity_register { +impl Default for hv_register_value { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -4762,120 +7079,70 @@ impl Default for hv_internal_activity_register { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_interrupt_state_register { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_interrupt_state_register__bindgen_ty_1, -} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_interrupt_state_register__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} -#[test] -fn bindgen_test_layout_hv_x64_interrupt_state_register__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_interrupt_state_register__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(hv_x64_interrupt_state_register__bindgen_ty_1) - ) - ); -} -impl hv_x64_interrupt_state_register__bindgen_ty_1 { - #[inline] - pub fn interrupt_shadow(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_interrupt_shadow(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn nmi_masked(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } - } - #[inline] - pub fn set_nmi_masked(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 62u8) as u64) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 62u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - interrupt_shadow: __u64, - nmi_masked: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let interrupt_shadow: u64 = unsafe { ::std::mem::transmute(interrupt_shadow) }; - interrupt_shadow as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let nmi_masked: u64 = unsafe { ::std::mem::transmute(nmi_masked) }; - nmi_masked as u64 - }); - __bindgen_bitfield_unit.set(2usize, 62u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } +#[derive(Copy, Clone)] +pub struct hv_register_assoc { + pub name: __u32, + pub reserved1: __u32, + pub reserved2: __u64, + pub value: hv_register_value, } #[test] -fn bindgen_test_layout_hv_x64_interrupt_state_register() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_register_assoc() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_x64_interrupt_state_register)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(hv_register_assoc)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_x64_interrupt_state_register)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_register_assoc)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_interrupt_state_register), + stringify!(hv_register_assoc), "::", - stringify!(as_uint64) + stringify!(name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_register_assoc), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_register_assoc), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_register_assoc), + "::", + stringify!(value) ) ); } -impl Default for hv_x64_interrupt_state_register { +impl Default for hv_register_assoc { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -4884,193 +7151,186 @@ impl Default for hv_x64_interrupt_state_register { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_pending_exception_event { - pub as_uint64: [__u64; 2usize], - pub __bindgen_anon_1: hv_x64_pending_exception_event__bindgen_ty_1, -} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_pending_exception_event__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub error_code: __u32, - pub exception_parameter: __u64, +pub struct hv_input_get_vp_registers { + pub partition_id: __u64, + pub vp_index: __u32, + pub input_vtl: hv_input_vtl, + pub rsvd_z8: __u8, + pub rsvd_z16: __u16, + pub names: __IncompleteArrayField<__u32>, } #[test] -fn bindgen_test_layout_hv_x64_pending_exception_event__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_get_vp_registers() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, + concat!("Size of: ", stringify!(hv_input_get_vp_registers)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_get_vp_registers)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_x64_pending_exception_event__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_input_get_vp_registers), + "::", + stringify!(partition_id) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, + 8usize, concat!( - "Alignment of ", - stringify!(hv_x64_pending_exception_event__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_input_get_vp_registers), + "::", + stringify!(vp_index) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).input_vtl) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_exception_event__bindgen_ty_1), + stringify!(hv_input_get_vp_registers), "::", - stringify!(error_code) + stringify!(input_vtl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_parameter) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z8) as usize - ptr as usize }, + 13usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_exception_event__bindgen_ty_1), + stringify!(hv_input_get_vp_registers), "::", - stringify!(exception_parameter) + stringify!(rsvd_z8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z16) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(hv_input_get_vp_registers), + "::", + stringify!(rsvd_z16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).names) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_input_get_vp_registers), + "::", + stringify!(names) ) ); } -impl hv_x64_pending_exception_event__bindgen_ty_1 { - #[inline] - pub fn event_pending(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_event_pending(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn event_type(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } - } - #[inline] - pub fn set_event_type(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 3u8, val as u64) - } - } - #[inline] - pub fn reserved0(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } - } - #[inline] - pub fn set_reserved0(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 4u8, val as u64) - } - } - #[inline] - pub fn deliver_error_code(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } - } - #[inline] - pub fn set_deliver_error_code(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved1(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 7u8) as u32) } - } - #[inline] - pub fn set_reserved1(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 7u8, val as u64) - } - } - #[inline] - pub fn vector(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } - } - #[inline] - pub fn set_vector(&mut self, val: __u32) { +impl Default for hv_input_get_vp_registers { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn new_bitfield_1( - event_pending: __u32, - event_type: __u32, - reserved0: __u32, - deliver_error_code: __u32, - reserved1: __u32, - vector: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let event_pending: u32 = unsafe { ::std::mem::transmute(event_pending) }; - event_pending as u64 - }); - __bindgen_bitfield_unit.set(1usize, 3u8, { - let event_type: u32 = unsafe { ::std::mem::transmute(event_type) }; - event_type as u64 - }); - __bindgen_bitfield_unit.set(4usize, 4u8, { - let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; - reserved0 as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let deliver_error_code: u32 = unsafe { ::std::mem::transmute(deliver_error_code) }; - deliver_error_code as u64 - }); - __bindgen_bitfield_unit.set(9usize, 7u8, { - let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; - reserved1 as u64 - }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let vector: u32 = unsafe { ::std::mem::transmute(vector) }; - vector as u64 - }); - __bindgen_bitfield_unit - } +} +#[repr(C, packed)] +pub struct hv_input_set_vp_registers { + pub partition_id: __u64, + pub vp_index: __u32, + pub input_vtl: hv_input_vtl, + pub rsvd_z8: __u8, + pub rsvd_z16: __u16, + pub elements: __IncompleteArrayField, } #[test] -fn bindgen_test_layout_hv_x64_pending_exception_event() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_set_vp_registers() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(hv_x64_pending_exception_event)) + concat!("Size of: ", stringify!(hv_input_set_vp_registers)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_x64_pending_exception_event)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_set_vp_registers)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_exception_event), + stringify!(hv_input_set_vp_registers), "::", - stringify!(as_uint64) + stringify!(partition_id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_input_set_vp_registers), + "::", + stringify!(vp_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).input_vtl) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hv_input_set_vp_registers), + "::", + stringify!(input_vtl) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z8) as usize - ptr as usize }, + 13usize, + concat!( + "Offset of field: ", + stringify!(hv_input_set_vp_registers), + "::", + stringify!(rsvd_z8) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z16) as usize - ptr as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(hv_input_set_vp_registers), + "::", + stringify!(rsvd_z16) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).elements) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_input_set_vp_registers), + "::", + stringify!(elements) ) ); } -impl Default for hv_x64_pending_exception_event { +impl Default for hv_input_set_vp_registers { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -5079,183 +7339,234 @@ impl Default for hv_x64_pending_exception_event { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_pending_virtualization_fault_event { - pub as_uint64: [__u64; 2usize], - pub __bindgen_anon_1: hv_x64_pending_virtualization_fault_event__bindgen_ty_1, -} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_pending_virtualization_fault_event__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub code: __u32, - pub parameter1: __u64, +pub struct hv_send_ipi { + pub vector: __u32, + pub reserved: __u32, + pub cpu_mask: __u64, } #[test] -fn bindgen_test_layout_hv_x64_pending_virtualization_fault_event__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_send_ipi() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, - concat!( - "Size of: ", - stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1) - ) + concat!("Size of: ", stringify!(hv_send_ipi)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_send_ipi)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vector) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_send_ipi), + "::", + stringify!(vector) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1), + stringify!(hv_send_ipi), "::", - stringify!(code) + stringify!(reserved) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parameter1) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cpu_mask) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_virtualization_fault_event__bindgen_ty_1), + stringify!(hv_send_ipi), "::", - stringify!(parameter1) + stringify!(cpu_mask) ) ); } -impl hv_x64_pending_virtualization_fault_event__bindgen_ty_1 { - #[inline] - pub fn event_pending(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_event_pending(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn event_type(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } - } - #[inline] - pub fn set_event_type(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 3u8, val as u64) - } - } - #[inline] - pub fn reserved0(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } - } - #[inline] - pub fn set_reserved0(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 4u8, val as u64) - } - } - #[inline] - pub fn reserved1(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } - } - #[inline] - pub fn set_reserved1(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 8u8, val as u64) - } - } - #[inline] - pub fn parameter0(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } - } - #[inline] - pub fn set_parameter0(&mut self, val: __u32) { +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_IO_PORT: hv_intercept_type = 0; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_MSR: hv_intercept_type = 1; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_CPUID: hv_intercept_type = 2; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_EXCEPTION: hv_intercept_type = 3; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_RESERVED0: hv_intercept_type = 4; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_MMIO: hv_intercept_type = 5; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_GLOBAL_CPUID: hv_intercept_type = 6; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_SMI: hv_intercept_type = 7; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_HYPERCALL: hv_intercept_type = 8; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_INIT_SIPI: hv_intercept_type = 9; +pub const hv_intercept_type_HV_INTERCEPT_MC_UPDATE_PATCH_LEVEL_MSR_READ: hv_intercept_type = 10; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_WRITE: hv_intercept_type = 11; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_MSR_INDEX: hv_intercept_type = 12; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_MAX: hv_intercept_type = 13; +pub const hv_intercept_type_HV_INTERCEPT_TYPE_INVALID: hv_intercept_type = 4294967295; +pub type hv_intercept_type = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_intercept_parameters { + pub as_uint64: __u64, + pub io_port: __u16, + pub cpuid_index: __u32, + pub apic_write_mask: __u32, + pub exception_vector: __u16, + pub msr_index: __u32, +} +#[test] +fn bindgen_test_layout_hv_intercept_parameters() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_intercept_parameters)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_intercept_parameters)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(as_uint64) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).io_port) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(io_port) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cpuid_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(cpuid_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).apic_write_mask) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(apic_write_mask) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exception_vector) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(exception_vector) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).msr_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_intercept_parameters), + "::", + stringify!(msr_index) + ) + ); +} +impl Default for hv_intercept_parameters { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn new_bitfield_1( - event_pending: __u32, - event_type: __u32, - reserved0: __u32, - reserved1: __u32, - parameter0: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let event_pending: u32 = unsafe { ::std::mem::transmute(event_pending) }; - event_pending as u64 - }); - __bindgen_bitfield_unit.set(1usize, 3u8, { - let event_type: u32 = unsafe { ::std::mem::transmute(event_type) }; - event_type as u64 - }); - __bindgen_bitfield_unit.set(4usize, 4u8, { - let reserved0: u32 = unsafe { ::std::mem::transmute(reserved0) }; - reserved0 as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let reserved1: u32 = unsafe { ::std::mem::transmute(reserved1) }; - reserved1 as u64 - }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let parameter0: u32 = unsafe { ::std::mem::transmute(parameter0) }; - parameter0 as u64 - }); - __bindgen_bitfield_unit - } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_install_intercept { + pub partition_id: __u64, + pub access_type: __u32, + pub intercept_type: __u32, + pub intercept_parameter: hv_intercept_parameters, } #[test] -fn bindgen_test_layout_hv_x64_pending_virtualization_fault_event() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_install_intercept() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_install_intercept)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_install_intercept)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_x64_pending_virtualization_fault_event) + "Offset of field: ", + stringify!(hv_input_install_intercept), + "::", + stringify!(partition_id) ) ); assert_eq!( - ::std::mem::align_of::(), + unsafe { ::std::ptr::addr_of!((*ptr).access_type) as usize - ptr as usize }, 8usize, concat!( - "Alignment of ", - stringify!(hv_x64_pending_virtualization_fault_event) + "Offset of field: ", + stringify!(hv_input_install_intercept), + "::", + stringify!(access_type) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).intercept_type) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_virtualization_fault_event), + stringify!(hv_input_install_intercept), "::", - stringify!(as_uint64) + stringify!(intercept_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).intercept_parameter) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_input_install_intercept), + "::", + stringify!(intercept_parameter) ) ); } -impl Default for hv_x64_pending_virtualization_fault_event { +impl Default for hv_input_install_intercept { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -5264,204 +7575,124 @@ impl Default for hv_x64_pending_virtualization_fault_event { } } } +pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_GLOBAL_SYSTEM_EVENTS: hv_eventlog_type = 0; +pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_LOCAL_DIAGNOSTICS: hv_eventlog_type = 1; +pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_SYSTEM_DIAGNOSTICS: hv_eventlog_type = 2; +pub type hv_eventlog_type = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] -pub union hv_x64_pending_interruption_register { +pub union hv_x64_register_sev_ghcb { pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_pending_interruption_register__bindgen_ty_1, + pub __bindgen_anon_1: hv_x64_register_sev_ghcb__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_pending_interruption_register__bindgen_ty_1 { +pub struct hv_x64_register_sev_ghcb__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub error_code: __u32, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_x64_pending_interruption_register__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_x64_register_sev_ghcb__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, concat!( "Size of: ", - stringify!(hv_x64_pending_interruption_register__bindgen_ty_1) + stringify!(hv_x64_register_sev_ghcb__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_x64_pending_interruption_register__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_pending_interruption_register__bindgen_ty_1), - "::", - stringify!(error_code) + stringify!(hv_x64_register_sev_ghcb__bindgen_ty_1) ) ); } -impl hv_x64_pending_interruption_register__bindgen_ty_1 { +impl hv_x64_register_sev_ghcb__bindgen_ty_1 { #[inline] - pub fn interruption_pending(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + pub fn enabled(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_interruption_pending(&mut self, val: __u32) { + pub fn set_enabled(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); + let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn interruption_type(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) } - } - #[inline] - pub fn set_interruption_type(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 3u8, val as u64) - } - } - #[inline] - pub fn deliver_error_code(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_deliver_error_code(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn instruction_length(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 4u8) as u32) } - } - #[inline] - pub fn set_instruction_length(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 4u8, val as u64) - } - } - #[inline] - pub fn nested_event(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } - } - #[inline] - pub fn set_nested_event(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u32) } + pub fn reservedz(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_reserved(&mut self, val: __u32) { + pub fn set_reservedz(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 6u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 11u8, val as u64) } } #[inline] - pub fn interruption_vector(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + pub fn page_number(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } } #[inline] - pub fn set_interruption_vector(&mut self, val: __u32) { + pub fn set_page_number(&mut self, val: __u64) { unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 16u8, val as u64) + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 52u8, val as u64) } } #[inline] pub fn new_bitfield_1( - interruption_pending: __u32, - interruption_type: __u32, - deliver_error_code: __u32, - instruction_length: __u32, - nested_event: __u32, - reserved: __u32, - interruption_vector: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + enabled: __u64, + reservedz: __u64, + page_number: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let interruption_pending: u32 = unsafe { ::std::mem::transmute(interruption_pending) }; - interruption_pending as u64 - }); - __bindgen_bitfield_unit.set(1usize, 3u8, { - let interruption_type: u32 = unsafe { ::std::mem::transmute(interruption_type) }; - interruption_type as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let deliver_error_code: u32 = unsafe { ::std::mem::transmute(deliver_error_code) }; - deliver_error_code as u64 - }); - __bindgen_bitfield_unit.set(5usize, 4u8, { - let instruction_length: u32 = unsafe { ::std::mem::transmute(instruction_length) }; - instruction_length as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let nested_event: u32 = unsafe { ::std::mem::transmute(nested_event) }; - nested_event as u64 - }); - __bindgen_bitfield_unit.set(10usize, 6u8, { - let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 + let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; + enabled as u64 }); - __bindgen_bitfield_unit.set(16usize, 16u8, { - let interruption_vector: u32 = unsafe { ::std::mem::transmute(interruption_vector) }; - interruption_vector as u64 + __bindgen_bitfield_unit.set(1usize, 11u8, { + let reservedz: u64 = unsafe { ::std::mem::transmute(reservedz) }; + reservedz as u64 + }); + __bindgen_bitfield_unit.set(12usize, 52u8, { + let page_number: u64 = unsafe { ::std::mem::transmute(page_number) }; + page_number as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_x64_pending_interruption_register() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_register_sev_ghcb() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_pending_interruption_register) - ) + concat!("Size of: ", stringify!(hv_x64_register_sev_ghcb)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!( - "Alignment of ", - stringify!(hv_x64_pending_interruption_register) - ) + concat!("Alignment of ", stringify!(hv_x64_register_sev_ghcb)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_pending_interruption_register), + stringify!(hv_x64_register_sev_ghcb), "::", stringify!(as_uint64) ) ); } -impl Default for hv_x64_pending_interruption_register { +impl Default for hv_x64_register_sev_ghcb { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -5472,64 +7703,64 @@ impl Default for hv_x64_pending_interruption_register { } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_x64_register_sev_control { +pub union hv_x64_register_sev_hv_doorbell { pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_register_sev_control__bindgen_ty_1, + pub __bindgen_anon_1: hv_x64_register_sev_hv_doorbell__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_register_sev_control__bindgen_ty_1 { +pub struct hv_x64_register_sev_hv_doorbell__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_x64_register_sev_control__bindgen_ty_1() { +fn bindgen_test_layout_hv_x64_register_sev_hv_doorbell__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, concat!( "Size of: ", - stringify!(hv_x64_register_sev_control__bindgen_ty_1) + stringify!(hv_x64_register_sev_hv_doorbell__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_x64_register_sev_control__bindgen_ty_1) + stringify!(hv_x64_register_sev_hv_doorbell__bindgen_ty_1) ) ); } -impl hv_x64_register_sev_control__bindgen_ty_1 { +impl hv_x64_register_sev_hv_doorbell__bindgen_ty_1 { #[inline] - pub fn enable_encrypted_state(&self) -> __u64 { + pub fn enabled(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_enable_encrypted_state(&mut self, val: __u64) { + pub fn set_enabled(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn reserved_z(&self) -> __u64 { + pub fn reservedz(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } } #[inline] - pub fn set_reserved_z(&mut self, val: __u64) { + pub fn set_reservedz(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(1usize, 11u8, val as u64) } } #[inline] - pub fn vmsa_gpa_page_number(&self) -> __u64 { + pub fn page_number(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } } #[inline] - pub fn set_vmsa_gpa_page_number(&mut self, val: __u64) { + pub fn set_page_number(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(12usize, 52u8, val as u64) @@ -5537,304 +7768,542 @@ impl hv_x64_register_sev_control__bindgen_ty_1 { } #[inline] pub fn new_bitfield_1( - enable_encrypted_state: __u64, - reserved_z: __u64, - vmsa_gpa_page_number: __u64, + enabled: __u64, + reservedz: __u64, + page_number: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let enable_encrypted_state: u64 = - unsafe { ::std::mem::transmute(enable_encrypted_state) }; - enable_encrypted_state as u64 + let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; + enabled as u64 }); __bindgen_bitfield_unit.set(1usize, 11u8, { - let reserved_z: u64 = unsafe { ::std::mem::transmute(reserved_z) }; - reserved_z as u64 + let reservedz: u64 = unsafe { ::std::mem::transmute(reservedz) }; + reservedz as u64 }); __bindgen_bitfield_unit.set(12usize, 52u8, { - let vmsa_gpa_page_number: u64 = unsafe { ::std::mem::transmute(vmsa_gpa_page_number) }; - vmsa_gpa_page_number as u64 + let page_number: u64 = unsafe { ::std::mem::transmute(page_number) }; + page_number as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_x64_register_sev_control() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_x64_register_sev_hv_doorbell() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_x64_register_sev_hv_doorbell)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_x64_register_sev_hv_doorbell)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_register_sev_hv_doorbell), + "::", + stringify!(as_uint64) + ) + ); +} +impl Default for hv_x64_register_sev_hv_doorbell { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_FAULT: + hv_unimplemented_msr_action = 0; +pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_IGNORE_WRITE_READ_ZERO: + hv_unimplemented_msr_action = 1; +pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_COUNT: + hv_unimplemented_msr_action = 2; +pub type hv_unimplemented_msr_action = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_connection_id { + pub asu32: __u32, + pub u: hv_connection_id__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_connection_id__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[test] +fn bindgen_test_layout_hv_connection_id__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_connection_id__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_connection_id__bindgen_ty_1)) + ); +} +impl hv_connection_id__bindgen_ty_1 { + #[inline] + pub fn id(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set_id(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(id: __u32, reserved: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let id: u32 = unsafe { ::std::mem::transmute(id) }; + id as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_connection_id() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_connection_id)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hv_connection_id)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).asu32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_connection_id), + "::", + stringify!(asu32) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_connection_id), + "::", + stringify!(u) + ) + ); +} +impl Default for hv_connection_id { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_unmap_gpa_pages { + pub target_partition_id: __u64, + pub target_gpa_base: __u64, + pub unmap_flags: __u32, + pub padding: __u32, +} +#[test] +fn bindgen_test_layout_hv_input_unmap_gpa_pages() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_unmap_gpa_pages)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_unmap_gpa_pages)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).target_partition_id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_input_unmap_gpa_pages), + "::", + stringify!(target_partition_id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).target_gpa_base) as usize - ptr as usize }, 8usize, - concat!("Size of: ", stringify!(hv_x64_register_sev_control)) + concat!( + "Offset of field: ", + stringify!(hv_input_unmap_gpa_pages), + "::", + stringify!(target_gpa_base) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_x64_register_sev_control)) + unsafe { ::std::ptr::addr_of!((*ptr).unmap_flags) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_input_unmap_gpa_pages), + "::", + stringify!(unmap_flags) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(hv_x64_register_sev_control), + stringify!(hv_input_unmap_gpa_pages), "::", - stringify!(as_uint64) + stringify!(padding) ) ); } -impl Default for hv_x64_register_sev_control { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} +pub const hv_generic_set_format_HV_GENERIC_SET_SPARSE_4K: hv_generic_set_format = 0; +pub const hv_generic_set_format_HV_GENERIC_SET_ALL: hv_generic_set_format = 1; +pub type hv_generic_set_format = ::std::os::raw::c_uint; +pub const hv_scheduler_type_HV_SCHEDULER_TYPE_LP: hv_scheduler_type = 1; +pub const hv_scheduler_type_HV_SCHEDULER_TYPE_LP_SMT: hv_scheduler_type = 2; +pub const hv_scheduler_type_HV_SCHEDULER_TYPE_CORE_SMT: hv_scheduler_type = 3; +pub const hv_scheduler_type_HV_SCHEDULER_TYPE_ROOT: hv_scheduler_type = 4; +pub const hv_scheduler_type_HV_SCHEDULER_TYPE_MAX: hv_scheduler_type = 5; +pub type hv_scheduler_type = ::std::os::raw::c_uint; +pub const hv_stats_object_type_HV_STATS_OBJECT_HYPERVISOR: hv_stats_object_type = 1; +pub const hv_stats_object_type_HV_STATS_OBJECT_LOGICAL_PROCESSOR: hv_stats_object_type = 2; +pub const hv_stats_object_type_HV_STATS_OBJECT_PARTITION: hv_stats_object_type = 65537; +pub const hv_stats_object_type_HV_STATS_OBJECT_VP: hv_stats_object_type = 65538; +pub type hv_stats_object_type = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] -pub union hv_register_value { - pub reg128: hv_u128, - pub reg64: __u64, - pub reg32: __u32, - pub reg16: __u16, - pub reg8: __u8, - pub fp: hv_x64_fp_register, - pub fp_control_status: hv_x64_fp_control_status_register, - pub xmm_control_status: hv_x64_xmm_control_status_register, - pub segment: hv_x64_segment_register, - pub table: hv_x64_table_register, - pub explicit_suspend: hv_explicit_suspend_register, - pub intercept_suspend: hv_intercept_suspend_register, - pub dispatch_suspend: hv_dispatch_suspend_register, - pub internal_activity: hv_internal_activity_register, - pub interrupt_state: hv_x64_interrupt_state_register, - pub pending_interruption: hv_x64_pending_interruption_register, - pub npiep_config: hv_x64_msr_npiep_config_contents, - pub pending_exception_event: hv_x64_pending_exception_event, - pub pending_virtualization_fault_event: hv_x64_pending_virtualization_fault_event, - pub sev_control: hv_x64_register_sev_control, +pub union hv_stats_object_identity { + pub hv: hv_stats_object_identity__bindgen_ty_1, + pub lp: hv_stats_object_identity__bindgen_ty_2, + pub partition: hv_stats_object_identity__bindgen_ty_3, + pub vp: hv_stats_object_identity__bindgen_ty_4, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_stats_object_identity__bindgen_ty_1 { + pub reserved: [__u8; 16usize], } #[test] -fn bindgen_test_layout_hv_register_value() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(hv_register_value)) + concat!( + "Size of: ", + stringify!(hv_stats_object_identity__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_register_value)) + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_stats_object_identity__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg128) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_1), "::", - stringify!(reg128) + stringify!(reserved) ) ); +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_stats_object_identity__bindgen_ty_2 { + pub lp_index: __u32, + pub reserved: [__u8; 12usize], +} +#[test] +fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_2() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg64) as usize - ptr as usize }, - 0usize, + ::std::mem::size_of::(), + 16usize, concat!( - "Offset of field: ", - stringify!(hv_register_value), - "::", - stringify!(reg64) + "Size of: ", + stringify!(hv_stats_object_identity__bindgen_ty_2) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg32) as usize - ptr as usize }, - 0usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_register_value), - "::", - stringify!(reg32) + "Alignment of ", + stringify!(hv_stats_object_identity__bindgen_ty_2) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg16) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_2), "::", - stringify!(reg16) + stringify!(lp_index) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg8) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_2), "::", - stringify!(reg8) + stringify!(reserved) ) ); +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_stats_object_identity__bindgen_ty_3 { + pub partition_id: __u64, + pub reserved: [__u8; 4usize], + pub flags: __u16, + pub reserved1: [__u8; 2usize], +} +#[test] +fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_3() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp) as usize - ptr as usize }, - 0usize, + ::std::mem::size_of::(), + 16usize, concat!( - "Offset of field: ", - stringify!(hv_register_value), - "::", - stringify!(fp) + "Size of: ", + stringify!(hv_stats_object_identity__bindgen_ty_3) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_control_status) as usize - ptr as usize }, - 0usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_register_value), - "::", - stringify!(fp_control_status) + "Alignment of ", + stringify!(hv_stats_object_identity__bindgen_ty_3) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_control_status) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_3), "::", - stringify!(xmm_control_status) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).segment) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_3), "::", - stringify!(segment) + stringify!(reserved) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).table) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_3), "::", - stringify!(table) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).explicit_suspend) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 14usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_3), "::", - stringify!(explicit_suspend) + stringify!(reserved1) ) ); +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_stats_object_identity__bindgen_ty_4 { + pub partition_id: __u64, + pub vp_index: __u32, + pub flags: __u16, + pub reserved: [__u8; 2usize], +} +#[test] +fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_4() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_suspend) as usize - ptr as usize }, - 0usize, + ::std::mem::size_of::(), + 16usize, concat!( - "Offset of field: ", - stringify!(hv_register_value), - "::", - stringify!(intercept_suspend) + "Size of: ", + stringify!(hv_stats_object_identity__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_stats_object_identity__bindgen_ty_4) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dispatch_suspend) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_4), "::", - stringify!(dispatch_suspend) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internal_activity) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_4), "::", - stringify!(internal_activity) + stringify!(vp_index) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interrupt_state) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_4), "::", - stringify!(interrupt_state) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pending_interruption) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 14usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity__bindgen_ty_4), "::", - stringify!(pending_interruption) + stringify!(reserved) ) ); +} +#[test] +fn bindgen_test_layout_hv_stats_object_identity() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_stats_object_identity)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).npiep_config) as usize - ptr as usize }, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_stats_object_identity)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity), "::", - stringify!(npiep_config) + stringify!(hv) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pending_exception_event) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).lp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity), "::", - stringify!(pending_exception_event) + stringify!(lp) ) ); assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).pending_virtualization_fault_event) as usize - ptr as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).partition) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity), "::", - stringify!(pending_virtualization_fault_event) + stringify!(partition) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sev_control) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vp) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_value), + stringify!(hv_stats_object_identity), "::", - stringify!(sev_control) + stringify!(vp) ) ); } -impl Default for hv_register_value { +impl Default for hv_stats_object_identity { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -5843,70 +8312,229 @@ impl Default for hv_register_value { } } } +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PRIVILEGE_FLAGS: + hv_partition_property_code = 65536; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SYNTHETIC_PROC_FEATURES: + hv_partition_property_code = 65537; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SUSPEND: hv_partition_property_code = + 131072; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_RESERVE: hv_partition_property_code = + 131073; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_CAP: hv_partition_property_code = + 131074; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_WEIGHT: hv_partition_property_code = + 131075; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_GROUP_ID: + hv_partition_property_code = 131076; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_TIME_FREEZE: hv_partition_property_code = + 196611; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEBUG_CHANNEL_ID: + hv_partition_property_code = 262144; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VIRTUAL_TLB_PAGE_COUNT: + hv_partition_property_code = 327680; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VSM_CONFIG: hv_partition_property_code = + 327681; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ZERO_MEMORY_ON_RESET: + hv_partition_property_code = 327682; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSORS_PER_SOCKET: + hv_partition_property_code = 327683; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_NESTED_TLB_SIZE: + hv_partition_property_code = 327684; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_GPA_PAGE_ACCESS_TRACKING: + hv_partition_property_code = 327685; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VSM_PERMISSIONS_DIRTY_SINCE_LAST_QUERY : hv_partition_property_code = 327686 ; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SGX_LAUNCH_CONTROL_CONFIG: + hv_partition_property_code = 327687; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL0: + hv_partition_property_code = 327688; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL1: + hv_partition_property_code = 327689; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL2: + hv_partition_property_code = 327690; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL3: + hv_partition_property_code = 327691; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_STATE: + hv_partition_property_code = 327692; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_CONTROL: + hv_partition_property_code = 327693; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ALLOCATION_ID: + hv_partition_property_code = 327694; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_MONITORING_ID: + hv_partition_property_code = 327695; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_IMPLEMENTED_PHYSICAL_ADDRESS_BITS: + hv_partition_property_code = 327696; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_NON_ARCHITECTURAL_CORE_SHARING: + hv_partition_property_code = 327697; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_HYPERCALL_DOORBELL_PAGE: + hv_partition_property_code = 327698; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_POLICY: + hv_partition_property_code = 327700; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_UNIMPLEMENTED_MSR_ACTION: + hv_partition_property_code = 327703; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SEV_VMGEXIT_OFFLOADS: + hv_partition_property_code = 327714; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_VENDOR: + hv_partition_property_code = 393216; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES_DEPRECATED: + hv_partition_property_code = 393217; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_XSAVE_FEATURES: + hv_partition_property_code = 393218; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_CL_FLUSH_SIZE: + hv_partition_property_code = 393219; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ENLIGHTENMENT_MODIFICATIONS: + hv_partition_property_code = 393220; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_COMPATIBILITY_VERSION: + hv_partition_property_code = 393221; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PHYSICAL_ADDRESS_WIDTH: + hv_partition_property_code = 393222; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_XSAVE_STATES: + hv_partition_property_code = 393223; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_MAX_XSAVE_DATA_SIZE: + hv_partition_property_code = 393224; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_CLOCK_FREQUENCY: + hv_partition_property_code = 393225; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES0: + hv_partition_property_code = 393226; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES1: + hv_partition_property_code = 393227; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_GUEST_OS_ID: hv_partition_property_code = + 458752; +pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_VIRTUALIZATION_FEATURES: + hv_partition_property_code = 524288; +pub type hv_partition_property_code = ::std::os::raw::c_uint; +pub const hv_sleep_state_HV_SLEEP_STATE_S1: hv_sleep_state = 1; +pub const hv_sleep_state_HV_SLEEP_STATE_S2: hv_sleep_state = 2; +pub const hv_sleep_state_HV_SLEEP_STATE_S3: hv_sleep_state = 3; +pub const hv_sleep_state_HV_SLEEP_STATE_S4: hv_sleep_state = 4; +pub const hv_sleep_state_HV_SLEEP_STATE_S5: hv_sleep_state = 5; +pub const hv_sleep_state_HV_SLEEP_STATE_LOCK: hv_sleep_state = 6; +pub type hv_sleep_state = ::std::os::raw::c_uint; #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_register_assoc { - pub name: __u32, - pub reserved1: __u32, - pub reserved2: __u64, - pub value: hv_register_value, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_enter_sleep_state { + pub sleep_state: __u32, } #[test] -fn bindgen_test_layout_hv_register_assoc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_input_enter_sleep_state() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(hv_register_assoc)) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_input_enter_sleep_state)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_register_assoc)) + concat!("Alignment of ", stringify!(hv_input_enter_sleep_state)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sleep_state) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_register_assoc), + stringify!(hv_input_enter_sleep_state), "::", - stringify!(name) + stringify!(sleep_state) ) ); +} +pub const hv_system_property_HV_SYSTEM_PROPERTY_SLEEP_STATE: hv_system_property = 3; +pub const hv_system_property_HV_SYSTEM_PROPERTY_SCHEDULER_TYPE: hv_system_property = 15; +pub const hv_system_property_HV_DYNAMIC_PROCESSOR_FEATURE_PROPERTY: hv_system_property = 21; +pub const hv_system_property_HV_SYSTEM_PROPERTY_DIAGOSTICS_LOG_BUFFERS: hv_system_property = 28; +pub const hv_system_property_HV_SYSTEM_PROPERTY_CRASHDUMPAREA: hv_system_property = 47; +pub const hv_system_property_HV_SYSTEM_PROPERTY_DEVIRT_TRAMP_PA: hv_system_property = 52; +pub type hv_system_property = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_pfn_range { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_pfn_range__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_pfn_range__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[test] +fn bindgen_test_layout_hv_pfn_range__bindgen_ty_1() { assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_register_assoc), - "::", - stringify!(reserved1) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_pfn_range__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_pfn_range__bindgen_ty_1)) + ); +} +impl hv_pfn_range__bindgen_ty_1 { + #[inline] + pub fn base_pfn(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 40u8) as u64) } + } + #[inline] + pub fn set_base_pfn(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 40u8, val as u64) + } + } + #[inline] + pub fn add_pfns(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 24u8) as u64) } + } + #[inline] + pub fn set_add_pfns(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(40usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(base_pfn: __u64, add_pfns: __u64) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 40u8, { + let base_pfn: u64 = unsafe { ::std::mem::transmute(base_pfn) }; + base_pfn as u64 + }); + __bindgen_bitfield_unit.set(40usize, 24u8, { + let add_pfns: u64 = unsafe { ::std::mem::transmute(add_pfns) }; + add_pfns as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_pfn_range() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), 8usize, - concat!( - "Offset of field: ", - stringify!(hv_register_assoc), - "::", - stringify!(reserved2) - ) + concat!("Size of: ", stringify!(hv_pfn_range)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_pfn_range)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_register_assoc), + stringify!(hv_pfn_range), "::", - stringify!(value) + stringify!(as_uint64) ) ); } -impl Default for hv_register_assoc { +impl Default for hv_pfn_range { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -5916,91 +8544,129 @@ impl Default for hv_register_assoc { } } #[repr(C, packed)] -pub struct hv_input_get_vp_registers { - pub partition_id: __u64, - pub vp_index: __u32, - pub input_vtl: hv_input_vtl, - pub rsvd_z8: __u8, - pub rsvd_z16: __u16, - pub names: __IncompleteArrayField<__u32>, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_sleep_state_info { + pub sleep_state: __u32, + pub pm1a_slp_typ: __u8, + pub pm1b_slp_typ: __u8, } #[test] -fn bindgen_test_layout_hv_input_get_vp_registers() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_sleep_state_info() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_input_get_vp_registers)) + ::std::mem::size_of::(), + 6usize, + concat!("Size of: ", stringify!(hv_sleep_state_info)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_get_vp_registers)) + concat!("Alignment of ", stringify!(hv_sleep_state_info)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sleep_state) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_vp_registers), + stringify!(hv_sleep_state_info), "::", - stringify!(partition_id) + stringify!(sleep_state) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pm1a_slp_typ) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_input_get_vp_registers), + stringify!(hv_sleep_state_info), "::", - stringify!(vp_index) + stringify!(pm1a_slp_typ) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).input_vtl) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).pm1b_slp_typ) as usize - ptr as usize }, + 5usize, concat!( "Offset of field: ", - stringify!(hv_input_get_vp_registers), + stringify!(hv_sleep_state_info), "::", - stringify!(input_vtl) + stringify!(pm1b_slp_typ) + ) + ); +} +pub const hv_snp_status_HV_SNP_STATUS_NONE: hv_snp_status = 0; +pub const hv_snp_status_HV_SNP_STATUS_AVAILABLE: hv_snp_status = 1; +pub const hv_snp_status_HV_SNP_STATUS_INCOMPATIBLE: hv_snp_status = 2; +pub const hv_snp_status_HV_SNP_STATUS_PSP_UNAVAILABLE: hv_snp_status = 3; +pub const hv_snp_status_HV_SNP_STATUS_PSP_INIT_FAILED: hv_snp_status = 4; +pub const hv_snp_status_HV_SNP_STATUS_PSP_BAD_FW_VERSION: hv_snp_status = 5; +pub const hv_snp_status_HV_SNP_STATUS_BAD_CONFIGURATION: hv_snp_status = 6; +pub const hv_snp_status_HV_SNP_STATUS_PSP_FW_UPDATE_IN_PROGRESS: hv_snp_status = 7; +pub const hv_snp_status_HV_SNP_STATUS_PSP_RB_INIT_FAILED: hv_snp_status = 8; +pub const hv_snp_status_HV_SNP_STATUS_PSP_PLATFORM_STATUS_FAILED: hv_snp_status = 9; +pub const hv_snp_status_HV_SNP_STATUS_PSP_INIT_LATE_FAILED: hv_snp_status = 10; +pub type hv_snp_status = ::std::os::raw::c_uint; +pub const hv_dynamic_processor_feature_property_HV_X64_DYNAMIC_PROCESSOR_FEATURE_MAX_ENCRYPTED_PARTITIONS : hv_dynamic_processor_feature_property = 13 ; +pub const hv_dynamic_processor_feature_property_HV_X64_DYNAMIC_PROCESSOR_FEATURE_SNP_STATUS: + hv_dynamic_processor_feature_property = 16; +pub type hv_dynamic_processor_feature_property = ::std::os::raw::c_uint; +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_get_system_property { + pub property_id: __u32, + pub reserved: __u32, + pub __bindgen_anon_1: hv_input_get_system_property__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_input_get_system_property__bindgen_ty_1 { + pub as_uint64: __u64, + pub hv_processor_feature: __u32, +} +#[test] +fn bindgen_test_layout_hv_input_get_system_property__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_input_get_system_property__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z8) as usize - ptr as usize }, - 13usize, + ::std::mem::align_of::(), + 8usize, concat!( - "Offset of field: ", - stringify!(hv_input_get_vp_registers), - "::", - stringify!(rsvd_z8) + "Alignment of ", + stringify!(hv_input_get_system_property__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z16) as usize - ptr as usize }, - 14usize, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_vp_registers), + stringify!(hv_input_get_system_property__bindgen_ty_1), "::", - stringify!(rsvd_z16) + stringify!(as_uint64) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).names) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).hv_processor_feature) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_vp_registers), + stringify!(hv_input_get_system_property__bindgen_ty_1), "::", - stringify!(names) + stringify!(hv_processor_feature) ) ); } -impl Default for hv_input_get_vp_registers { +impl Default for hv_input_get_system_property__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6009,203 +8675,183 @@ impl Default for hv_input_get_vp_registers { } } } -#[repr(C, packed)] -pub struct hv_input_set_vp_registers { - pub partition_id: __u64, - pub vp_index: __u32, - pub input_vtl: hv_input_vtl, - pub rsvd_z8: __u8, - pub rsvd_z16: __u16, - pub elements: __IncompleteArrayField, -} #[test] -fn bindgen_test_layout_hv_input_set_vp_registers() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_get_system_property() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(hv_input_set_vp_registers)) + concat!("Size of: ", stringify!(hv_input_get_system_property)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_set_vp_registers)) + concat!("Alignment of ", stringify!(hv_input_get_system_property)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).property_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_set_vp_registers), + stringify!(hv_input_get_system_property), "::", - stringify!(partition_id) + stringify!(property_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_input_set_vp_registers), + stringify!(hv_input_get_system_property), "::", - stringify!(vp_index) + stringify!(reserved) ) ); +} +impl Default for hv_input_get_system_property { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_system_diag_log_buffer_config { + pub buffer_count: __u32, + pub buffer_size_in_pages: __u32, +} +#[test] +fn bindgen_test_layout_hv_system_diag_log_buffer_config() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).input_vtl) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hv_input_set_vp_registers), - "::", - stringify!(input_vtl) - ) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_system_diag_log_buffer_config)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z8) as usize - ptr as usize }, - 13usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_input_set_vp_registers), - "::", - stringify!(rsvd_z8) + "Alignment of ", + stringify!(hv_system_diag_log_buffer_config) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd_z16) as usize - ptr as usize }, - 14usize, + unsafe { ::std::ptr::addr_of!((*ptr).buffer_count) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_set_vp_registers), + stringify!(hv_system_diag_log_buffer_config), "::", - stringify!(rsvd_z16) + stringify!(buffer_count) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).elements) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).buffer_size_in_pages) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_input_set_vp_registers), + stringify!(hv_system_diag_log_buffer_config), "::", - stringify!(elements) + stringify!(buffer_size_in_pages) ) ); } -impl Default for hv_input_set_vp_registers { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_output_get_system_property { + pub __bindgen_anon_1: hv_output_get_system_property__bindgen_ty_1, } -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_IO_PORT: hv_intercept_type = 0; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_MSR: hv_intercept_type = 1; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_CPUID: hv_intercept_type = 2; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_EXCEPTION: hv_intercept_type = 3; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_RESERVED0: hv_intercept_type = 4; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_MMIO: hv_intercept_type = 5; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_GLOBAL_CPUID: hv_intercept_type = 6; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_SMI: hv_intercept_type = 7; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_HYPERCALL: hv_intercept_type = 8; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_INIT_SIPI: hv_intercept_type = 9; -pub const hv_intercept_type_HV_INTERCEPT_MC_UPDATE_PATCH_LEVEL_MSR_READ: hv_intercept_type = 10; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_APIC_WRITE: hv_intercept_type = 11; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_X64_MSR_INDEX: hv_intercept_type = 12; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_MAX: hv_intercept_type = 13; -pub const hv_intercept_type_HV_INTERCEPT_TYPE_INVALID: hv_intercept_type = 4294967295; -pub type hv_intercept_type = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] -pub union hv_intercept_parameters { - pub as_uint64: __u64, - pub io_port: __u16, - pub cpuid_index: __u32, - pub apic_write_mask: __u32, - pub exception_vector: __u16, - pub msr_index: __u32, +pub union hv_output_get_system_property__bindgen_ty_1 { + pub scheduler_type: __u32, + pub hv_diagbuf_info: hv_system_diag_log_buffer_config, + pub hv_processor_feature_value: __u64, + pub hv_cda_info: hv_pfn_range, + pub hv_tramp_pa: __u64, } #[test] -fn bindgen_test_layout_hv_intercept_parameters() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_output_get_system_property__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_intercept_parameters)) + concat!( + "Size of: ", + stringify!(hv_output_get_system_property__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_intercept_parameters)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, concat!( - "Offset of field: ", - stringify!(hv_intercept_parameters), - "::", - stringify!(as_uint64) + "Alignment of ", + stringify!(hv_output_get_system_property__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).io_port) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).scheduler_type) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_parameters), + stringify!(hv_output_get_system_property__bindgen_ty_1), "::", - stringify!(io_port) + stringify!(scheduler_type) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_index) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hv_diagbuf_info) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_parameters), + stringify!(hv_output_get_system_property__bindgen_ty_1), "::", - stringify!(cpuid_index) + stringify!(hv_diagbuf_info) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_write_mask) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hv_processor_feature_value) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_parameters), + stringify!(hv_output_get_system_property__bindgen_ty_1), "::", - stringify!(apic_write_mask) + stringify!(hv_processor_feature_value) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_vector) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hv_cda_info) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_parameters), + stringify!(hv_output_get_system_property__bindgen_ty_1), "::", - stringify!(exception_vector) + stringify!(hv_cda_info) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_index) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hv_tramp_pa) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_intercept_parameters), + stringify!(hv_output_get_system_property__bindgen_ty_1), "::", - stringify!(msr_index) + stringify!(hv_tramp_pa) ) ); } -impl Default for hv_intercept_parameters { +impl Default for hv_output_get_system_property__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6214,71 +8860,73 @@ impl Default for hv_intercept_parameters { } } } -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_install_intercept { - pub partition_id: __u64, - pub access_type: __u32, - pub intercept_type: __u32, - pub intercept_parameter: hv_intercept_parameters, -} #[test] -fn bindgen_test_layout_hv_input_install_intercept() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_output_get_system_property() { assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_install_intercept)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_output_get_system_property)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_install_intercept)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_input_install_intercept), - "::", - stringify!(partition_id) - ) + concat!("Alignment of ", stringify!(hv_output_get_system_property)) ); +} +impl Default for hv_output_get_system_property { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_set_system_property { + pub property_id: __u32, + pub reserved: __u32, + pub __bindgen_anon_1: hv_input_set_system_property__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_input_set_system_property__bindgen_ty_1 { + pub set_sleep_state_info: hv_sleep_state_info, +} +#[test] +fn bindgen_test_layout_hv_input_set_system_property__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).access_type) as usize - ptr as usize }, - 8usize, + ::std::mem::size_of::(), + 6usize, concat!( - "Offset of field: ", - stringify!(hv_input_install_intercept), - "::", - stringify!(access_type) + "Size of: ", + stringify!(hv_input_set_system_property__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_type) as usize - ptr as usize }, - 12usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_input_install_intercept), - "::", - stringify!(intercept_type) + "Alignment of ", + stringify!(hv_input_set_system_property__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_parameter) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).set_sleep_state_info) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_install_intercept), + stringify!(hv_input_set_system_property__bindgen_ty_1), "::", - stringify!(intercept_parameter) + stringify!(set_sleep_state_info) ) ); } -impl Default for hv_input_install_intercept { +impl Default for hv_input_set_system_property__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6287,124 +8935,105 @@ impl Default for hv_input_install_intercept { } } } -pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_GLOBAL_SYSTEM_EVENTS: hv_eventlog_type = 0; -pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_LOCAL_DIAGNOSTICS: hv_eventlog_type = 1; -pub const hv_eventlog_type_HV_EVENT_LOG_TYPE_SYSTEM_DIAGNOSTICS: hv_eventlog_type = 2; -pub type hv_eventlog_type = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_register_sev_ghcb { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_register_sev_ghcb__bindgen_ty_1, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_register_sev_ghcb__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} #[test] -fn bindgen_test_layout_hv_x64_register_sev_ghcb__bindgen_ty_1() { +fn bindgen_test_layout_hv_input_set_system_property() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 14usize, + concat!("Size of: ", stringify!(hv_input_set_system_property)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_set_system_property)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).property_id) as usize - ptr as usize }, + 0usize, concat!( - "Size of: ", - stringify!(hv_x64_register_sev_ghcb__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_input_set_system_property), + "::", + stringify!(property_id) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 4usize, concat!( - "Alignment of ", - stringify!(hv_x64_register_sev_ghcb__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_input_set_system_property), + "::", + stringify!(reserved) ) ); } -impl hv_x64_register_sev_ghcb__bindgen_ty_1 { - #[inline] - pub fn enabled(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_enabled(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reservedz(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } - } - #[inline] - pub fn set_reservedz(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 11u8, val as u64) - } - } - #[inline] - pub fn page_number(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } - } - #[inline] - pub fn set_page_number(&mut self, val: __u64) { +impl Default for hv_input_set_system_property { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 52u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn new_bitfield_1( - enabled: __u64, - reservedz: __u64, - page_number: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; - enabled as u64 - }); - __bindgen_bitfield_unit.set(1usize, 11u8, { - let reservedz: u64 = unsafe { ::std::mem::transmute(reservedz) }; - reservedz as u64 - }); - __bindgen_bitfield_unit.set(12usize, 52u8, { - let page_number: u64 = unsafe { ::std::mem::transmute(page_number) }; - page_number as u64 - }); - __bindgen_bitfield_unit - } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_map_stats_page { + pub type_: __u32, + pub padding: __u32, + pub identity: hv_stats_object_identity, } #[test] -fn bindgen_test_layout_hv_x64_register_sev_ghcb() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_map_stats_page() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_x64_register_sev_ghcb)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_map_stats_page)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_x64_register_sev_ghcb)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_map_stats_page)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_register_sev_ghcb), + stringify!(hv_input_map_stats_page), "::", - stringify!(as_uint64) + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_input_map_stats_page), + "::", + stringify!(padding) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).identity) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_input_map_stats_page), + "::", + stringify!(identity) ) ); } -impl Default for hv_x64_register_sev_ghcb { +impl Default for hv_input_map_stats_page { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6413,120 +9042,91 @@ impl Default for hv_x64_register_sev_ghcb { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_x64_register_sev_hv_doorbell { - pub as_uint64: __u64, - pub __bindgen_anon_1: hv_x64_register_sev_hv_doorbell__bindgen_ty_1, -} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_x64_register_sev_hv_doorbell__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +pub struct hv_output_map_stats_page { + pub map_location: __u64, } #[test] -fn bindgen_test_layout_hv_x64_register_sev_hv_doorbell__bindgen_ty_1() { +fn bindgen_test_layout_hv_output_map_stats_page() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!( - "Size of: ", - stringify!(hv_x64_register_sev_hv_doorbell__bindgen_ty_1) - ) + concat!("Size of: ", stringify!(hv_output_map_stats_page)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_output_map_stats_page)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).map_location) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_x64_register_sev_hv_doorbell__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_output_map_stats_page), + "::", + stringify!(map_location) ) ); } -impl hv_x64_register_sev_hv_doorbell__bindgen_ty_1 { - #[inline] - pub fn enabled(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_enabled(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reservedz(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 11u8) as u64) } - } - #[inline] - pub fn set_reservedz(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 11u8, val as u64) - } - } - #[inline] - pub fn page_number(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } - } - #[inline] - pub fn set_page_number(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 52u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - enabled: __u64, - reservedz: __u64, - page_number: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let enabled: u64 = unsafe { ::std::mem::transmute(enabled) }; - enabled as u64 - }); - __bindgen_bitfield_unit.set(1usize, 11u8, { - let reservedz: u64 = unsafe { ::std::mem::transmute(reservedz) }; - reservedz as u64 - }); - __bindgen_bitfield_unit.set(12usize, 52u8, { - let page_number: u64 = unsafe { ::std::mem::transmute(page_number) }; - page_number as u64 - }); - __bindgen_bitfield_unit - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_unmap_stats_page { + pub type_: __u32, + pub padding: __u32, + pub identity: hv_stats_object_identity, } #[test] -fn bindgen_test_layout_hv_x64_register_sev_hv_doorbell() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_unmap_stats_page() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_x64_register_sev_hv_doorbell)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_unmap_stats_page)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_x64_register_sev_hv_doorbell)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_unmap_stats_page)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_x64_register_sev_hv_doorbell), + stringify!(hv_input_unmap_stats_page), "::", - stringify!(as_uint64) + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_input_unmap_stats_page), + "::", + stringify!(padding) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).identity) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_input_unmap_stats_page), + "::", + stringify!(identity) ) ); } -impl Default for hv_x64_register_sev_hv_doorbell { +impl Default for hv_input_unmap_stats_page { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6535,244 +9135,211 @@ impl Default for hv_x64_register_sev_hv_doorbell { } } } -pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_FAULT: - hv_unimplemented_msr_action = 0; -pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_IGNORE_WRITE_READ_ZERO: - hv_unimplemented_msr_action = 1; -pub const hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_COUNT: - hv_unimplemented_msr_action = 2; -pub type hv_unimplemented_msr_action = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_connection_id { - pub asu32: __u32, - pub u: hv_connection_id__bindgen_ty_1, -} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_connection_id__bindgen_ty_1 { +pub struct hv_proximity_domain_flags { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } #[test] -fn bindgen_test_layout_hv_connection_id__bindgen_ty_1() { +fn bindgen_test_layout_hv_proximity_domain_flags() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(hv_connection_id__bindgen_ty_1)) + concat!("Size of: ", stringify!(hv_proximity_domain_flags)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_connection_id__bindgen_ty_1)) + concat!("Alignment of ", stringify!(hv_proximity_domain_flags)) ); } -impl hv_connection_id__bindgen_ty_1 { +impl hv_proximity_domain_flags { #[inline] - pub fn id(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + pub fn proximity_preferred(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_id(&mut self, val: __u32) { + pub fn set_proximity_preferred(&mut self, val: __u32) { unsafe { let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 24u8, val as u64) + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 30u8) as u32) } } #[inline] pub fn set_reserved(&mut self, val: __u32) { unsafe { let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(24usize, 8u8, val as u64) + self._bitfield_1.set(1usize, 30u8, val as u64) } } #[inline] - pub fn new_bitfield_1(id: __u32, reserved: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + pub fn proximity_info_valid(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } + } + #[inline] + pub fn set_proximity_info_valid(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + proximity_preferred: __u32, + reserved: __u32, + proximity_info_valid: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 24u8, { - let id: u32 = unsafe { ::std::mem::transmute(id) }; - id as u64 + __bindgen_bitfield_unit.set(0usize, 1u8, { + let proximity_preferred: u32 = unsafe { ::std::mem::transmute(proximity_preferred) }; + proximity_preferred as u64 }); - __bindgen_bitfield_unit.set(24usize, 8u8, { + __bindgen_bitfield_unit.set(1usize, 30u8, { let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; reserved as u64 }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let proximity_info_valid: u32 = unsafe { ::std::mem::transmute(proximity_info_valid) }; + proximity_info_valid as u64 + }); __bindgen_bitfield_unit } } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_proximity_domain_info { + pub __bindgen_anon_1: hv_proximity_domain_info__bindgen_ty_1, + pub as_uint64: __u64, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_proximity_domain_info__bindgen_ty_1 { + pub domain_id: __u32, + pub flags: hv_proximity_domain_flags, +} #[test] -fn bindgen_test_layout_hv_connection_id() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_proximity_domain_info__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_connection_id)) + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(hv_proximity_domain_info__bindgen_ty_1) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(hv_connection_id)) + concat!( + "Alignment of ", + stringify!(hv_proximity_domain_info__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).asu32) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).domain_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_connection_id), + stringify!(hv_proximity_domain_info__bindgen_ty_1), "::", - stringify!(asu32) + stringify!(domain_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_connection_id), + stringify!(hv_proximity_domain_info__bindgen_ty_1), "::", - stringify!(u) + stringify!(flags) ) ); } -impl Default for hv_connection_id { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_input_unmap_gpa_pages { - pub target_partition_id: __u64, - pub target_gpa_base: __u64, - pub unmap_flags: __u32, - pub padding: __u32, -} #[test] -fn bindgen_test_layout_hv_input_unmap_gpa_pages() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_proximity_domain_info() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_unmap_gpa_pages)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_proximity_domain_info)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_unmap_gpa_pages)) + concat!("Alignment of ", stringify!(hv_proximity_domain_info)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_unmap_gpa_pages), - "::", - stringify!(target_partition_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_gpa_base) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hv_input_unmap_gpa_pages), - "::", - stringify!(target_gpa_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unmap_flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hv_input_unmap_gpa_pages), - "::", - stringify!(unmap_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(hv_input_unmap_gpa_pages), + stringify!(hv_proximity_domain_info), "::", - stringify!(padding) + stringify!(as_uint64) ) ); } -pub const hv_generic_set_format_HV_GENERIC_SET_SPARSE_4K: hv_generic_set_format = 0; -pub const hv_generic_set_format_HV_GENERIC_SET_ALL: hv_generic_set_format = 1; -pub type hv_generic_set_format = ::std::os::raw::c_uint; -pub const hv_scheduler_type_HV_SCHEDULER_TYPE_LP: hv_scheduler_type = 1; -pub const hv_scheduler_type_HV_SCHEDULER_TYPE_LP_SMT: hv_scheduler_type = 2; -pub const hv_scheduler_type_HV_SCHEDULER_TYPE_CORE_SMT: hv_scheduler_type = 3; -pub const hv_scheduler_type_HV_SCHEDULER_TYPE_ROOT: hv_scheduler_type = 4; -pub const hv_scheduler_type_HV_SCHEDULER_TYPE_MAX: hv_scheduler_type = 5; -pub type hv_scheduler_type = ::std::os::raw::c_uint; +impl Default for hv_proximity_domain_info { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C, packed)] -pub struct hv_vpset { - pub format: __u64, - pub valid_bank_mask: __u64, - pub bank_contents: __IncompleteArrayField<__u64>, +pub struct hv_deposit_memory { + pub partition_id: __u64, + pub gpa_page_list: __IncompleteArrayField<__u64>, } #[test] -fn bindgen_test_layout_hv_vpset() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_deposit_memory() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_vpset)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_deposit_memory)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_vpset)) + concat!("Alignment of ", stringify!(hv_deposit_memory)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_vpset), + stringify!(hv_deposit_memory), "::", - stringify!(format) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).valid_bank_mask) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gpa_page_list) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_vpset), - "::", - stringify!(valid_bank_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bank_contents) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hv_vpset), + stringify!(hv_deposit_memory), "::", - stringify!(bank_contents) + stringify!(gpa_page_list) ) ); } -impl Default for hv_vpset { +impl Default for hv_deposit_memory { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -6781,301 +9348,390 @@ impl Default for hv_vpset { } } } -pub const hv_stats_object_type_HV_STATS_OBJECT_HYPERVISOR: hv_stats_object_type = 1; -pub const hv_stats_object_type_HV_STATS_OBJECT_LOGICAL_PROCESSOR: hv_stats_object_type = 2; -pub const hv_stats_object_type_HV_STATS_OBJECT_PARTITION: hv_stats_object_type = 65537; -pub const hv_stats_object_type_HV_STATS_OBJECT_VP: hv_stats_object_type = 65538; -pub type hv_stats_object_type = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_stats_object_identity { - pub hv: hv_stats_object_identity__bindgen_ty_1, - pub lp: hv_stats_object_identity__bindgen_ty_2, - pub partition: hv_stats_object_identity__bindgen_ty_3, - pub vp: hv_stats_object_identity__bindgen_ty_4, -} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_stats_object_identity__bindgen_ty_1 { - pub reserved: [__u8; 16usize], +#[derive(Copy, Clone)] +pub struct hv_input_withdraw_memory { + pub partition_id: __u64, + pub proximity_domain_info: hv_proximity_domain_info, } #[test] -fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_withdraw_memory() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 16usize, - concat!( - "Size of: ", - stringify!(hv_stats_object_identity__bindgen_ty_1) - ) + concat!("Size of: ", stringify!(hv_input_withdraw_memory)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_input_withdraw_memory)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_stats_object_identity__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_input_withdraw_memory), + "::", + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).proximity_domain_info) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_1), + stringify!(hv_input_withdraw_memory), "::", - stringify!(reserved) + stringify!(proximity_domain_info) ) ); } +impl Default for hv_input_withdraw_memory { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_stats_object_identity__bindgen_ty_2 { - pub lp_index: __u32, - pub reserved: [__u8; 12usize], +pub struct hv_output_withdraw_memory { + pub gpa_page_list: __IncompleteArrayField<__u64>, } #[test] -fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_output_withdraw_memory() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_stats_object_identity__bindgen_ty_2) - ) + ::std::mem::size_of::(), + 0usize, + concat!("Size of: ", stringify!(hv_output_withdraw_memory)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_stats_object_identity__bindgen_ty_2) - ) + concat!("Alignment of ", stringify!(hv_output_withdraw_memory)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).gpa_page_list) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_2), - "::", - stringify!(lp_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_2), + stringify!(hv_output_withdraw_memory), "::", - stringify!(reserved) + stringify!(gpa_page_list) ) ); } +impl Default for hv_output_withdraw_memory { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_stats_object_identity__bindgen_ty_3 { - pub partition_id: __u64, - pub reserved: [__u8; 4usize], - pub flags: __u16, - pub reserved1: [__u8; 2usize], +pub struct hv_input_map_gpa_pages { + pub target_partition_id: __u64, + pub target_gpa_base: __u64, + pub map_flags: __u32, + pub padding: __u32, + pub source_gpa_page_list: __IncompleteArrayField<__u64>, } #[test] -fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_map_gpa_pages() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(hv_stats_object_identity__bindgen_ty_3) - ) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_map_gpa_pages)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_stats_object_identity__bindgen_ty_3) - ) + concat!("Alignment of ", stringify!(hv_input_map_gpa_pages)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).target_partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_3), + stringify!(hv_input_map_gpa_pages), "::", - stringify!(partition_id) + stringify!(target_partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).target_gpa_base) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_3), + stringify!(hv_input_map_gpa_pages), "::", - stringify!(reserved) + stringify!(target_gpa_base) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).map_flags) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_3), + stringify!(hv_input_map_gpa_pages), "::", - stringify!(flags) + stringify!(map_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 14usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_3), + stringify!(hv_input_map_gpa_pages), "::", - stringify!(reserved1) + stringify!(padding) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).source_gpa_page_list) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hv_input_map_gpa_pages), + "::", + stringify!(source_gpa_page_list) ) ); } +impl Default for hv_input_map_gpa_pages { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_gpa_page_access_state_flags { + pub __bindgen_anon_1: hv_gpa_page_access_state_flags__bindgen_ty_1, + pub as_uint64: __u64, +} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_stats_object_identity__bindgen_ty_4 { - pub partition_id: __u64, - pub vp_index: __u32, - pub flags: __u16, - pub reserved: [__u8; 2usize], +pub struct hv_gpa_page_access_state_flags__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_stats_object_identity__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_gpa_page_access_state_flags__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 16usize, + ::std::mem::size_of::(), + 8usize, concat!( "Size of: ", - stringify!(hv_stats_object_identity__bindgen_ty_4) + stringify!(hv_gpa_page_access_state_flags__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_stats_object_identity__bindgen_ty_4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_4), - "::", - stringify!(partition_id) + stringify!(hv_gpa_page_access_state_flags__bindgen_ty_1) ) ); +} +impl hv_gpa_page_access_state_flags__bindgen_ty_1 { + #[inline] + pub fn clear_accessed(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_clear_accessed(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn set_access(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_set_access(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn clear_dirty(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_clear_dirty(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn set_dirty(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_set_dirty(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 60u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + clear_accessed: __u64, + set_access: __u64, + clear_dirty: __u64, + set_dirty: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let clear_accessed: u64 = unsafe { ::std::mem::transmute(clear_accessed) }; + clear_accessed as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let set_access: u64 = unsafe { ::std::mem::transmute(set_access) }; + set_access as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let clear_dirty: u64 = unsafe { ::std::mem::transmute(clear_dirty) }; + clear_dirty as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let set_dirty: u64 = unsafe { ::std::mem::transmute(set_dirty) }; + set_dirty as u64 + }); + __bindgen_bitfield_unit.set(4usize, 60u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_gpa_page_access_state_flags() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, + ::std::mem::size_of::(), 8usize, - concat!( - "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_4), - "::", - stringify!(vp_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_4), - "::", - stringify!(flags) - ) + concat!("Size of: ", stringify!(hv_gpa_page_access_state_flags)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 14usize, + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_gpa_page_access_state_flags)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity__bindgen_ty_4), + stringify!(hv_gpa_page_access_state_flags), "::", - stringify!(reserved) + stringify!(as_uint64) ) ); } +impl Default for hv_gpa_page_access_state_flags { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_get_gpa_pages_access_state { + pub partition_id: __u64, + pub flags: hv_gpa_page_access_state_flags, + pub hv_gpa_page_number: __u64, +} #[test] -fn bindgen_test_layout_hv_stats_object_identity() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_get_gpa_pages_access_state() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_stats_object_identity)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_get_gpa_pages_access_state)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_stats_object_identity)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv) as usize - ptr as usize }, - 0usize, concat!( - "Offset of field: ", - stringify!(hv_stats_object_identity), - "::", - stringify!(hv) + "Alignment of ", + stringify!(hv_input_get_gpa_pages_access_state) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lp) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity), + stringify!(hv_input_get_gpa_pages_access_state), "::", - stringify!(lp) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity), + stringify!(hv_input_get_gpa_pages_access_state), "::", - stringify!(partition) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vp) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).hv_gpa_page_number) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_stats_object_identity), + stringify!(hv_input_get_gpa_pages_access_state), "::", - stringify!(vp) + stringify!(hv_gpa_page_number) ) ); } -impl Default for hv_stats_object_identity { +impl Default for hv_input_get_gpa_pages_access_state { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7084,277 +9740,303 @@ impl Default for hv_stats_object_identity { } } } -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PRIVILEGE_FLAGS: - hv_partition_property_code = 65536; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SYNTHETIC_PROC_FEATURES: - hv_partition_property_code = 65537; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SUSPEND: hv_partition_property_code = - 131072; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_RESERVE: hv_partition_property_code = - 131073; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_CAP: hv_partition_property_code = - 131074; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_WEIGHT: hv_partition_property_code = - 131075; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_CPU_GROUP_ID: - hv_partition_property_code = 131076; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_TIME_FREEZE: hv_partition_property_code = - 196611; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEBUG_CHANNEL_ID: - hv_partition_property_code = 262144; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VIRTUAL_TLB_PAGE_COUNT: - hv_partition_property_code = 327680; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VSM_CONFIG: hv_partition_property_code = - 327681; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ZERO_MEMORY_ON_RESET: - hv_partition_property_code = 327682; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSORS_PER_SOCKET: - hv_partition_property_code = 327683; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_NESTED_TLB_SIZE: - hv_partition_property_code = 327684; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_GPA_PAGE_ACCESS_TRACKING: - hv_partition_property_code = 327685; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_VSM_PERMISSIONS_DIRTY_SINCE_LAST_QUERY : hv_partition_property_code = 327686 ; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SGX_LAUNCH_CONTROL_CONFIG: - hv_partition_property_code = 327687; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL0: - hv_partition_property_code = 327688; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL1: - hv_partition_property_code = 327689; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL2: - hv_partition_property_code = 327690; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_DEFAULT_SGX_LAUNCH_CONTROL3: - hv_partition_property_code = 327691; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_STATE: - hv_partition_property_code = 327692; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_CONTROL: - hv_partition_property_code = 327693; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ALLOCATION_ID: - hv_partition_property_code = 327694; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_MONITORING_ID: - hv_partition_property_code = 327695; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_IMPLEMENTED_PHYSICAL_ADDRESS_BITS: - hv_partition_property_code = 327696; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_NON_ARCHITECTURAL_CORE_SHARING: - hv_partition_property_code = 327697; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_HYPERCALL_DOORBELL_PAGE: - hv_partition_property_code = 327698; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ISOLATION_POLICY: - hv_partition_property_code = 327700; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_UNIMPLEMENTED_MSR_ACTION: - hv_partition_property_code = 327703; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_SEV_VMGEXIT_OFFLOADS: - hv_partition_property_code = 327714; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_VENDOR: - hv_partition_property_code = 393216; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES_DEPRECATED: - hv_partition_property_code = 393217; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_XSAVE_FEATURES: - hv_partition_property_code = 393218; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_CL_FLUSH_SIZE: - hv_partition_property_code = 393219; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_ENLIGHTENMENT_MODIFICATIONS: - hv_partition_property_code = 393220; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_COMPATIBILITY_VERSION: - hv_partition_property_code = 393221; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PHYSICAL_ADDRESS_WIDTH: - hv_partition_property_code = 393222; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_XSAVE_STATES: - hv_partition_property_code = 393223; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_MAX_XSAVE_DATA_SIZE: - hv_partition_property_code = 393224; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_CLOCK_FREQUENCY: - hv_partition_property_code = 393225; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES0: - hv_partition_property_code = 393226; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_FEATURES1: - hv_partition_property_code = 393227; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_GUEST_OS_ID: hv_partition_property_code = - 458752; -pub const hv_partition_property_code_HV_PARTITION_PROPERTY_PROCESSOR_VIRTUALIZATION_FEATURES: - hv_partition_property_code = 524288; -pub type hv_partition_property_code = ::std::os::raw::c_uint; -pub const hv_sleep_state_HV_SLEEP_STATE_S1: hv_sleep_state = 1; -pub const hv_sleep_state_HV_SLEEP_STATE_S2: hv_sleep_state = 2; -pub const hv_sleep_state_HV_SLEEP_STATE_S3: hv_sleep_state = 3; -pub const hv_sleep_state_HV_SLEEP_STATE_S4: hv_sleep_state = 4; -pub const hv_sleep_state_HV_SLEEP_STATE_S5: hv_sleep_state = 5; -pub const hv_sleep_state_HV_SLEEP_STATE_LOCK: hv_sleep_state = 6; -pub type hv_sleep_state = ::std::os::raw::c_uint; -pub const hv_system_property_HV_SYSTEM_PROPERTY_SLEEP_STATE: hv_system_property = 3; -pub const hv_system_property_HV_SYSTEM_PROPERTY_SCHEDULER_TYPE: hv_system_property = 15; -pub const hv_system_property_HV_DYNAMIC_PROCESSOR_FEATURE_PROPERTY: hv_system_property = 21; -pub const hv_system_property_HV_SYSTEM_PROPERTY_DIAGOSTICS_LOG_BUFFERS: hv_system_property = 28; -pub type hv_system_property = ::std::os::raw::c_uint; #[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_gpa_page_access_state { + pub __bindgen_anon_1: hv_gpa_page_access_state__bindgen_ty_1, + pub as_uint8: __u8, +} +#[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_sleep_state_info { - pub sleep_state: __u32, - pub pm1a_slp_typ: __u8, - pub pm1b_slp_typ: __u8, +pub struct hv_gpa_page_access_state__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[test] +fn bindgen_test_layout_hv_gpa_page_access_state__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!( + "Size of: ", + stringify!(hv_gpa_page_access_state__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_gpa_page_access_state__bindgen_ty_1) + ) + ); +} +impl hv_gpa_page_access_state__bindgen_ty_1 { + #[inline] + pub fn accessed(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_accessed(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn dirty(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_dirty(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 6u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + accessed: __u8, + dirty: __u8, + reserved: __u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let accessed: u8 = unsafe { ::std::mem::transmute(accessed) }; + accessed as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let dirty: u8 = unsafe { ::std::mem::transmute(dirty) }; + dirty as u64 + }); + __bindgen_bitfield_unit.set(2usize, 6u8, { + let reserved: u8 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } } #[test] -fn bindgen_test_layout_hv_sleep_state_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_gpa_page_access_state() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 6usize, - concat!("Size of: ", stringify!(hv_sleep_state_info)) + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hv_gpa_page_access_state)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_sleep_state_info)) + concat!("Alignment of ", stringify!(hv_gpa_page_access_state)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sleep_state) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint8) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_sleep_state_info), - "::", - stringify!(sleep_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pm1a_slp_typ) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_sleep_state_info), - "::", - stringify!(pm1a_slp_typ) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pm1b_slp_typ) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(hv_sleep_state_info), + stringify!(hv_gpa_page_access_state), "::", - stringify!(pm1b_slp_typ) + stringify!(as_uint8) ) ); } -pub const hv_snp_status_HV_SNP_STATUS_NONE: hv_snp_status = 0; -pub const hv_snp_status_HV_SNP_STATUS_AVAILABLE: hv_snp_status = 1; -pub const hv_snp_status_HV_SNP_STATUS_INCOMPATIBLE: hv_snp_status = 2; -pub const hv_snp_status_HV_SNP_STATUS_PSP_UNAVAILABLE: hv_snp_status = 3; -pub const hv_snp_status_HV_SNP_STATUS_PSP_INIT_FAILED: hv_snp_status = 4; -pub const hv_snp_status_HV_SNP_STATUS_PSP_BAD_FW_VERSION: hv_snp_status = 5; -pub const hv_snp_status_HV_SNP_STATUS_BAD_CONFIGURATION: hv_snp_status = 6; -pub const hv_snp_status_HV_SNP_STATUS_PSP_FW_UPDATE_IN_PROGRESS: hv_snp_status = 7; -pub const hv_snp_status_HV_SNP_STATUS_PSP_RB_INIT_FAILED: hv_snp_status = 8; -pub const hv_snp_status_HV_SNP_STATUS_PSP_PLATFORM_STATUS_FAILED: hv_snp_status = 9; -pub const hv_snp_status_HV_SNP_STATUS_PSP_INIT_LATE_FAILED: hv_snp_status = 10; -pub type hv_snp_status = ::std::os::raw::c_uint; -pub const hv_dynamic_processor_feature_property_HV_X64_DYNAMIC_PROCESSOR_FEATURE_MAX_ENCRYPTED_PARTITIONS : hv_dynamic_processor_feature_property = 13 ; -pub const hv_dynamic_processor_feature_property_HV_X64_DYNAMIC_PROCESSOR_FEATURE_SNP_STATUS: - hv_dynamic_processor_feature_property = 16; -pub type hv_dynamic_processor_feature_property = ::std::os::raw::c_uint; -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_get_system_property { - pub property_id: __u32, - pub reserved: __u32, - pub __bindgen_anon_1: hv_input_get_system_property__bindgen_ty_1, +impl Default for hv_gpa_page_access_state { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_input_get_system_property__bindgen_ty_1 { +pub union hv_snp_guest_policy { + pub __bindgen_anon_1: hv_snp_guest_policy__bindgen_ty_1, pub as_uint64: __u64, - pub hv_processor_feature: __u32, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_snp_guest_policy__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] -fn bindgen_test_layout_hv_input_get_system_property__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_snp_guest_policy__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!( - "Size of: ", - stringify!(hv_input_get_system_property__bindgen_ty_1) - ) + concat!("Size of: ", stringify!(hv_snp_guest_policy__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + ::std::mem::align_of::(), + 1usize, concat!( "Alignment of ", - stringify!(hv_input_get_system_property__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_input_get_system_property__bindgen_ty_1), - "::", - stringify!(as_uint64) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_processor_feature) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_input_get_system_property__bindgen_ty_1), - "::", - stringify!(hv_processor_feature) + stringify!(hv_snp_guest_policy__bindgen_ty_1) ) ); } -impl Default for hv_input_get_system_property__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); +impl hv_snp_guest_policy__bindgen_ty_1 { + #[inline] + pub fn minor_version(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u64) } + } + #[inline] + pub fn set_minor_version(&mut self, val: __u64) { unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn major_version(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u64) } + } + #[inline] + pub fn set_major_version(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn smt_allowed(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } + } + #[inline] + pub fn set_smt_allowed(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub fn vmpls_required(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + } + #[inline] + pub fn set_vmpls_required(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub fn migration_agent_allowed(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + } + #[inline] + pub fn set_migration_agent_allowed(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub fn debug_allowed(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + } + #[inline] + pub fn set_debug_allowed(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 44u8) as u64) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 44u8, val as u64) } } + #[inline] + pub fn new_bitfield_1( + minor_version: __u64, + major_version: __u64, + smt_allowed: __u64, + vmpls_required: __u64, + migration_agent_allowed: __u64, + debug_allowed: __u64, + reserved: __u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let minor_version: u64 = unsafe { ::std::mem::transmute(minor_version) }; + minor_version as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let major_version: u64 = unsafe { ::std::mem::transmute(major_version) }; + major_version as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let smt_allowed: u64 = unsafe { ::std::mem::transmute(smt_allowed) }; + smt_allowed as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let vmpls_required: u64 = unsafe { ::std::mem::transmute(vmpls_required) }; + vmpls_required as u64 + }); + __bindgen_bitfield_unit.set(18usize, 1u8, { + let migration_agent_allowed: u64 = + unsafe { ::std::mem::transmute(migration_agent_allowed) }; + migration_agent_allowed as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let debug_allowed: u64 = unsafe { ::std::mem::transmute(debug_allowed) }; + debug_allowed as u64 + }); + __bindgen_bitfield_unit.set(20usize, 44u8, { + let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } } #[test] -fn bindgen_test_layout_hv_input_get_system_property() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_snp_guest_policy() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_input_get_system_property)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_snp_guest_policy)) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_get_system_property)) + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_snp_guest_policy)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).property_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_system_property), - "::", - stringify!(property_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_input_get_system_property), + stringify!(hv_snp_guest_policy), "::", - stringify!(reserved) + stringify!(as_uint64) ) ); } -impl Default for hv_input_get_system_property { +impl Default for hv_snp_guest_policy { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7364,224 +10046,91 @@ impl Default for hv_input_get_system_property { } } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_system_diag_log_buffer_config { - pub buffer_count: __u32, - pub buffer_size_in_pages: __u32, +#[derive(Copy, Clone)] +pub struct hv_snp_id_block { + pub launch_digest: [__u8; 48usize], + pub family_id: [__u8; 16usize], + pub image_id: [__u8; 16usize], + pub version: __u32, + pub guest_svn: __u32, + pub policy: hv_snp_guest_policy, } #[test] -fn bindgen_test_layout_hv_system_diag_log_buffer_config() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_snp_id_block() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_system_diag_log_buffer_config)) + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(hv_snp_id_block)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_system_diag_log_buffer_config) - ) + concat!("Alignment of ", stringify!(hv_snp_id_block)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer_count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).launch_digest) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_system_diag_log_buffer_config), - "::", - stringify!(buffer_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer_size_in_pages) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_system_diag_log_buffer_config), + stringify!(hv_snp_id_block), "::", - stringify!(buffer_size_in_pages) - ) - ); -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_output_get_system_property { - pub __bindgen_anon_1: hv_output_get_system_property__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_output_get_system_property__bindgen_ty_1 { - pub scheduler_type: __u32, - pub hv_diagbuf_info: hv_system_diag_log_buffer_config, - pub hv_processor_feature_value: __u64, -} -#[test] -fn bindgen_test_layout_hv_output_get_system_property__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(hv_output_get_system_property__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(hv_output_get_system_property__bindgen_ty_1) + stringify!(launch_digest) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scheduler_type) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).family_id) as usize - ptr as usize }, + 48usize, concat!( "Offset of field: ", - stringify!(hv_output_get_system_property__bindgen_ty_1), + stringify!(hv_snp_id_block), "::", - stringify!(scheduler_type) + stringify!(family_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_diagbuf_info) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).image_id) as usize - ptr as usize }, + 64usize, concat!( "Offset of field: ", - stringify!(hv_output_get_system_property__bindgen_ty_1), + stringify!(hv_snp_id_block), "::", - stringify!(hv_diagbuf_info) + stringify!(image_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_processor_feature_value) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 80usize, concat!( "Offset of field: ", - stringify!(hv_output_get_system_property__bindgen_ty_1), + stringify!(hv_snp_id_block), "::", - stringify!(hv_processor_feature_value) - ) - ); -} -impl Default for hv_output_get_system_property__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_hv_output_get_system_property() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_output_get_system_property)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_output_get_system_property)) - ); -} -impl Default for hv_output_get_system_property { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_set_system_property { - pub property_id: __u32, - pub __bindgen_anon_1: hv_input_set_system_property__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_input_set_system_property__bindgen_ty_1 { - pub set_sleep_state_info: hv_sleep_state_info, -} -#[test] -fn bindgen_test_layout_hv_input_set_system_property__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 6usize, - concat!( - "Size of: ", - stringify!(hv_input_set_system_property__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(hv_input_set_system_property__bindgen_ty_1) + stringify!(version) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_sleep_state_info) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).guest_svn) as usize - ptr as usize }, + 84usize, concat!( "Offset of field: ", - stringify!(hv_input_set_system_property__bindgen_ty_1), + stringify!(hv_snp_id_block), "::", - stringify!(set_sleep_state_info) + stringify!(guest_svn) ) ); -} -impl Default for hv_input_set_system_property__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_hv_input_set_system_property() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 10usize, - concat!("Size of: ", stringify!(hv_input_set_system_property)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_set_system_property)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).property_id) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).policy) as usize - ptr as usize }, + 88usize, concat!( "Offset of field: ", - stringify!(hv_input_set_system_property), + stringify!(hv_snp_id_block), "::", - stringify!(property_id) + stringify!(policy) ) ); } -impl Default for hv_input_set_system_property { +impl Default for hv_snp_id_block { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7591,59 +10140,113 @@ impl Default for hv_input_set_system_property { } } #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_map_stats_page { - pub type_: __u32, - pub padding: __u32, - pub identity: hv_stats_object_identity, +#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_snp_id_auth_info { + pub id_key_algorithm: __u32, + pub auth_key_algorithm: __u32, + pub reserved0: [__u8; 56usize], + pub id_block_signature: [__u8; 512usize], + pub id_key: [__u8; 1028usize], + pub reserved1: [__u8; 60usize], + pub id_key_signature: [__u8; 512usize], + pub author_key: [__u8; 1028usize], } #[test] -fn bindgen_test_layout_hv_input_map_stats_page() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_snp_id_auth_info() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_map_stats_page)) + ::std::mem::size_of::(), + 3204usize, + concat!("Size of: ", stringify!(hv_snp_id_auth_info)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_map_stats_page)) + concat!("Alignment of ", stringify!(hv_snp_id_auth_info)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id_key_algorithm) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_map_stats_page), + stringify!(hv_snp_id_auth_info), "::", - stringify!(type_) + stringify!(id_key_algorithm) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).auth_key_algorithm) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(hv_input_map_stats_page), + stringify!(hv_snp_id_auth_info), "::", - stringify!(padding) + stringify!(auth_key_algorithm) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).identity) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved0) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_input_map_stats_page), + stringify!(hv_snp_id_auth_info), "::", - stringify!(identity) + stringify!(reserved0) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id_block_signature) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(hv_snp_id_auth_info), + "::", + stringify!(id_block_signature) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id_key) as usize - ptr as usize }, + 576usize, + concat!( + "Offset of field: ", + stringify!(hv_snp_id_auth_info), + "::", + stringify!(id_key) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 1604usize, + concat!( + "Offset of field: ", + stringify!(hv_snp_id_auth_info), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id_key_signature) as usize - ptr as usize }, + 1664usize, + concat!( + "Offset of field: ", + stringify!(hv_snp_id_auth_info), + "::", + stringify!(id_key_signature) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).author_key) as usize - ptr as usize }, + 2176usize, + concat!( + "Offset of field: ", + stringify!(hv_snp_id_auth_info), + "::", + stringify!(author_key) ) ); } -impl Default for hv_input_map_stats_page { +impl Default for hv_snp_id_auth_info { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7653,90 +10256,81 @@ impl Default for hv_input_map_stats_page { } } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_output_map_stats_page { - pub map_location: __u64, +#[derive(Copy, Clone)] +pub struct hv_psp_launch_finish_data { + pub id_block: hv_snp_id_block, + pub id_auth_info: hv_snp_id_auth_info, + pub host_data: [__u8; 32usize], + pub id_block_enabled: __u8, + pub author_key_enabled: __u8, } #[test] -fn bindgen_test_layout_hv_output_map_stats_page() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_psp_launch_finish_data() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_output_map_stats_page)) + ::std::mem::size_of::(), + 3334usize, + concat!("Size of: ", stringify!(hv_psp_launch_finish_data)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_output_map_stats_page)) + concat!("Alignment of ", stringify!(hv_psp_launch_finish_data)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).map_location) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).id_block) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_output_map_stats_page), + stringify!(hv_psp_launch_finish_data), "::", - stringify!(map_location) + stringify!(id_block) ) ); -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_unmap_stats_page { - pub type_: __u32, - pub padding: __u32, - pub identity: hv_stats_object_identity, -} -#[test] -fn bindgen_test_layout_hv_input_unmap_stats_page() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_unmap_stats_page)) - ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_unmap_stats_page)) + unsafe { ::std::ptr::addr_of!((*ptr).id_auth_info) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(hv_psp_launch_finish_data), + "::", + stringify!(id_auth_info) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).host_data) as usize - ptr as usize }, + 3300usize, concat!( "Offset of field: ", - stringify!(hv_input_unmap_stats_page), + stringify!(hv_psp_launch_finish_data), "::", - stringify!(type_) + stringify!(host_data) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).id_block_enabled) as usize - ptr as usize }, + 3332usize, concat!( "Offset of field: ", - stringify!(hv_input_unmap_stats_page), + stringify!(hv_psp_launch_finish_data), "::", - stringify!(padding) + stringify!(id_block_enabled) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).identity) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).author_key_enabled) as usize - ptr as usize }, + 3333usize, concat!( "Offset of field: ", - stringify!(hv_input_unmap_stats_page), + stringify!(hv_psp_launch_finish_data), "::", - stringify!(identity) + stringify!(author_key_enabled) ) ); } -impl Default for hv_input_unmap_stats_page { +impl Default for hv_psp_launch_finish_data { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7746,161 +10340,54 @@ impl Default for hv_input_unmap_stats_page { } } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_proximity_domain_flags { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -#[test] -fn bindgen_test_layout_hv_proximity_domain_flags() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_proximity_domain_flags)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_proximity_domain_flags)) - ); -} -impl hv_proximity_domain_flags { - #[inline] - pub fn proximity_preferred(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_proximity_preferred(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 30u8) as u32) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 30u8, val as u64) - } - } - #[inline] - pub fn proximity_info_valid(&self) -> __u32 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } - } - #[inline] - pub fn set_proximity_info_valid(&mut self, val: __u32) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(31usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - proximity_preferred: __u32, - reserved: __u32, - proximity_info_valid: __u32, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let proximity_preferred: u32 = unsafe { ::std::mem::transmute(proximity_preferred) }; - proximity_preferred as u64 - }); - __bindgen_bitfield_unit.set(1usize, 30u8, { - let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit.set(31usize, 1u8, { - let proximity_info_valid: u32 = unsafe { ::std::mem::transmute(proximity_info_valid) }; - proximity_info_valid as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C, packed)] #[derive(Copy, Clone)] -pub union hv_proximity_domain_info { - pub __bindgen_anon_1: hv_proximity_domain_info__bindgen_ty_1, - pub as_uint64: __u64, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_proximity_domain_info__bindgen_ty_1 { - pub domain_id: __u32, - pub flags: hv_proximity_domain_flags, +pub union hv_partition_complete_isolated_import_data { + pub reserved: __u64, + pub psp_parameters: hv_psp_launch_finish_data, } #[test] -fn bindgen_test_layout_hv_proximity_domain_info__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_partition_complete_isolated_import_data() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 3334usize, concat!( "Size of: ", - stringify!(hv_proximity_domain_info__bindgen_ty_1) + stringify!(hv_partition_complete_isolated_import_data) ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, + ::std::mem::align_of::(), + 1usize, concat!( "Alignment of ", - stringify!(hv_proximity_domain_info__bindgen_ty_1) + stringify!(hv_partition_complete_isolated_import_data) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).domain_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_proximity_domain_info__bindgen_ty_1), - "::", - stringify!(domain_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_proximity_domain_info__bindgen_ty_1), + stringify!(hv_partition_complete_isolated_import_data), "::", - stringify!(flags) + stringify!(reserved) ) ); -} -#[test] -fn bindgen_test_layout_hv_proximity_domain_info() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_proximity_domain_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_proximity_domain_info)) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).psp_parameters) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_proximity_domain_info), + stringify!(hv_partition_complete_isolated_import_data), "::", - stringify!(as_uint64) + stringify!(psp_parameters) ) ); } -impl Default for hv_proximity_domain_info { +impl Default for hv_partition_complete_isolated_import_data { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7911,47 +10398,50 @@ impl Default for hv_proximity_domain_info { } #[repr(C, packed)] #[derive(Copy, Clone)] -pub struct hv_input_withdraw_memory { +pub struct hv_input_complete_isolated_import { pub partition_id: __u64, - pub proximity_domain_info: hv_proximity_domain_info, + pub import_data: hv_partition_complete_isolated_import_data, } #[test] -fn bindgen_test_layout_hv_input_withdraw_memory() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_complete_isolated_import() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_input_withdraw_memory)) + ::std::mem::size_of::(), + 3342usize, + concat!("Size of: ", stringify!(hv_input_complete_isolated_import)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_withdraw_memory)) + concat!( + "Alignment of ", + stringify!(hv_input_complete_isolated_import) + ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_withdraw_memory), + stringify!(hv_input_complete_isolated_import), "::", stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proximity_domain_info) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).import_data) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_input_withdraw_memory), + stringify!(hv_input_complete_isolated_import), "::", - stringify!(proximity_domain_info) + stringify!(import_data) ) ); } -impl Default for hv_input_withdraw_memory { +impl Default for hv_input_complete_isolated_import { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -7960,274 +10450,229 @@ impl Default for hv_input_withdraw_memory { } } } +pub const hv_crashdump_action_HV_CRASHDUMP_NONE: hv_crashdump_action = 0; +pub const hv_crashdump_action_HV_CRASHDUMP_SUSPEND_ALL_VPS: hv_crashdump_action = 1; +pub const hv_crashdump_action_HV_CRASHDUMP_PREPARE_FOR_STATE_SAVE: hv_crashdump_action = 2; +pub const hv_crashdump_action_HV_CRASHDUMP_STATE_SAVED: hv_crashdump_action = 3; +pub const hv_crashdump_action_HV_CRASHDUMP_ENTRY: hv_crashdump_action = 4; +pub type hv_crashdump_action = ::std::os::raw::c_uint; #[repr(C, packed)] -pub struct hv_output_withdraw_memory { - pub gpa_page_list: __IncompleteArrayField<__u64>, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_partition_event_root_crashdump_input { + pub crashdump_action: __u32, } #[test] -fn bindgen_test_layout_hv_output_withdraw_memory() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_partition_event_root_crashdump_input() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(hv_output_withdraw_memory)) + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(hv_partition_event_root_crashdump_input) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_output_withdraw_memory)) + concat!( + "Alignment of ", + stringify!(hv_partition_event_root_crashdump_input) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gpa_page_list) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).crashdump_action) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_output_withdraw_memory), + stringify!(hv_partition_event_root_crashdump_input), "::", - stringify!(gpa_page_list) + stringify!(crashdump_action) ) ); } -impl Default for hv_output_withdraw_memory { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[repr(C, packed)] -pub struct hv_input_map_gpa_pages { - pub target_partition_id: __u64, - pub target_gpa_base: __u64, - pub map_flags: __u32, - pub padding: __u32, - pub source_gpa_page_list: __IncompleteArrayField<__u64>, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_disable_hyp_ex { + pub rip: __u64, + pub arg: __u64, } #[test] -fn bindgen_test_layout_hv_input_map_gpa_pages() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_disable_hyp_ex() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_map_gpa_pages)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_input_disable_hyp_ex)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_map_gpa_pages)) + concat!("Alignment of ", stringify!(hv_input_disable_hyp_ex)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_map_gpa_pages), + stringify!(hv_input_disable_hyp_ex), "::", - stringify!(target_partition_id) + stringify!(rip) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_gpa_base) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_input_map_gpa_pages), - "::", - stringify!(target_gpa_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).map_flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hv_input_map_gpa_pages), - "::", - stringify!(map_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(hv_input_map_gpa_pages), - "::", - stringify!(padding) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source_gpa_page_list) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(hv_input_map_gpa_pages), + stringify!(hv_input_disable_hyp_ex), "::", - stringify!(source_gpa_page_list) + stringify!(arg) ) ); } -impl Default for hv_input_map_gpa_pages { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_crashdump_area { + pub version: __u32, + pub __bindgen_anon_1: hv_crashdump_area__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] -pub union hv_gpa_page_access_state_flags { - pub __bindgen_anon_1: hv_gpa_page_access_state_flags__bindgen_ty_1, - pub as_uint64: __u64, +pub union hv_crashdump_area__bindgen_ty_1 { + pub flags_as_uint32: __u32, + pub __bindgen_anon_1: hv_crashdump_area__bindgen_ty_1__bindgen_ty_1, } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_gpa_page_access_state_flags__bindgen_ty_1 { +pub struct hv_crashdump_area__bindgen_ty_1__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } #[test] -fn bindgen_test_layout_hv_gpa_page_access_state_flags__bindgen_ty_1() { +fn bindgen_test_layout_hv_crashdump_area__bindgen_ty_1__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 4usize, concat!( "Size of: ", - stringify!(hv_gpa_page_access_state_flags__bindgen_ty_1) + stringify!(hv_crashdump_area__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_gpa_page_access_state_flags__bindgen_ty_1) + stringify!(hv_crashdump_area__bindgen_ty_1__bindgen_ty_1) ) ); } -impl hv_gpa_page_access_state_flags__bindgen_ty_1 { +impl hv_crashdump_area__bindgen_ty_1__bindgen_ty_1 { #[inline] - pub fn clear_accessed(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn cda_valid(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_clear_accessed(&mut self, val: __u64) { + pub fn set_cda_valid(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); + let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn set_access(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } - } - #[inline] - pub fn set_set_access(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn clear_dirty(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } - } - #[inline] - pub fn set_clear_dirty(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn set_dirty(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } - } - #[inline] - pub fn set_set_dirty(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } + pub fn cda_unused(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } } #[inline] - pub fn set_reserved(&mut self, val: __u64) { + pub fn set_cda_unused(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 60u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) } } #[inline] pub fn new_bitfield_1( - clear_accessed: __u64, - set_access: __u64, - clear_dirty: __u64, - set_dirty: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + cda_valid: __u32, + cda_unused: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let clear_accessed: u64 = unsafe { ::std::mem::transmute(clear_accessed) }; - clear_accessed as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let set_access: u64 = unsafe { ::std::mem::transmute(set_access) }; - set_access as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let clear_dirty: u64 = unsafe { ::std::mem::transmute(clear_dirty) }; - clear_dirty as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let set_dirty: u64 = unsafe { ::std::mem::transmute(set_dirty) }; - set_dirty as u64 + let cda_valid: u32 = unsafe { ::std::mem::transmute(cda_valid) }; + cda_valid as u64 }); - __bindgen_bitfield_unit.set(4usize, 60u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 + __bindgen_bitfield_unit.set(1usize, 31u8, { + let cda_unused: u32 = unsafe { ::std::mem::transmute(cda_unused) }; + cda_unused as u64 }); __bindgen_bitfield_unit } } #[test] -fn bindgen_test_layout_hv_gpa_page_access_state_flags() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_crashdump_area__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_gpa_page_access_state_flags)) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_crashdump_area__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hv_crashdump_area__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags_as_uint32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_crashdump_area__bindgen_ty_1), + "::", + stringify!(flags_as_uint32) + ) + ); +} +impl Default for hv_crashdump_area__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_crashdump_area() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), 8usize, - concat!("Alignment of ", stringify!(hv_gpa_page_access_state_flags)) + concat!("Size of: ", stringify!(hv_crashdump_area)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_crashdump_area)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_gpa_page_access_state_flags), + stringify!(hv_crashdump_area), "::", - stringify!(as_uint64) + stringify!(version) ) ); } -impl Default for hv_gpa_page_access_state_flags { +impl Default for hv_crashdump_area { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8237,62 +10682,85 @@ impl Default for hv_gpa_page_access_state_flags { } } #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_input_get_gpa_pages_access_state { - pub partition_id: __u64, - pub flags: hv_gpa_page_access_state_flags, - pub hv_gpa_page_number: __u64, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_partition_event_commit_processor_indices_input { + pub schedulable_processor_count: __u32, } #[test] -fn bindgen_test_layout_hv_input_get_gpa_pages_access_state() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_partition_event_commit_processor_indices_input() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(hv_input_get_gpa_pages_access_state)) + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(hv_partition_event_commit_processor_indices_input) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, concat!( "Alignment of ", - stringify!(hv_input_get_gpa_pages_access_state) + stringify!(hv_partition_event_commit_processor_indices_input) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).schedulable_processor_count) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_gpa_pages_access_state), + stringify!(hv_partition_event_commit_processor_indices_input), "::", - stringify!(partition_id) + stringify!(schedulable_processor_count) ) ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_partition_event_input { + pub crashdump_input: hv_partition_event_root_crashdump_input, + pub commit_lp_indices_input: hv_partition_event_commit_processor_indices_input, +} +#[test] +fn bindgen_test_layout_hv_partition_event_input() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_partition_event_input)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 8usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_partition_event_input)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).crashdump_input) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_gpa_pages_access_state), + stringify!(hv_partition_event_input), "::", - stringify!(flags) + stringify!(crashdump_input) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_gpa_page_number) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).commit_lp_indices_input) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_get_gpa_pages_access_state), + stringify!(hv_partition_event_input), "::", - stringify!(hv_gpa_page_number) + stringify!(commit_lp_indices_input) ) ); } -impl Default for hv_input_get_gpa_pages_access_state { +impl Default for hv_partition_event_input { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8301,120 +10769,55 @@ impl Default for hv_input_get_gpa_pages_access_state { } } } +pub const hv_partition_event_HV_PARTITION_EVENT_DEBUG_DEVICE_AVAILABLE: hv_partition_event = 1; +pub const hv_partition_event_HV_PARTITION_EVENT_ROOT_CRASHDUMP: hv_partition_event = 2; +pub const hv_partition_event_HV_PARTITION_EVENT_ACPI_REENABLED: hv_partition_event = 3; +pub const hv_partition_event_HV_PARTITION_ALL_LOGICAL_PROCESSORS_STARTED: hv_partition_event = 4; +pub const hv_partition_event_HV_PARTITION_COMMIT_LP_INDICES: hv_partition_event = 5; +pub type hv_partition_event = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Copy, Clone)] -pub union hv_gpa_page_access_state { - pub __bindgen_anon_1: hv_gpa_page_access_state__bindgen_ty_1, - pub as_uint8: __u8, -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_gpa_page_access_state__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -#[test] -fn bindgen_test_layout_hv_gpa_page_access_state__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!( - "Size of: ", - stringify!(hv_gpa_page_access_state__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(hv_gpa_page_access_state__bindgen_ty_1) - ) - ); -} -impl hv_gpa_page_access_state__bindgen_ty_1 { - #[inline] - pub fn accessed(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_accessed(&mut self, val: __u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn dirty(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_dirty(&mut self, val: __u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 6u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - accessed: __u8, - dirty: __u8, - reserved: __u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let accessed: u8 = unsafe { ::std::mem::transmute(accessed) }; - accessed as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let dirty: u8 = unsafe { ::std::mem::transmute(dirty) }; - dirty as u64 - }); - __bindgen_bitfield_unit.set(2usize, 6u8, { - let reserved: u8 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } +pub struct hv_input_notify_partition_event { + pub event: __u32, + pub input: hv_partition_event_input, } #[test] -fn bindgen_test_layout_hv_gpa_page_access_state() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_notify_partition_event() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(hv_gpa_page_access_state)) + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_input_notify_partition_event)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_gpa_page_access_state)) + concat!("Alignment of ", stringify!(hv_input_notify_partition_event)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).event) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_input_notify_partition_event), + "::", + stringify!(event) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint8) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).input) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_gpa_page_access_state), + stringify!(hv_input_notify_partition_event), "::", - stringify!(as_uint8) + stringify!(input) ) ); } -impl Default for hv_gpa_page_access_state { +impl Default for hv_input_notify_partition_event { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8423,181 +10826,156 @@ impl Default for hv_gpa_page_access_state { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_snp_guest_policy { - pub __bindgen_anon_1: hv_snp_guest_policy__bindgen_ty_1, - pub as_uint64: __u64, -} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_snp_guest_policy__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +pub struct hv_lp_startup_status { + pub hv_status: __u64, + pub substatus1: __u64, + pub substatus2: __u64, + pub substatus3: __u64, + pub substatus4: __u64, + pub substatus5: __u64, + pub substatus6: __u64, } #[test] -fn bindgen_test_layout_hv_snp_guest_policy__bindgen_ty_1() { +fn bindgen_test_layout_hv_lp_startup_status() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_snp_guest_policy__bindgen_ty_1)) + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(hv_lp_startup_status)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_lp_startup_status)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hv_status) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_snp_guest_policy__bindgen_ty_1) + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(hv_status) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus1) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus2) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus3) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus3) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus4) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus4) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus5) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus5) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).substatus6) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(hv_lp_startup_status), + "::", + stringify!(substatus6) ) ); } -impl hv_snp_guest_policy__bindgen_ty_1 { - #[inline] - pub fn minor_version(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u64) } - } - #[inline] - pub fn set_minor_version(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 8u8, val as u64) - } - } - #[inline] - pub fn major_version(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u64) } - } - #[inline] - pub fn set_major_version(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 8u8, val as u64) - } - } - #[inline] - pub fn smt_allowed(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } - } - #[inline] - pub fn set_smt_allowed(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 1u8, val as u64) - } - } - #[inline] - pub fn vmpls_required(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } - } - #[inline] - pub fn set_vmpls_required(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(17usize, 1u8, val as u64) - } - } - #[inline] - pub fn migration_agent_allowed(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } - } - #[inline] - pub fn set_migration_agent_allowed(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(18usize, 1u8, val as u64) - } - } - #[inline] - pub fn debug_allowed(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } - } - #[inline] - pub fn set_debug_allowed(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(19usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 44u8) as u64) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(20usize, 44u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - minor_version: __u64, - major_version: __u64, - smt_allowed: __u64, - vmpls_required: __u64, - migration_agent_allowed: __u64, - debug_allowed: __u64, - reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let minor_version: u64 = unsafe { ::std::mem::transmute(minor_version) }; - minor_version as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let major_version: u64 = unsafe { ::std::mem::transmute(major_version) }; - major_version as u64 - }); - __bindgen_bitfield_unit.set(16usize, 1u8, { - let smt_allowed: u64 = unsafe { ::std::mem::transmute(smt_allowed) }; - smt_allowed as u64 - }); - __bindgen_bitfield_unit.set(17usize, 1u8, { - let vmpls_required: u64 = unsafe { ::std::mem::transmute(vmpls_required) }; - vmpls_required as u64 - }); - __bindgen_bitfield_unit.set(18usize, 1u8, { - let migration_agent_allowed: u64 = - unsafe { ::std::mem::transmute(migration_agent_allowed) }; - migration_agent_allowed as u64 - }); - __bindgen_bitfield_unit.set(19usize, 1u8, { - let debug_allowed: u64 = unsafe { ::std::mem::transmute(debug_allowed) }; - debug_allowed as u64 - }); - __bindgen_bitfield_unit.set(20usize, 44u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit - } +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_add_logical_processor { + pub lp_index: __u32, + pub apic_id: __u32, + pub proximity_domain_info: hv_proximity_domain_info, } #[test] -fn bindgen_test_layout_hv_snp_guest_policy() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_input_add_logical_processor() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_snp_guest_policy)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_input_add_logical_processor)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_add_logical_processor)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_input_add_logical_processor), + "::", + stringify!(lp_index) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_snp_guest_policy)) + unsafe { ::std::ptr::addr_of!((*ptr).apic_id) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_input_add_logical_processor), + "::", + stringify!(apic_id) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).proximity_domain_info) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_snp_guest_policy), + stringify!(hv_input_add_logical_processor), "::", - stringify!(as_uint64) + stringify!(proximity_domain_info) ) ); } -impl Default for hv_snp_guest_policy { +impl Default for hv_input_add_logical_processor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8607,207 +10985,247 @@ impl Default for hv_snp_guest_policy { } } #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_snp_id_block { - pub launch_digest: [__u8; 48usize], - pub family_id: [__u8; 16usize], - pub image_id: [__u8; 16usize], - pub version: __u32, - pub guest_svn: __u32, - pub policy: hv_snp_guest_policy, +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_output_add_logical_processor { + pub startup_status: hv_lp_startup_status, } #[test] -fn bindgen_test_layout_hv_snp_id_block() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_output_add_logical_processor() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(hv_snp_id_block)) + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(hv_output_add_logical_processor)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_snp_id_block)) + concat!("Alignment of ", stringify!(hv_output_add_logical_processor)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).launch_digest) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).startup_status) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_output_add_logical_processor), "::", - stringify!(launch_digest) + stringify!(startup_status) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_get_logical_processor_run_time { + pub lp_index: __u32, +} +#[test] +fn bindgen_test_layout_hv_input_get_logical_processor_run_time() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!( + "Size of: ", + stringify!(hv_input_get_logical_processor_run_time) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).family_id) as usize - ptr as usize }, - 48usize, + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_input_get_logical_processor_run_time) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_input_get_logical_processor_run_time), "::", - stringify!(family_id) + stringify!(lp_index) + ) + ); +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_output_get_logical_processor_run_time { + pub global_time: __u64, + pub local_run_time: __u64, + pub rsvdz0: __u64, + pub hypervisor_time: __u64, +} +#[test] +fn bindgen_test_layout_hv_output_get_logical_processor_run_time() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(hv_output_get_logical_processor_run_time) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).image_id) as usize - ptr as usize }, - 64usize, + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(hv_output_get_logical_processor_run_time) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).global_time) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_output_get_logical_processor_run_time), "::", - stringify!(image_id) + stringify!(global_time) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 80usize, + unsafe { ::std::ptr::addr_of!((*ptr).local_run_time) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_output_get_logical_processor_run_time), "::", - stringify!(version) + stringify!(local_run_time) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).guest_svn) as usize - ptr as usize }, - 84usize, + unsafe { ::std::ptr::addr_of!((*ptr).rsvdz0) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_output_get_logical_processor_run_time), "::", - stringify!(guest_svn) + stringify!(rsvdz0) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).policy) as usize - ptr as usize }, - 88usize, + unsafe { ::std::ptr::addr_of!((*ptr).hypervisor_time) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_block), + stringify!(hv_output_get_logical_processor_run_time), "::", - stringify!(policy) + stringify!(hypervisor_time) ) ); } -impl Default for hv_snp_id_block { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} +pub const HvSubnodeAny: _bindgen_ty_1 = 0; +pub const HvSubnodeSocket: _bindgen_ty_1 = 1; +pub const HvSubnodeCluster: _bindgen_ty_1 = 2; +pub const HvSubnodeL3: _bindgen_ty_1 = 3; +pub const HvSubnodeCount: _bindgen_ty_1 = 4; +pub const HvSubnodeInvalid: _bindgen_ty_1 = -1; +pub type _bindgen_ty_1 = ::std::os::raw::c_int; #[repr(C, packed)] -#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_snp_id_auth_info { - pub id_key_algorithm: __u32, - pub auth_key_algorithm: __u32, - pub reserved0: [__u8; 56usize], - pub id_block_signature: [__u8; 512usize], - pub id_key: [__u8; 1028usize], - pub reserved1: [__u8; 60usize], - pub id_key_signature: [__u8; 512usize], - pub author_key: [__u8; 1028usize], +#[derive(Copy, Clone)] +pub struct hv_create_vp { + pub partition_id: __u64, + pub vp_index: __u32, + pub padding: [__u8; 3usize], + pub subnode_type: __u8, + pub subnode_id: __u64, + pub proximity_domain_info: hv_proximity_domain_info, + pub flags: __u64, } #[test] -fn bindgen_test_layout_hv_snp_id_auth_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_create_vp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 3204usize, - concat!("Size of: ", stringify!(hv_snp_id_auth_info)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(hv_create_vp)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_snp_id_auth_info)) + concat!("Alignment of ", stringify!(hv_create_vp)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_key_algorithm) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), - "::", - stringify!(id_key_algorithm) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).auth_key_algorithm) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(auth_key_algorithm) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved0) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(reserved0) + stringify!(vp_index) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_block_signature) as usize - ptr as usize }, - 64usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 12usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(id_block_signature) + stringify!(padding) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_key) as usize - ptr as usize }, - 576usize, + unsafe { ::std::ptr::addr_of!((*ptr).subnode_type) as usize - ptr as usize }, + 15usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(id_key) + stringify!(subnode_type) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 1604usize, + unsafe { ::std::ptr::addr_of!((*ptr).subnode_id) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(reserved1) + stringify!(subnode_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_key_signature) as usize - ptr as usize }, - 1664usize, + unsafe { ::std::ptr::addr_of!((*ptr).proximity_domain_info) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(id_key_signature) + stringify!(proximity_domain_info) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).author_key) as usize - ptr as usize }, - 2176usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(hv_snp_id_auth_info), + stringify!(hv_create_vp), "::", - stringify!(author_key) + stringify!(flags) ) ); } -impl Default for hv_snp_id_auth_info { +impl Default for hv_create_vp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8817,81 +11235,268 @@ impl Default for hv_snp_id_auth_info { } } #[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_psp_launch_finish_data { - pub id_block: hv_snp_id_block, - pub id_auth_info: hv_snp_id_auth_info, - pub host_data: [__u8; 32usize], - pub id_block_enabled: __u8, - pub author_key_enabled: __u8, +pub struct hv_send_ipi_ex { + pub vector: __u32, + pub reserved: __u32, + pub vp_set: hv_vpset, } #[test] -fn bindgen_test_layout_hv_psp_launch_finish_data() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_send_ipi_ex() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 3334usize, - concat!("Size of: ", stringify!(hv_psp_launch_finish_data)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_send_ipi_ex)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_psp_launch_finish_data)) + concat!("Alignment of ", stringify!(hv_send_ipi_ex)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_block) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vector) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_psp_launch_finish_data), + stringify!(hv_send_ipi_ex), "::", - stringify!(id_block) + stringify!(vector) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_auth_info) as usize - ptr as usize }, - 96usize, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_psp_launch_finish_data), + stringify!(hv_send_ipi_ex), "::", - stringify!(id_auth_info) + stringify!(reserved) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).host_data) as usize - ptr as usize }, - 3300usize, + unsafe { ::std::ptr::addr_of!((*ptr).vp_set) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_psp_launch_finish_data), + stringify!(hv_send_ipi_ex), "::", - stringify!(host_data) + stringify!(vp_set) ) ); +} +impl Default for hv_send_ipi_ex { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_attdev_flags { + pub __bindgen_anon_1: hv_attdev_flags__bindgen_ty_1, + pub as_uint32: __u32, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_attdev_flags__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[test] +fn bindgen_test_layout_hv_attdev_flags__bindgen_ty_1() { assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id_block_enabled) as usize - ptr as usize }, - 3332usize, - concat!( - "Offset of field: ", - stringify!(hv_psp_launch_finish_data), - "::", - stringify!(id_block_enabled) - ) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_attdev_flags__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).author_key_enabled) as usize - ptr as usize }, - 3333usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_attdev_flags__bindgen_ty_1)) + ); +} +impl hv_attdev_flags__bindgen_ty_1 { + #[inline] + pub fn logical_id(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_logical_id(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn resvd0(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_resvd0(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn ats_enabled(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_ats_enabled(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn virt_func(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_virt_func(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn shared_irq_child(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_shared_irq_child(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub fn virt_dev(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_virt_dev(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub fn ats_supported(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_ats_supported(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub fn small_irt(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_small_irt(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub fn resvd(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) } + } + #[inline] + pub fn set_resvd(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + logical_id: __u32, + resvd0: __u32, + ats_enabled: __u32, + virt_func: __u32, + shared_irq_child: __u32, + virt_dev: __u32, + ats_supported: __u32, + small_irt: __u32, + resvd: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let logical_id: u32 = unsafe { ::std::mem::transmute(logical_id) }; + logical_id as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let resvd0: u32 = unsafe { ::std::mem::transmute(resvd0) }; + resvd0 as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ats_enabled: u32 = unsafe { ::std::mem::transmute(ats_enabled) }; + ats_enabled as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let virt_func: u32 = unsafe { ::std::mem::transmute(virt_func) }; + virt_func as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let shared_irq_child: u32 = unsafe { ::std::mem::transmute(shared_irq_child) }; + shared_irq_child as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let virt_dev: u32 = unsafe { ::std::mem::transmute(virt_dev) }; + virt_dev as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let ats_supported: u32 = unsafe { ::std::mem::transmute(ats_supported) }; + ats_supported as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let small_irt: u32 = unsafe { ::std::mem::transmute(small_irt) }; + small_irt as u64 + }); + __bindgen_bitfield_unit.set(8usize, 24u8, { + let resvd: u32 = unsafe { ::std::mem::transmute(resvd) }; + resvd as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_attdev_flags() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_attdev_flags)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hv_attdev_flags)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint32) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_psp_launch_finish_data), + stringify!(hv_attdev_flags), "::", - stringify!(author_key_enabled) + stringify!(as_uint32) ) ); } -impl Default for hv_psp_launch_finish_data { +impl Default for hv_attdev_flags { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8900,55 +11505,145 @@ impl Default for hv_psp_launch_finish_data { } } } -#[repr(C, packed)] +#[repr(C)] #[derive(Copy, Clone)] -pub union hv_partition_complete_isolated_import_data { - pub reserved: __u64, - pub psp_parameters: hv_psp_launch_finish_data, +pub union hv_dev_pci_caps { + pub __bindgen_anon_1: hv_dev_pci_caps__bindgen_ty_1, + pub as_uint32: __u32, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_dev_pci_caps__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } #[test] -fn bindgen_test_layout_hv_partition_complete_isolated_import_data() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); +fn bindgen_test_layout_hv_dev_pci_caps__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 3334usize, - concat!( - "Size of: ", - stringify!(hv_partition_complete_isolated_import_data) - ) + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_dev_pci_caps__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_partition_complete_isolated_import_data) - ) + concat!("Alignment of ", stringify!(hv_dev_pci_caps__bindgen_ty_1)) + ); +} +impl hv_dev_pci_caps__bindgen_ty_1 { + #[inline] + pub fn max_pasid_width(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_max_pasid_width(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn invalidate_qdepth(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_invalidate_qdepth(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn global_inval(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_global_inval(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn prg_response_req(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_prg_response_req(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn resvd(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 24u8) as u32) } + } + #[inline] + pub fn set_resvd(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + max_pasid_width: __u32, + invalidate_qdepth: __u32, + global_inval: __u32, + prg_response_req: __u32, + resvd: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let max_pasid_width: u32 = unsafe { ::std::mem::transmute(max_pasid_width) }; + max_pasid_width as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let invalidate_qdepth: u32 = unsafe { ::std::mem::transmute(invalidate_qdepth) }; + invalidate_qdepth as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let global_inval: u32 = unsafe { ::std::mem::transmute(global_inval) }; + global_inval as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let prg_response_req: u32 = unsafe { ::std::mem::transmute(prg_response_req) }; + prg_response_req as u64 + }); + __bindgen_bitfield_unit.set(4usize, 24u8, { + let resvd: u32 = unsafe { ::std::mem::transmute(resvd) }; + resvd as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_dev_pci_caps() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_dev_pci_caps)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_partition_complete_isolated_import_data), - "::", - stringify!(reserved) - ) + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hv_dev_pci_caps)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).psp_parameters) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint32) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_partition_complete_isolated_import_data), + stringify!(hv_dev_pci_caps), "::", - stringify!(psp_parameters) + stringify!(as_uint32) ) ); } -impl Default for hv_partition_complete_isolated_import_data { +impl Default for hv_dev_pci_caps { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -8957,52 +11652,111 @@ impl Default for hv_partition_complete_isolated_import_data { } } } +pub type hv_pci_rid = __u16; +pub type hv_pci_segment = __u16; +pub type hv_logical_device_id = __u64; #[repr(C, packed)] #[derive(Copy, Clone)] -pub struct hv_input_complete_isolated_import { - pub partition_id: __u64, - pub import_data: hv_partition_complete_isolated_import_data, +pub union hv_pci_bdf { + pub as_uint16: __u16, + pub __bindgen_anon_1: hv_pci_bdf__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_pci_bdf__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub bus: __u8, } #[test] -fn bindgen_test_layout_hv_input_complete_isolated_import() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_pci_bdf__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 3342usize, - concat!("Size of: ", stringify!(hv_input_complete_isolated_import)) + ::std::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(hv_pci_bdf__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_input_complete_isolated_import) - ) + concat!("Alignment of ", stringify!(hv_pci_bdf__bindgen_ty_1)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).bus) as usize - ptr as usize }, + 1usize, concat!( "Offset of field: ", - stringify!(hv_input_complete_isolated_import), + stringify!(hv_pci_bdf__bindgen_ty_1), "::", - stringify!(partition_id) + stringify!(bus) ) ); +} +impl hv_pci_bdf__bindgen_ty_1 { + #[inline] + pub fn function(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) } + } + #[inline] + pub fn set_function(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub fn device(&self) -> __u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) } + } + #[inline] + pub fn set_device(&mut self, val: __u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 5u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(function: __u8, device: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let function: u8 = unsafe { ::std::mem::transmute(function) }; + function as u64 + }); + __bindgen_bitfield_unit.set(3usize, 5u8, { + let device: u8 = unsafe { ::std::mem::transmute(device) }; + device as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_pci_bdf() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(hv_pci_bdf)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).import_data) as usize - ptr as usize }, - 8usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_pci_bdf)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint16) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_complete_isolated_import), + stringify!(hv_pci_bdf), "::", - stringify!(import_data) + stringify!(as_uint16) ) ); } -impl Default for hv_input_complete_isolated_import { +impl Default for hv_pci_bdf { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -9011,186 +11765,240 @@ impl Default for hv_input_complete_isolated_import { } } } -pub const hv_crashdump_action_HV_CRASHDUMP_NONE: hv_crashdump_action = 0; -pub const hv_crashdump_action_HV_CRASHDUMP_SUSPEND_ALL_VPS: hv_crashdump_action = 1; -pub const hv_crashdump_action_HV_CRASHDUMP_PREPARE_FOR_STATE_SAVE: hv_crashdump_action = 2; -pub const hv_crashdump_action_HV_CRASHDUMP_STATE_SAVED: hv_crashdump_action = 3; -pub const hv_crashdump_action_HV_CRASHDUMP_ENTRY: hv_crashdump_action = 4; -pub type hv_crashdump_action = ::std::os::raw::c_uint; #[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_pci_bus_range { + pub as_uint16: __u16, + pub __bindgen_anon_1: hv_pci_bus_range__bindgen_ty_1, +} +#[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_partition_event_root_crashdump_input { - pub crashdump_action: __u32, +pub struct hv_pci_bus_range__bindgen_ty_1 { + pub subordinate_bus: __u8, + pub secondary_bus: __u8, } #[test] -fn bindgen_test_layout_hv_partition_event_root_crashdump_input() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_pci_bus_range__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(hv_partition_event_root_crashdump_input) - ) + ::std::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(hv_pci_bus_range__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_pci_bus_range__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).subordinate_bus) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_partition_event_root_crashdump_input) + "Offset of field: ", + stringify!(hv_pci_bus_range__bindgen_ty_1), + "::", + stringify!(subordinate_bus) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).crashdump_action) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).secondary_bus) as usize - ptr as usize }, + 1usize, concat!( "Offset of field: ", - stringify!(hv_partition_event_root_crashdump_input), + stringify!(hv_pci_bus_range__bindgen_ty_1), "::", - stringify!(crashdump_action) + stringify!(secondary_bus) ) ); } -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_partition_event_commit_processor_indices_input { - pub schedulable_processor_count: __u32, -} #[test] -fn bindgen_test_layout_hv_partition_event_commit_processor_indices_input() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_pci_bus_range() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(hv_partition_event_commit_processor_indices_input) - ) + ::std::mem::size_of::(), + 2usize, + concat!("Size of: ", stringify!(hv_pci_bus_range)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!( - "Alignment of ", - stringify!(hv_partition_event_commit_processor_indices_input) - ) + concat!("Alignment of ", stringify!(hv_pci_bus_range)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).schedulable_processor_count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).as_uint16) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_partition_event_commit_processor_indices_input), + stringify!(hv_pci_bus_range), "::", - stringify!(schedulable_processor_count) + stringify!(as_uint16) ) ); } -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_partition_event_input { - pub crashdump_input: hv_partition_event_root_crashdump_input, - pub commit_lp_indices_input: hv_partition_event_commit_processor_indices_input, +impl Default for hv_pci_bus_range { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const hv_device_type_HV_DEVICE_TYPE_LOGICAL: hv_device_type = 0; +pub const hv_device_type_HV_DEVICE_TYPE_PCI: hv_device_type = 1; +pub const hv_device_type_HV_DEVICE_TYPE_IOAPIC: hv_device_type = 2; +pub const hv_device_type_HV_DEVICE_TYPE_ACPI: hv_device_type = 3; +pub type hv_device_type = ::std::os::raw::c_uint; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_input_detach_device { + pub partition_id: __u64, + pub logical_devid: __u64, } #[test] -fn bindgen_test_layout_hv_partition_event_input() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_detach_device() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(hv_partition_event_input)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_input_detach_device)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_partition_event_input)) + concat!("Alignment of ", stringify!(hv_input_detach_device)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).crashdump_input) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_partition_event_input), + stringify!(hv_input_detach_device), "::", - stringify!(crashdump_input) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).commit_lp_indices_input) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).logical_devid) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(hv_partition_event_input), + stringify!(hv_input_detach_device), "::", - stringify!(commit_lp_indices_input) + stringify!(logical_devid) ) ); } -impl Default for hv_partition_event_input { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const hv_partition_event_HV_PARTITION_EVENT_DEBUG_DEVICE_AVAILABLE: hv_partition_event = 1; -pub const hv_partition_event_HV_PARTITION_EVENT_ROOT_CRASHDUMP: hv_partition_event = 2; -pub const hv_partition_event_HV_PARTITION_EVENT_ACPI_REENABLED: hv_partition_event = 3; -pub const hv_partition_event_HV_PARTITION_ALL_LOGICAL_PROCESSORS_STARTED: hv_partition_event = 4; -pub const hv_partition_event_HV_PARTITION_COMMIT_LP_INDICES: hv_partition_event = 5; -pub type hv_partition_event = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Copy, Clone)] -pub struct hv_input_notify_partition_event { - pub event: __u32, - pub input: hv_partition_event_input, +pub union hv_device_domain_id { + pub as_uint64: __u64, + pub __bindgen_anon_1: hv_device_domain_id__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_device_domain_id__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub id: __u32, } #[test] -fn bindgen_test_layout_hv_input_notify_partition_event() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_device_domain_id__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(hv_input_notify_partition_event)) + concat!("Size of: ", stringify!(hv_device_domain_id__bindgen_ty_1)) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_input_notify_partition_event)) + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(hv_device_domain_id__bindgen_ty_1) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).event) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(hv_input_notify_partition_event), + stringify!(hv_device_domain_id__bindgen_ty_1), "::", - stringify!(event) + stringify!(id) ) ); +} +impl hv_device_domain_id__bindgen_ty_1 { + #[inline] + pub fn type_(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_type(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 28u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(type_: __u32, reserved: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let type_: u32 = unsafe { ::std::mem::transmute(type_) }; + type_ as u64 + }); + __bindgen_bitfield_unit.set(4usize, 28u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_device_domain_id() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hv_device_domain_id)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).input) as usize - ptr as usize }, - 4usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_device_domain_id)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_notify_partition_event), + stringify!(hv_device_domain_id), "::", - stringify!(input) + stringify!(as_uint64) ) ); } -impl Default for hv_input_notify_partition_event { +impl Default for hv_device_domain_id { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -9200,155 +12008,244 @@ impl Default for hv_input_notify_partition_event { } } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_lp_startup_status { - pub hv_status: __u64, - pub substatus1: __u64, - pub substatus2: __u64, - pub substatus3: __u64, - pub substatus4: __u64, - pub substatus5: __u64, - pub substatus6: __u64, +#[derive(Copy, Clone)] +pub struct hv_input_device_domain { + pub partition_id: __u64, + pub owner_vtl: hv_input_vtl, + pub padding: [__u8; 7usize], + pub domain_id: hv_device_domain_id, } #[test] -fn bindgen_test_layout_hv_lp_startup_status() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_input_device_domain() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(hv_lp_startup_status)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_device_domain)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_lp_startup_status)) + concat!("Alignment of ", stringify!(hv_input_device_domain)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_status) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_lp_startup_status), + stringify!(hv_input_device_domain), "::", - stringify!(hv_status) + stringify!(partition_id) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus1) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).owner_vtl) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(hv_lp_startup_status), + stringify!(hv_input_device_domain), "::", - stringify!(substatus1) + stringify!(owner_vtl) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus2) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 9usize, concat!( "Offset of field: ", - stringify!(hv_lp_startup_status), + stringify!(hv_input_device_domain), "::", - stringify!(substatus2) + stringify!(padding) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus3) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).domain_id) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(hv_lp_startup_status), + stringify!(hv_input_device_domain), "::", - stringify!(substatus3) + stringify!(domain_id) ) ); +} +impl Default for hv_input_device_domain { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_create_device_domain_flags { + pub as_uint32: __u32, + pub __bindgen_anon_1: hv_create_device_domain_flags__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_create_device_domain_flags__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[test] +fn bindgen_test_layout_hv_create_device_domain_flags__bindgen_ty_1() { assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus4) as usize - ptr as usize }, - 32usize, + ::std::mem::size_of::(), + 4usize, concat!( - "Offset of field: ", - stringify!(hv_lp_startup_status), - "::", - stringify!(substatus4) + "Size of: ", + stringify!(hv_create_device_domain_flags__bindgen_ty_1) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus5) as usize - ptr as usize }, - 40usize, + ::std::mem::align_of::(), + 1usize, concat!( - "Offset of field: ", - stringify!(hv_lp_startup_status), - "::", - stringify!(substatus5) + "Alignment of ", + stringify!(hv_create_device_domain_flags__bindgen_ty_1) ) ); +} +impl hv_create_device_domain_flags__bindgen_ty_1 { + #[inline] + pub fn forward_progress_required(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_forward_progress_required(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn inherit_owning_vtl(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_inherit_owning_vtl(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: __u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + forward_progress_required: __u32, + inherit_owning_vtl: __u32, + reserved: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let forward_progress_required: u32 = + unsafe { ::std::mem::transmute(forward_progress_required) }; + forward_progress_required as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let inherit_owning_vtl: u32 = unsafe { ::std::mem::transmute(inherit_owning_vtl) }; + inherit_owning_vtl as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let reserved: u32 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit + } +} +#[test] +fn bindgen_test_layout_hv_create_device_domain_flags() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(hv_create_device_domain_flags)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).substatus6) as usize - ptr as usize }, - 48usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_create_device_domain_flags)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint32) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_lp_startup_status), + stringify!(hv_create_device_domain_flags), "::", - stringify!(substatus6) + stringify!(as_uint32) ) ); } +impl Default for hv_create_device_domain_flags { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C, packed)] #[derive(Copy, Clone)] -pub struct hv_input_add_logical_processor { - pub lp_index: __u32, - pub apic_id: __u32, - pub proximity_domain_info: hv_proximity_domain_info, +pub struct hv_input_create_device_domain { + pub device_domain: hv_input_device_domain, + pub create_device_domain_flags: hv_create_device_domain_flags, } #[test] -fn bindgen_test_layout_hv_input_add_logical_processor() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_create_device_domain() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(hv_input_add_logical_processor)) + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(hv_input_create_device_domain)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_input_add_logical_processor)) + concat!("Alignment of ", stringify!(hv_input_create_device_domain)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).device_domain) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_input_add_logical_processor), - "::", - stringify!(lp_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_id) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_input_add_logical_processor), + stringify!(hv_input_create_device_domain), "::", - stringify!(apic_id) + stringify!(device_domain) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).proximity_domain_info) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).create_device_domain_flags) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(hv_input_add_logical_processor), + stringify!(hv_input_create_device_domain), "::", - stringify!(proximity_domain_info) + stringify!(create_device_domain_flags) ) ); } -impl Default for hv_input_add_logical_processor { +impl Default for hv_input_create_device_domain { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -9358,143 +12255,190 @@ impl Default for hv_input_add_logical_processor { } } #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_output_add_logical_processor { - pub startup_status: hv_lp_startup_status, +#[derive(Copy, Clone)] +pub struct hv_input_delete_device_domain { + pub device_domain: hv_input_device_domain, } #[test] -fn bindgen_test_layout_hv_output_add_logical_processor() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_delete_device_domain() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(hv_output_add_logical_processor)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(hv_input_delete_device_domain)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(hv_output_add_logical_processor)) + concat!("Alignment of ", stringify!(hv_input_delete_device_domain)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).startup_status) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).device_domain) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_output_add_logical_processor), + stringify!(hv_input_delete_device_domain), "::", - stringify!(startup_status) + stringify!(device_domain) ) ); } +impl Default for hv_input_delete_device_domain { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_input_get_logical_processor_run_time { - pub lp_index: __u32, +pub struct hv_input_map_device_gpa_pages { + pub device_domain: hv_input_device_domain, + pub target_vtl: hv_input_vtl, + pub padding: [__u8; 3usize], + pub map_flags: __u32, + pub target_device_va_base: __u64, + pub gpa_page_list: __IncompleteArrayField<__u64>, } #[test] -fn bindgen_test_layout_hv_input_get_logical_processor_run_time() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_hv_input_map_device_gpa_pages() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(hv_input_get_logical_processor_run_time) - ) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(hv_input_map_device_gpa_pages)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, + concat!("Alignment of ", stringify!(hv_input_map_device_gpa_pages)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).device_domain) as usize - ptr as usize }, + 0usize, concat!( - "Alignment of ", - stringify!(hv_input_get_logical_processor_run_time) + "Offset of field: ", + stringify!(hv_input_map_device_gpa_pages), + "::", + stringify!(device_domain) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lp_index) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).target_vtl) as usize - ptr as usize }, + 24usize, concat!( "Offset of field: ", - stringify!(hv_input_get_logical_processor_run_time), + stringify!(hv_input_map_device_gpa_pages), "::", - stringify!(lp_index) + stringify!(target_vtl) ) ); -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_output_get_logical_processor_run_time { - pub global_time: __u64, - pub local_run_time: __u64, - pub rsvdz0: __u64, - pub hypervisor_time: __u64, -} -#[test] -fn bindgen_test_layout_hv_output_get_logical_processor_run_time() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 25usize, concat!( - "Size of: ", - stringify!(hv_output_get_logical_processor_run_time) + "Offset of field: ", + stringify!(hv_input_map_device_gpa_pages), + "::", + stringify!(padding) ) ); assert_eq!( - ::std::mem::align_of::(), - 1usize, + unsafe { ::std::ptr::addr_of!((*ptr).map_flags) as usize - ptr as usize }, + 28usize, concat!( - "Alignment of ", - stringify!(hv_output_get_logical_processor_run_time) + "Offset of field: ", + stringify!(hv_input_map_device_gpa_pages), + "::", + stringify!(map_flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).global_time) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).target_device_va_base) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(hv_output_get_logical_processor_run_time), + stringify!(hv_input_map_device_gpa_pages), "::", - stringify!(global_time) + stringify!(target_device_va_base) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).local_run_time) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).gpa_page_list) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(hv_output_get_logical_processor_run_time), + stringify!(hv_input_map_device_gpa_pages), "::", - stringify!(local_run_time) + stringify!(gpa_page_list) ) ); +} +impl Default for hv_input_map_device_gpa_pages { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_input_unmap_device_gpa_pages { + pub device_domain: hv_input_device_domain, + pub target_device_va_base: __u64, +} +#[test] +fn bindgen_test_layout_hv_input_unmap_device_gpa_pages() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(hv_input_unmap_device_gpa_pages)) + ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvdz0) as usize - ptr as usize }, - 16usize, + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_input_unmap_device_gpa_pages)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).device_domain) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_output_get_logical_processor_run_time), + stringify!(hv_input_unmap_device_gpa_pages), "::", - stringify!(rsvdz0) + stringify!(device_domain) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hypervisor_time) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).target_device_va_base) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(hv_output_get_logical_processor_run_time), + stringify!(hv_input_unmap_device_gpa_pages), "::", - stringify!(hypervisor_time) + stringify!(target_device_va_base) ) ); } +impl Default for hv_input_unmap_device_gpa_pages { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub const hv_stats_hypervisor_counters_HvLogicalProcessors: hv_stats_hypervisor_counters = 1; pub const hv_stats_hypervisor_counters_HvPartitions: hv_stats_hypervisor_counters = 2; pub const hv_stats_hypervisor_counters_HvTotalPages: hv_stats_hypervisor_counters = 3; @@ -9507,6 +12451,7 @@ pub const hv_stats_hypervisor_counters_HvIOSpacePages: hv_stats_hypervisor_count pub const hv_stats_hypervisor_counters_HvNonEssentialPagesForDump: hv_stats_hypervisor_counters = 11; pub const hv_stats_hypervisor_counters_HvSubsumedPages: hv_stats_hypervisor_counters = 12; +pub const hv_stats_hypervisor_counters_HvStatsMaxCounter: hv_stats_hypervisor_counters = 13; pub type hv_stats_hypervisor_counters = ::std::os::raw::c_uint; pub const hv_stats_partition_counters_PartitionVirtualProcessors: hv_stats_partition_counters = 1; pub const hv_stats_partition_counters_PartitionTlbSize: hv_stats_partition_counters = 3; @@ -9548,6 +12493,7 @@ pub const hv_stats_partition_counters_PartitionNestedTlbTrimmedPages: hv_stats_p pub const hv_stats_partition_counters_PartitionPagesShattered: hv_stats_partition_counters = 31; pub const hv_stats_partition_counters_PartitionPagesRecombined: hv_stats_partition_counters = 32; pub const hv_stats_partition_counters_PartitionHwpRequestValue: hv_stats_partition_counters = 33; +pub const hv_stats_partition_counters_PartitionStatsMaxCounter: hv_stats_partition_counters = 34; pub type hv_stats_partition_counters = ::std::os::raw::c_uint; pub const hv_stats_vp_counters_VpTotalRunTime: hv_stats_vp_counters = 1; pub const hv_stats_vp_counters_VpHypervisorRunTime: hv_stats_vp_counters = 2; @@ -9749,6 +12695,9 @@ pub const hv_stats_vp_counters_VpEventLogHypercalls: hv_stats_vp_counters = 196; pub const hv_stats_vp_counters_VpDeviceDomainHypercalls: hv_stats_vp_counters = 197; pub const hv_stats_vp_counters_VpDepositHypercalls: hv_stats_vp_counters = 198; pub const hv_stats_vp_counters_VpSvmHypercalls: hv_stats_vp_counters = 199; +pub const hv_stats_vp_counters_VpBusLockAcquisitionCount: hv_stats_vp_counters = 200; +pub const hv_stats_vp_counters_VpRootDispatchThreadBlocked: hv_stats_vp_counters = 201; +pub const hv_stats_vp_counters_VpStatsMaxCounter: hv_stats_vp_counters = 202; pub type hv_stats_vp_counters = ::std::os::raw::c_uint; pub const hv_stats_lp_counters_LpGlobalTime: hv_stats_lp_counters = 1; pub const hv_stats_lp_counters_LpTotalRunTime: hv_stats_lp_counters = 2; @@ -9801,15 +12750,128 @@ pub const hv_stats_lp_counters_LpPlaceholder10: hv_stats_lp_counters = 48; pub const hv_stats_lp_counters_LpReserveGroupId: hv_stats_lp_counters = 49; pub const hv_stats_lp_counters_LpRunningPriority: hv_stats_lp_counters = 50; pub const hv_stats_lp_counters_LpPerfmonInterruptCount: hv_stats_lp_counters = 51; +pub const hv_stats_lp_counters_LpStatsMaxCounter: hv_stats_lp_counters = 52; pub type hv_stats_lp_counters = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Copy, Clone)] +pub struct hv_stats_page { + pub __bindgen_anon_1: hv_stats_page__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union hv_stats_page__bindgen_ty_1 { + pub hv_cntrs: [__u64; 13usize], + pub pt_cntrs: [__u64; 34usize], + pub vp_cntrs: [__u64; 202usize], + pub lp_cntrs: [__u64; 52usize], + pub data: [__u8; 4096usize], +} +#[test] +fn bindgen_test_layout_hv_stats_page__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4096usize, + concat!("Size of: ", stringify!(hv_stats_page__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hv_stats_page__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hv_cntrs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_stats_page__bindgen_ty_1), + "::", + stringify!(hv_cntrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pt_cntrs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_stats_page__bindgen_ty_1), + "::", + stringify!(pt_cntrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vp_cntrs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_stats_page__bindgen_ty_1), + "::", + stringify!(vp_cntrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lp_cntrs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_stats_page__bindgen_ty_1), + "::", + stringify!(lp_cntrs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_stats_page__bindgen_ty_1), + "::", + stringify!(data) + ) + ); +} +impl Default for hv_stats_page__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[test] +fn bindgen_test_layout_hv_stats_page() { + assert_eq!( + ::std::mem::size_of::(), + 4096usize, + concat!("Size of: ", stringify!(hv_stats_page)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_stats_page)) + ); +} +impl Default for hv_stats_page { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] pub struct hv_vp_register_page { pub version: __u16, pub isvalid: __u8, pub rsvdz: __u8, pub dirty: __u32, pub __bindgen_anon_1: hv_vp_register_page__bindgen_ty_1, + pub reserved: [__u8; 8usize], pub __bindgen_anon_2: hv_vp_register_page__bindgen_ty_2, pub __bindgen_anon_3: hv_vp_register_page__bindgen_ty_3, pub cr0: __u64, @@ -9821,6 +12883,7 @@ pub struct hv_vp_register_page { pub pending_interruption: hv_x64_pending_interruption_register, pub interrupt_state: hv_x64_interrupt_state_register, pub instruction_emulation_hints: __u64, + pub xfem: __u64, } #[repr(C)] #[derive(Copy, Clone)] @@ -10468,7 +13531,7 @@ fn bindgen_test_layout_hv_vp_register_page() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 416usize, + 432usize, concat!("Size of: ", stringify!(hv_vp_register_page)) ); assert_eq!( @@ -10516,9 +13579,19 @@ fn bindgen_test_layout_hv_vp_register_page() { stringify!(dirty) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_register_page), + "::", + stringify!(reserved) + ) + ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cr0) as usize - ptr as usize }, - 344usize, + 352usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10528,7 +13601,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cr3) as usize - ptr as usize }, - 352usize, + 360usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10538,7 +13611,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cr4) as usize - ptr as usize }, - 360usize, + 368usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10548,7 +13621,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cr8) as usize - ptr as usize }, - 368usize, + 376usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10558,7 +13631,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).efer) as usize - ptr as usize }, - 376usize, + 384usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10568,7 +13641,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dr7) as usize - ptr as usize }, - 384usize, + 392usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10578,7 +13651,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pending_interruption) as usize - ptr as usize }, - 392usize, + 400usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10588,7 +13661,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).interrupt_state) as usize - ptr as usize }, - 400usize, + 408usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10598,7 +13671,7 @@ fn bindgen_test_layout_hv_vp_register_page() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).instruction_emulation_hints) as usize - ptr as usize }, - 408usize, + 416usize, concat!( "Offset of field: ", stringify!(hv_vp_register_page), @@ -10606,6 +13679,16 @@ fn bindgen_test_layout_hv_vp_register_page() { stringify!(instruction_emulation_hints) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xfem) as usize - ptr as usize }, + 424usize, + concat!( + "Offset of field: ", + stringify!(hv_vp_register_page), + "::", + stringify!(xfem) + ) + ); } impl Default for hv_vp_register_page { fn default() -> Self { @@ -14939,115 +18022,21 @@ fn bindgen_test_layout_hv_connection_info__bindgen_ty_1() { "Offset of field: ", stringify!(hv_connection_info__bindgen_ty_1), "::", - stringify!(monitor_connection_info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).doorbell_connection_info) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_connection_info__bindgen_ty_1), - "::", - stringify!(doorbell_connection_info) - ) - ); -} -impl Default for hv_connection_info__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_hv_connection_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(hv_connection_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_connection_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port_type) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_connection_info), - "::", - stringify!(port_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hv_connection_info), - "::", - stringify!(padding) - ) - ); -} -impl Default for hv_connection_info { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_synic_event_flags { - pub flags8: [::std::os::raw::c_uchar; 256usize], - pub flags: [::std::os::raw::c_ulong; 64usize], -} -#[test] -fn bindgen_test_layout_hv_synic_event_flags() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 512usize, - concat!("Size of: ", stringify!(hv_synic_event_flags)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_synic_event_flags)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags8) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_synic_event_flags), - "::", - stringify!(flags8) + stringify!(monitor_connection_info) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).doorbell_connection_info) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_synic_event_flags), + stringify!(hv_connection_info__bindgen_ty_1), "::", - stringify!(flags) + stringify!(doorbell_connection_info) ) ); } -impl Default for hv_synic_event_flags { +impl Default for hv_connection_info__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -15056,38 +18045,42 @@ impl Default for hv_synic_event_flags { } } } -#[repr(C)] -#[derive(Copy, Clone)] -pub struct hv_synic_event_flags_page { - pub event_flags: [hv_synic_event_flags; 16usize], -} #[test] -fn bindgen_test_layout_hv_synic_event_flags_page() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_connection_info() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8192usize, - concat!("Size of: ", stringify!(hv_synic_event_flags_page)) + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(hv_connection_info)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_synic_event_flags_page)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_connection_info)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).event_flags) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).port_type) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_synic_event_flags_page), + stringify!(hv_connection_info), + "::", + stringify!(port_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hv_connection_info), "::", - stringify!(event_flags) + stringify!(padding) ) ); } -impl Default for hv_synic_event_flags_page { +impl Default for hv_connection_info { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -18425,352 +21418,133 @@ impl Default for hv_x64_interruption_deliverable_message { } } } -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_x64_sint_deliverable_message { - pub header: hv_x64_intercept_message_header, - pub deliverable_sints: __u16, - pub rsvd1: __u16, - pub rsvd2: __u32, -} -#[test] -fn bindgen_test_layout_hv_x64_sint_deliverable_message() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(hv_x64_sint_deliverable_message)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_x64_sint_deliverable_message)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sint_deliverable_message), - "::", - stringify!(header) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deliverable_sints) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sint_deliverable_message), - "::", - stringify!(deliverable_sints) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd1) as usize - ptr as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sint_deliverable_message), - "::", - stringify!(rsvd1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsvd2) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sint_deliverable_message), - "::", - stringify!(rsvd2) - ) - ); -} -impl Default for hv_x64_sint_deliverable_message { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Copy, Clone)] -pub struct hv_x64_sipi_intercept_message { - pub header: hv_x64_intercept_message_header, - pub target_vp_index: __u32, - pub interrupt_vector: __u32, -} -#[test] -fn bindgen_test_layout_hv_x64_sipi_intercept_message() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(hv_x64_sipi_intercept_message)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(hv_x64_sipi_intercept_message)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sipi_intercept_message), - "::", - stringify!(header) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_vp_index) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sipi_intercept_message), - "::", - stringify!(target_vp_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interrupt_vector) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(hv_x64_sipi_intercept_message), - "::", - stringify!(interrupt_vector) - ) - ); -} -impl Default for hv_x64_sipi_intercept_message { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union hv_gpa_page_range { - pub address_space: __u64, - pub page: hv_gpa_page_range__bindgen_ty_1, - pub __bindgen_anon_1: hv_gpa_page_range__bindgen_ty_2, -} -#[repr(C)] -#[repr(align(8))] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_gpa_page_range__bindgen_ty_1 { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} -#[test] -fn bindgen_test_layout_hv_gpa_page_range__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_gpa_page_range__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_gpa_page_range__bindgen_ty_1)) - ); -} -impl hv_gpa_page_range__bindgen_ty_1 { - #[inline] - pub fn additional_pages(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 11u8) as u64) } - } - #[inline] - pub fn set_additional_pages(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 11u8, val as u64) - } - } - #[inline] - pub fn largepage(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } - } - #[inline] - pub fn set_largepage(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(11usize, 1u8, val as u64) - } - } - #[inline] - pub fn basepfn(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 52u8) as u64) } - } - #[inline] - pub fn set_basepfn(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 52u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - additional_pages: __u64, - largepage: __u64, - basepfn: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 11u8, { - let additional_pages: u64 = unsafe { ::std::mem::transmute(additional_pages) }; - additional_pages as u64 - }); - __bindgen_bitfield_unit.set(11usize, 1u8, { - let largepage: u64 = unsafe { ::std::mem::transmute(largepage) }; - largepage as u64 - }); - __bindgen_bitfield_unit.set(12usize, 52u8, { - let basepfn: u64 = unsafe { ::std::mem::transmute(basepfn) }; - basepfn as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[repr(align(8))] -#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct hv_gpa_page_range__bindgen_ty_2 { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_x64_sint_deliverable_message { + pub header: hv_x64_intercept_message_header, + pub deliverable_sints: __u16, + pub rsvd1: __u16, + pub rsvd2: __u32, } #[test] -fn bindgen_test_layout_hv_gpa_page_range__bindgen_ty_2() { +fn bindgen_test_layout_hv_x64_sint_deliverable_message() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_gpa_page_range__bindgen_ty_2)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(hv_x64_sint_deliverable_message)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_gpa_page_range__bindgen_ty_2)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_x64_sint_deliverable_message)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_sint_deliverable_message), + "::", + stringify!(header) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).deliverable_sints) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_sint_deliverable_message), + "::", + stringify!(deliverable_sints) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd1) as usize - ptr as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_sint_deliverable_message), + "::", + stringify!(rsvd1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd2) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_sint_deliverable_message), + "::", + stringify!(rsvd2) + ) ); } -impl hv_gpa_page_range__bindgen_ty_2 { - #[inline] - pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 12u8) as u64) } - } - #[inline] - pub fn set_reserved(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 12u8, val as u64) - } - } - #[inline] - pub fn page_size(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } - } - #[inline] - pub fn set_page_size(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 1u8, val as u64) - } - } - #[inline] - pub fn reserved1(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 8u8) as u64) } - } - #[inline] - pub fn set_reserved1(&mut self, val: __u64) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(13usize, 8u8, val as u64) - } - } - #[inline] - pub fn base_large_pfn(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 43u8) as u64) } - } - #[inline] - pub fn set_base_large_pfn(&mut self, val: __u64) { +impl Default for hv_x64_sint_deliverable_message { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(21usize, 43u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn new_bitfield_1( - reserved: __u64, - page_size: __u64, - reserved1: __u64, - base_large_pfn: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 12u8, { - let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; - reserved as u64 - }); - __bindgen_bitfield_unit.set(12usize, 1u8, { - let page_size: u64 = unsafe { ::std::mem::transmute(page_size) }; - page_size as u64 - }); - __bindgen_bitfield_unit.set(13usize, 8u8, { - let reserved1: u64 = unsafe { ::std::mem::transmute(reserved1) }; - reserved1 as u64 - }); - __bindgen_bitfield_unit.set(21usize, 43u8, { - let base_large_pfn: u64 = unsafe { ::std::mem::transmute(base_large_pfn) }; - base_large_pfn as u64 - }); - __bindgen_bitfield_unit - } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct hv_x64_sipi_intercept_message { + pub header: hv_x64_intercept_message_header, + pub target_vp_index: __u32, + pub interrupt_vector: __u32, } #[test] -fn bindgen_test_layout_hv_gpa_page_range() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_hv_x64_sipi_intercept_message() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(hv_gpa_page_range)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(hv_x64_sipi_intercept_message)) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(hv_gpa_page_range)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_x64_sipi_intercept_message)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).address_space) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(hv_gpa_page_range), + stringify!(hv_x64_sipi_intercept_message), "::", - stringify!(address_space) + stringify!(header) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).page) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).target_vp_index) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(hv_gpa_page_range), + stringify!(hv_x64_sipi_intercept_message), "::", - stringify!(page) + stringify!(target_vp_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).interrupt_vector) as usize - ptr as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(hv_x64_sipi_intercept_message), + "::", + stringify!(interrupt_vector) ) ); } -impl Default for hv_gpa_page_range { +impl Default for hv_x64_sipi_intercept_message { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -19808,7 +22582,85 @@ fn bindgen_test_layout_hv_input_register_intercept_result() { 0usize, concat!( "Offset of field: ", - stringify!(hv_input_register_intercept_result), + stringify!(hv_input_register_intercept_result), + "::", + stringify!(partition_id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vp_index) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hv_input_register_intercept_result), + "::", + stringify!(vp_index) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).intercept_type) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hv_input_register_intercept_result), + "::", + stringify!(intercept_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hv_input_register_intercept_result), + "::", + stringify!(parameters) + ) + ); +} +impl Default for hv_input_register_intercept_result { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub union hv_delete_vp { + pub as_uint64: [__u64; 2usize], + pub __bindgen_anon_1: hv_delete_vp__bindgen_ty_1, +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct hv_delete_vp__bindgen_ty_1 { + pub partition_id: __u64, + pub vp_index: __u32, + pub reserved: [__u8; 4usize], +} +#[test] +fn bindgen_test_layout_hv_delete_vp__bindgen_ty_1() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hv_delete_vp__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_delete_vp__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).partition_id) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hv_delete_vp__bindgen_ty_1), "::", stringify!(partition_id) ) @@ -19818,33 +22670,48 @@ fn bindgen_test_layout_hv_input_register_intercept_result() { 8usize, concat!( "Offset of field: ", - stringify!(hv_input_register_intercept_result), + stringify!(hv_delete_vp__bindgen_ty_1), "::", stringify!(vp_index) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_type) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(hv_input_register_intercept_result), + stringify!(hv_delete_vp__bindgen_ty_1), "::", - stringify!(intercept_type) + stringify!(reserved) ) ); +} +#[test] +fn bindgen_test_layout_hv_delete_vp() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, + ::std::mem::size_of::(), 16usize, + concat!("Size of: ", stringify!(hv_delete_vp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hv_delete_vp)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).as_uint64) as usize - ptr as usize }, + 0usize, concat!( "Offset of field: ", - stringify!(hv_input_register_intercept_result), + stringify!(hv_delete_vp), "::", - stringify!(parameters) + stringify!(as_uint64) ) ); } -impl Default for hv_input_register_intercept_result { +impl Default for hv_delete_vp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -21005,7 +23872,6 @@ impl Default for hv_input_get_vp_state { #[repr(C, packed)] #[derive(Copy, Clone)] pub union hv_output_get_vp_state { - pub interrupt_controller_state: hv_local_interrupt_controller_state, pub synthetic_timers_state: hv_synthetic_timers_state, } #[test] @@ -21023,16 +23889,6 @@ fn bindgen_test_layout_hv_output_get_vp_state() { 1usize, concat!("Alignment of ", stringify!(hv_output_get_vp_state)) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interrupt_controller_state) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hv_output_get_vp_state), - "::", - stringify!(interrupt_controller_state) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).synthetic_timers_state) as usize - ptr as usize }, 0usize, @@ -21216,22 +24072,12 @@ pub type hv_vp_dispatch_state = ::std::os::raw::c_uint; pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_INVALID: hv_vp_dispatch_event = 0; pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_SUSPEND: hv_vp_dispatch_event = 1; pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_INTERCEPT: hv_vp_dispatch_event = 2; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_HALT: hv_vp_dispatch_event = 4; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_STARTUP: hv_vp_dispatch_event = 8; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_DELETE: hv_vp_dispatch_event = 32; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_MACHINECHECK: hv_vp_dispatch_event = 64; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_IDLE: hv_vp_dispatch_event = 128; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_SYSTEM: hv_vp_dispatch_event = 256; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_PARTITION: hv_vp_dispatch_event = 512; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_TERMINATE: hv_vp_dispatch_event = 16384; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_SERVICING: hv_vp_dispatch_event = 32768; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_TIMEFREEZE: hv_vp_dispatch_event = 65536; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_INTERNAL: hv_vp_dispatch_event = 268435457; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_PREEMPTED: hv_vp_dispatch_event = 268435458; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_CANCELLED: hv_vp_dispatch_event = 268435459; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_SCHEDULER: hv_vp_dispatch_event = 268435460; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_LONGSPINWAIT: hv_vp_dispatch_event = 268435461; -pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_TIMESLICEEND: hv_vp_dispatch_event = 268435462; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_INTERNAL: hv_vp_dispatch_event = 3; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_PREEMPTED: hv_vp_dispatch_event = 4; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_CANCELLED: hv_vp_dispatch_event = 5; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_SCHEDULER: hv_vp_dispatch_event = 6; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_LONGSPINWAIT: hv_vp_dispatch_event = 7; +pub const hv_vp_dispatch_event_HV_VP_DISPATCH_EVENT_TIMESLICEEND: hv_vp_dispatch_event = 8; pub type hv_vp_dispatch_event = ::std::os::raw::c_uint; #[repr(C, packed)] pub struct hv_vp_signal_bitset_scheduler_message { @@ -22796,6 +25642,85 @@ fn bindgen_test_layout_hv_input_issue_psp_guest_request() { ) ); } +pub const MSHV_CAP_RSVD: _bindgen_ty_2 = 0; +pub const MSHV_CAP_VTL_REGISTER_PAGE: _bindgen_ty_2 = 1; +pub const MSHV_CAP_VTL_RETURN_ACTION: _bindgen_ty_2 = 2; +pub const MSHV_CAP_VTL_DR6_SHARED: _bindgen_ty_2 = 3; +pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct mshv_version_info { + pub mshv_uapi_version: __u32, + pub rsvd_0: [__u32; 3usize], + pub mshv_api_version: __u32, + pub rsvd_1: __u32, + pub mshv_capabilities: __u64, +} +#[test] +fn bindgen_test_layout_mshv_version_info() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(mshv_version_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(mshv_version_info)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mshv_uapi_version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mshv_version_info), + "::", + stringify!(mshv_uapi_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_0) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(mshv_version_info), + "::", + stringify!(rsvd_0) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mshv_api_version) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mshv_version_info), + "::", + stringify!(mshv_api_version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd_1) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(mshv_version_info), + "::", + stringify!(rsvd_1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mshv_capabilities) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mshv_version_info), + "::", + stringify!(mshv_capabilities) + ) + ); +} #[repr(C)] #[derive(Copy, Clone)] pub struct mshv_create_partition { @@ -23084,6 +26009,7 @@ pub struct mshv_assert_interrupt { pub control: hv_interrupt_control, pub dest_addr: __u64, pub vector: __u32, + pub rsvd: __u32, } #[test] fn bindgen_test_layout_mshv_assert_interrupt() { @@ -23130,67 +26056,18 @@ fn bindgen_test_layout_mshv_assert_interrupt() { stringify!(vector) ) ); -} -impl Default for mshv_assert_interrupt { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mshv_vp_state { - pub type_: hv_get_set_vp_state_type, - pub xsave: hv_vp_state_data_xsave, - pub buf_size: __u64, - pub buf: mshv_vp_state__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mshv_vp_state__bindgen_ty_1 { - pub lapic: *mut hv_local_interrupt_controller_state, - pub bytes: *mut __u8, -} -#[test] -fn bindgen_test_layout_mshv_vp_state__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mshv_vp_state__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mshv_vp_state__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lapic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mshv_vp_state__bindgen_ty_1), - "::", - stringify!(lapic) - ) - ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).rsvd) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(mshv_vp_state__bindgen_ty_1), + stringify!(mshv_assert_interrupt), "::", - stringify!(bytes) + stringify!(rsvd) ) ); } -impl Default for mshv_vp_state__bindgen_ty_1 { +impl Default for mshv_assert_interrupt { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -23199,70 +26076,77 @@ impl Default for mshv_vp_state__bindgen_ty_1 { } } } +pub const MSHV_VP_STATE_LAPIC: _bindgen_ty_3 = 0; +pub const MSHV_VP_STATE_XSAVE: _bindgen_ty_3 = 1; +pub const MSHV_VP_STATE_SIMP: _bindgen_ty_3 = 2; +pub const MSHV_VP_STATE_SIEFP: _bindgen_ty_3 = 3; +pub const MSHV_VP_STATE_SYNTHETIC_TIMERS: _bindgen_ty_3 = 4; +pub const MSHV_VP_STATE_COUNT: _bindgen_ty_3 = 5; +pub type _bindgen_ty_3 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct mshv_get_set_vp_state { + pub type_: __u8, + pub rsvd: [__u8; 3usize], + pub buf_sz: __u32, + pub buf_ptr: __u64, +} #[test] -fn bindgen_test_layout_mshv_vp_state() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_mshv_get_set_vp_state() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mshv_vp_state)) + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(mshv_get_set_vp_state)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(mshv_vp_state)) + concat!("Alignment of ", stringify!(mshv_get_set_vp_state)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(mshv_vp_state), + stringify!(mshv_get_set_vp_state), "::", stringify!(type_) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xsave) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).rsvd) as usize - ptr as usize }, + 1usize, concat!( "Offset of field: ", - stringify!(mshv_vp_state), + stringify!(mshv_get_set_vp_state), "::", - stringify!(xsave) + stringify!(rsvd) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buf_size) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).buf_sz) as usize - ptr as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(mshv_vp_state), + stringify!(mshv_get_set_vp_state), "::", - stringify!(buf_size) + stringify!(buf_sz) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buf) as usize - ptr as usize }, - 32usize, + unsafe { ::std::ptr::addr_of!((*ptr).buf_ptr) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(mshv_vp_state), + stringify!(mshv_get_set_vp_state), "::", - stringify!(buf) + stringify!(buf_ptr) ) ); } -impl Default for mshv_vp_state { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[repr(C)] #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_partition_property { @@ -23449,11 +26333,11 @@ fn bindgen_test_layout_mshv_irqfd() { ) ); } -pub const mshv_ioeventfd_flag_nr_datamatch: _bindgen_ty_1 = 0; -pub const mshv_ioeventfd_flag_nr_pio: _bindgen_ty_1 = 1; -pub const mshv_ioeventfd_flag_nr_deassign: _bindgen_ty_1 = 2; -pub const mshv_ioeventfd_flag_nr_max: _bindgen_ty_1 = 3; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; +pub const mshv_ioeventfd_flag_nr_datamatch: _bindgen_ty_4 = 0; +pub const mshv_ioeventfd_flag_nr_pio: _bindgen_ty_4 = 1; +pub const mshv_ioeventfd_flag_nr_deassign: _bindgen_ty_4 = 2; +pub const mshv_ioeventfd_flag_nr_max: _bindgen_ty_4 = 3; +pub type _bindgen_ty_4 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_ioeventfd { @@ -24033,57 +26917,6 @@ fn bindgen_test_layout_mshv_get_vp_cpuid_values() { ); } #[repr(C)] -#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] -pub struct mshv_vp_run_registers { - pub message: *mut hv_message, - pub registers: mshv_vp_registers, -} -#[test] -fn bindgen_test_layout_mshv_vp_run_registers() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(mshv_vp_run_registers)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mshv_vp_run_registers)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).message) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mshv_vp_run_registers), - "::", - stringify!(message) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).registers) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mshv_vp_run_registers), - "::", - stringify!(registers) - ) - ); -} -impl Default for mshv_vp_run_registers { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_trace_config { pub mode: __u32, @@ -24398,6 +27231,113 @@ fn bindgen_test_layout_mshv_issue_psp_guest_request() { ) ); } +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] +pub struct mshv_root_hvcall { + pub code: __u16, + pub reps: __u16, + pub in_sz: __u16, + pub out_sz: __u16, + pub status: __u16, + pub rsvd: [__u16; 3usize], + pub in_ptr: __u64, + pub out_ptr: __u64, +} +#[test] +fn bindgen_test_layout_mshv_root_hvcall() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(mshv_root_hvcall)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(mshv_root_hvcall)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(code) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reps) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(reps) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).in_sz) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(in_sz) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).out_sz) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(out_sz) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(status) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsvd) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(rsvd) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).in_ptr) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(in_ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).out_ptr) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mshv_root_hvcall), + "::", + stringify!(out_ptr) + ) + ); +} #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub struct mshv_get_gpa_pages_access_state { diff --git a/mshv-bindings/src/regs.rs b/mshv-bindings/src/regs.rs index 0d26da37..fad84ad1 100644 --- a/mshv-bindings/src/regs.rs +++ b/mshv-bindings/src/regs.rs @@ -6,12 +6,14 @@ use crate::bindings::*; #[cfg(feature = "with-serde")] use serde_derive::{Deserialize, Serialize}; -use std::cmp; +use std::convert::TryFrom; use std::fmt; use std::ptr; use vmm_sys_util::errno; use zerocopy::{AsBytes, FromBytes, FromZeroes}; +pub const HV_PAGE_SIZE: usize = HV_HYP_PAGE_SIZE as usize; + #[repr(C)] #[derive(Debug, Default, Copy, Clone, Eq, PartialEq, AsBytes, FromBytes, FromZeroes)] #[cfg_attr(feature = "with-serde", derive(Deserialize, Serialize))] @@ -342,8 +344,8 @@ pub fn msr_to_hv_reg_name(msr: u32) -> Result<::std::os::raw::c_uint, &'static s HV_X64_MSR_SINT15 => Ok(hv_register_name_HV_REGISTER_SINT15), IA32_MSR_MISC_ENABLE => Ok(hv_register_name_HV_X64_REGISTER_MSR_IA32_MISC_ENABLE), HV_X64_MSR_SCONTROL => Ok(hv_register_name_HV_REGISTER_SCONTROL), - HV_X64_MSR_SIEFP => Ok(hv_register_name_HV_REGISTER_SIFP), - HV_X64_MSR_SIMP => Ok(hv_register_name_HV_REGISTER_SIPP), + HV_X64_MSR_SIEFP => Ok(hv_register_name_HV_REGISTER_SIEFP), + HV_X64_MSR_SIMP => Ok(hv_register_name_HV_REGISTER_SIMP), HV_X64_MSR_REFERENCE_TSC => Ok(hv_register_name_HV_REGISTER_REFERENCE_TSC), HV_X64_MSR_EOM => Ok(hv_register_name_HV_REGISTER_EOM), _ => Err("Not a supported hv_register_name msr"), @@ -463,7 +465,7 @@ impl Buffer { Ok(buf) } - pub fn dealloc(self) { + pub fn dealloc(&mut self) { // SAFETY: buf was allocated with layout unsafe { std::alloc::dealloc(self.buf, self.layout); @@ -477,15 +479,13 @@ impl Buffer { impl Drop for Buffer { fn drop(&mut self) { - // SAFETY: buf was allocated with layout - unsafe { - std::alloc::dealloc(self.buf, self.layout); - } + self.dealloc(); } } #[repr(C)] #[derive(Copy, Clone, Debug, AsBytes, FromBytes, FromZeroes)] +/// Fixed buffer for lapic state pub struct LapicState { pub regs: [::std::os::raw::c_char; 1024usize], } @@ -494,25 +494,12 @@ impl Default for LapicState { unsafe { ::std::mem::zeroed() } } } -/* -impl Default for hv_register_value { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} */ + #[repr(C)] #[derive(Copy, Clone, Debug, AsBytes, FromBytes, FromZeroes)] -/// This struct normalizes the actual mhsv XSave structure -/// XSave only used in save and restore functionalities, serilization and -/// deserialization are needed. Putting all the fields into a single buffer makes -/// it easier to serialize and deserialize -/// Total buffer size: 4120 -/// flags: 8 bytes -/// states: 8 bytes -/// data_size: 8 bytes -/// Actual xsave buffer: 4096 bytes +/// Fixed buffer for xsave state pub struct XSave { - pub buffer: [::std::os::raw::c_char; 4120usize], + pub buffer: [u8; 4096usize], } impl Default for XSave { @@ -521,69 +508,45 @@ impl Default for XSave { } } -impl From for XSave { - fn from(reg: mshv_vp_state) -> Self { - let ret = XSave { +impl TryFrom for XSave { + type Error = errno::Error; + fn try_from(buf: Buffer) -> Result { + let mut ret = XSave { ..Default::default() }; - let mut bs = reg.xsave.flags.to_le_bytes(); - unsafe { - ptr::copy( - bs.as_ptr() as *mut u8, - ret.buffer.as_ptr().offset(0) as *mut u8, - 8, - ) - }; - bs = unsafe { reg.xsave.states.as_uint64.to_le_bytes() }; - unsafe { - ptr::copy( - bs.as_ptr() as *mut u8, - ret.buffer.as_ptr().offset(8) as *mut u8, - 8, - ) - }; - bs = reg.buf_size.to_le_bytes(); - unsafe { - ptr::copy( - bs.as_ptr() as *mut u8, - ret.buffer.as_ptr().offset(16) as *mut u8, - 8, - ) - }; - let min: usize = cmp::min(4096, reg.buf_size as u32) as usize; - unsafe { - ptr::copy( - reg.buf.bytes, - ret.buffer.as_ptr().offset(24) as *mut u8, - min, - ) - }; - ret + let ret_size = std::mem::size_of_val(&ret.buffer); + if ret_size < buf.size() { + return Err(errno::Error::new(libc::EINVAL)); + } + // SAFETY: ret is large enough to hold buffer + unsafe { ptr::copy(buf.buf, ret.buffer.as_mut_ptr(), buf.size()) }; + Ok(ret) } } -impl From for mshv_vp_state { - fn from(reg: XSave) -> Self { - let flags = reg.flags(); - let states = reg.states(); - let buffer_size = reg.data_size(); - let mut ret = mshv_vp_state { - type_: hv_get_set_vp_state_type_HV_GET_SET_VP_STATE_XSAVE, - buf_size: buffer_size, - ..Default::default() - }; - ret.xsave.flags = flags; - ret.xsave.states.as_uint64 = states; - ret.buf.bytes = reg.data_buffer() as *mut u8; - ret +impl TryFrom<&XSave> for Buffer { + type Error = errno::Error; + fn try_from(reg: &XSave) -> Result { + let reg_size = std::mem::size_of_val(®.buffer); + let num_pages = (reg_size + HV_PAGE_SIZE - 1) >> HV_HYP_PAGE_SHIFT; + let buffer = Buffer::new(num_pages * HV_PAGE_SIZE, HV_PAGE_SIZE)?; + // SAFETY: buffer is large enough to hold reg + unsafe { ptr::copy(reg.buffer.as_ptr(), buffer.buf, reg_size) }; + Ok(buffer) } } -impl From for LapicState { - fn from(reg: mshv_vp_state) -> Self { + +impl TryFrom for LapicState { + type Error = errno::Error; + fn try_from(buf: Buffer) -> Result { let mut ret: LapicState = LapicState::default(); let state = ret.regs.as_mut_ptr(); - let hv_state = unsafe { *reg.buf.lapic }; + if buf.size() < std::mem::size_of::() { + return Err(errno::Error::new(libc::EINVAL)); + } + // SAFETY: buf is large enough for hv_local_interrupt_controller_state unsafe { + let hv_state = &*(buf.buf as *const hv_local_interrupt_controller_state); *(state.offset(LOCAL_APIC_OFFSET_APIC_ID) as *mut u32) = hv_state.apic_id; *(state.offset(LOCAL_APIC_OFFSET_VERSION) as *mut u32) = hv_state.apic_version; *(state.offset(LOCAL_APIC_OFFSET_REMOTE_READ) as *mut u32) = hv_state.apic_remote_read; @@ -605,11 +568,9 @@ impl From for LapicState { hv_state.apic_counter_value; *(state.offset(LOCAL_APIC_OFFSET_DIVIDER) as *mut u32) = hv_state.apic_divide_configuration; - } - /* vectors ISR TMR IRR */ - for i in 0..8 { - unsafe { + /* vectors ISR TMR IRR */ + for i in 0..8 { *(state.offset(LOCAL_APIC_OFFSET_ISR + i * 16) as *mut u32) = hv_state.apic_isr[i as usize]; *(state.offset(LOCAL_APIC_OFFSET_TMR + i * 16) as *mut u32) = @@ -617,33 +578,36 @@ impl From for LapicState { *(state.offset(LOCAL_APIC_OFFSET_IRR + i * 16) as *mut u32) = hv_state.apic_irr[i as usize]; } - } - // Highest priority interrupt (isr = in service register) this is how WHP computes it - let mut isrv: u32 = 0; - for i in (0..8).rev() { - let val: u32 = hv_state.apic_isr[i as usize]; - if val != 0 { - isrv = 31 - val.leading_zeros(); // index of most significant set bit - isrv += i * 4 * 8; // i don't know - break; + // Highest priority interrupt (isr = in service register) this is how WHP computes it + let mut isrv: u32 = 0; + for i in (0..8).rev() { + let val: u32 = hv_state.apic_isr[i as usize]; + if val != 0 { + isrv = 31 - val.leading_zeros(); // index of most significant set bit + isrv += i * 4 * 8; // i don't know + break; + } } - } - // TODO This is meant to be max(tpr, isrv), but tpr is not populated! - unsafe { + // TODO This is meant to be max(tpr, isrv), but tpr is not populated! *(state.offset(LOCAL_APIC_OFFSET_PPR) as *mut u32) = isrv; } - ret + Ok(ret) } } -impl From for mshv_vp_state { - fn from(reg: LapicState) -> Self { - let state = reg.regs.as_ptr(); - let mut vp_state: mshv_vp_state = mshv_vp_state::default(); +impl TryFrom<&LapicState> for Buffer { + type Error = errno::Error; + fn try_from(reg: &LapicState) -> Result { + let hv_state_size = std::mem::size_of::(); + let num_pages = (hv_state_size + HV_PAGE_SIZE - 1) >> HV_HYP_PAGE_SHIFT; + let buffer = Buffer::new(num_pages * HV_PAGE_SIZE, HV_PAGE_SIZE)?; + // SAFETY: buf is large enough for hv_local_interrupt_controller_state unsafe { - let mut lapic_state = hv_local_interrupt_controller_state { + let state = reg.regs.as_ptr(); + let hv_state = &mut *(buffer.buf as *mut hv_local_interrupt_controller_state); + *hv_state = hv_local_interrupt_controller_state { apic_id: *(state.offset(LOCAL_APIC_OFFSET_APIC_ID) as *mut u32), apic_version: *(state.offset(LOCAL_APIC_OFFSET_VERSION) as *mut u32), apic_remote_read: *(state.offset(LOCAL_APIC_OFFSET_REMOTE_READ) as *mut u32), @@ -671,75 +635,30 @@ impl From for mshv_vp_state { /* vectors ISR TMR IRR */ for i in 0..8 { - lapic_state.apic_isr[i as usize] = + hv_state.apic_isr[i as usize] = *(state.offset(LOCAL_APIC_OFFSET_ISR + i * 16) as *mut u32); - lapic_state.apic_tmr[i as usize] = + hv_state.apic_tmr[i as usize] = *(state.offset(LOCAL_APIC_OFFSET_TMR + i * 16) as *mut u32); - lapic_state.apic_irr[i as usize] = + hv_state.apic_irr[i as usize] = *(state.offset(LOCAL_APIC_OFFSET_IRR + i * 16) as *mut u32); } - vp_state.type_ = - hv_get_set_vp_state_type_HV_GET_SET_VP_STATE_LOCAL_INTERRUPT_CONTROLLER_STATE; - vp_state.buf_size = 1024; - let boxed_obj = Box::new(lapic_state); - vp_state.buf.lapic = Box::into_raw(boxed_obj); } - vp_state + + Ok(buffer) } } + // implement `Display` for `XSave` impl fmt::Display for XSave { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "flags: {}, states: {}, buffer_size: {}, buffer: {:?}\n data: {:02X?}", - self.flags(), - self.states(), - self.data_size(), - self.data_buffer(), + "buffer: {:?}\n data: {:02X?}", + self.buffer.as_ptr(), self.buffer, ) } } -// Implement XSave to retrieve each field from the buffer -impl XSave { - pub fn flags(&self) -> u64 { - let array: [u8; 8] = [0, 0, 0, 0, 0, 0, 0, 0]; - unsafe { - ptr::copy( - self.buffer.as_ptr().offset(0) as *mut u8, - array.as_ptr() as *mut u8, - 8, - ) - }; - u64::from_le_bytes(array) - } - pub fn states(&self) -> u64 { - let array: [u8; 8] = [0, 0, 0, 0, 0, 0, 0, 0]; - unsafe { - ptr::copy( - self.buffer.as_ptr().offset(8) as *mut u8, - array.as_ptr() as *mut u8, - 8, - ) - }; - u64::from_le_bytes(array) - } - pub fn data_size(&self) -> u64 { - let array: [u8; 8] = [0, 0, 0, 0, 0, 0, 0, 0]; - unsafe { - ptr::copy( - self.buffer.as_ptr().offset(16) as *mut u8, - array.as_ptr() as *mut u8, - 8, - ) - }; - u64::from_le_bytes(array) - } - pub fn data_buffer(&self) -> *const u8 { - unsafe { self.buffer.as_ptr().offset(24) as *mut u8 } - } -} #[repr(C)] #[derive(Debug, Default, Copy, Clone, Eq, PartialEq, AsBytes, FromBytes, FromZeroes)] diff --git a/mshv-bindings/src/serializers.rs b/mshv-bindings/src/serializers.rs index eb906bd0..fe273b33 100644 --- a/mshv-bindings/src/serializers.rs +++ b/mshv-bindings/src/serializers.rs @@ -36,7 +36,7 @@ impl<'de> Deserialize<'de> for XSave { where D: Deserializer<'de>, { - let data_buffer: Vec<::std::os::raw::c_char> = Vec::deserialize(deserializer)?; + let data_buffer: Vec = Vec::deserialize(deserializer)?; let mut val = XSave::default(); // This panics if the source and destination have different lengths. val.buffer.copy_from_slice(&data_buffer[..]); @@ -57,15 +57,12 @@ impl Serialize for XSave { mod tests { use super::*; use random_number::random; - use std::ptr; #[test] fn test_lapic_state_serialization_deserialization() { let mut state = LapicState::default(); - let mut n1: u8 = random!(); for i in 0..1024 { - state.regs[i] = n1 as ::std::os::raw::c_char; - n1 = random!(); + state.regs[i] = random!(); } let serialized = serde_json::to_string(&state).expect("err ser"); let d_state: LapicState = serde_json::from_str(&serialized).expect("err unser"); @@ -80,44 +77,11 @@ mod tests { let mut xsave = XSave { ..Default::default() }; - let flags: u64 = 0x12345678; - let states: u64 = 0x87654321; - let data_size: u64 = 4096; - - let mut n1: u8 = random!(); for i in 0..4096 { - xsave.buffer[i + 24] = n1 as ::std::os::raw::c_char; - n1 = random!(); + xsave.buffer[i] = random!(); } - let mut _bs = flags.to_le_bytes(); - unsafe { - ptr::copy( - _bs.as_ptr() as *mut u8, - xsave.buffer.as_ptr().offset(0) as *mut u8, - 8, - ) - }; - _bs = states.to_le_bytes(); - unsafe { - ptr::copy( - _bs.as_ptr() as *mut u8, - xsave.buffer.as_ptr().offset(8) as *mut u8, - 8, - ) - }; - _bs = data_size.to_le_bytes(); - unsafe { - ptr::copy( - _bs.as_ptr() as *mut u8, - xsave.buffer.as_ptr().offset(16) as *mut u8, - 8, - ) - }; let serialized = serde_json::to_string(&xsave).expect("err ser"); let d_xsave: XSave = serde_json::from_str(&serialized).expect("err unser"); - assert!(xsave.flags() == d_xsave.flags()); - assert!(xsave.states() == d_xsave.states()); - assert!(xsave.data_size() == d_xsave.data_size()); assert!(xsave .buffer .iter() diff --git a/mshv-ioctls/src/ioctls/system.rs b/mshv-ioctls/src/ioctls/system.rs index 05329c2f..70657efa 100644 --- a/mshv-ioctls/src/ioctls/system.rs +++ b/mshv-ioctls/src/ioctls/system.rs @@ -366,7 +366,7 @@ impl Mshv { MPX support needed for this MSR Currently feature is not enabled */ - IA32_MSR_SPEC_CTRL, + //IA32_MSR_SPEC_CTRL, //IA32_MSR_TSC_ADJUST, // Current hypervisor version does not allow to get this MSR, need to check later HV_X64_MSR_GUEST_OS_ID, HV_X64_MSR_SINT0, @@ -419,7 +419,7 @@ mod tests { fn test_get_msr_index_list() { let hv = Mshv::new().unwrap(); let msr_list = hv.get_msr_index_list().unwrap(); - assert!(msr_list.as_fam_struct_ref().nmsrs == 65); + assert!(msr_list.as_fam_struct_ref().nmsrs == 64); let mut found = false; for index in msr_list.as_slice() { diff --git a/mshv-ioctls/src/ioctls/vcpu.rs b/mshv-ioctls/src/ioctls/vcpu.rs index dbb0d3ee..6ff5945d 100644 --- a/mshv-ioctls/src/ioctls/vcpu.rs +++ b/mshv-ioctls/src/ioctls/vcpu.rs @@ -5,10 +5,9 @@ use crate::ioctls::Result; use crate::mshv_ioctls::*; use mshv_bindings::*; -use std::cmp; +use std::convert::TryFrom; use std::fs::File; use std::os::unix::io::{AsRawFd, RawFd}; -use std::ptr; #[cfg(test)] use std::slice; use vmm_sys_util::errno; @@ -816,7 +815,7 @@ impl VcpuFd { }]) } /// Returns the VCpu state. This IOCTLs can be used to get XSave and LAPIC state. - pub fn get_vp_state_ioctl(&self, state: &mut mshv_vp_state) -> Result<()> { + pub fn get_vp_state_ioctl(&self, state: &mut mshv_get_set_vp_state) -> Result<()> { // SAFETY: we know that our file is a vCPU fd and we verify the return result. let ret = unsafe { ioctl_with_mut_ref(self, MSHV_GET_VP_STATE(), state) }; if ret != 0 { @@ -826,7 +825,7 @@ impl VcpuFd { } /// Set vp states (LAPIC, XSave etc) /// Test code already covered by get/set_lapic/xsave - pub fn set_vp_state_ioctl(&self, state: &mshv_vp_state) -> Result<()> { + pub fn set_vp_state_ioctl(&self, state: &mshv_get_set_vp_state) -> Result<()> { // SAFETY: IOCTL call with correct types let ret = unsafe { ioctl_with_ref(self, MSHV_SET_VP_STATE(), state) }; if ret != 0 { @@ -836,47 +835,48 @@ impl VcpuFd { } /// Get the state of the LAPIC (Local Advanced Programmable Interrupt Controller). pub fn get_lapic(&self) -> Result { - let buffer = Buffer::new(0x1000, 0x1000)?; - let mut vp_state: mshv_vp_state = mshv_vp_state::default(); - vp_state.buf.bytes = buffer.buf; - vp_state.buf_size = buffer.size() as u64; - vp_state.type_ = - hv_get_set_vp_state_type_HV_GET_SET_VP_STATE_LOCAL_INTERRUPT_CONTROLLER_STATE; - + let buffer = Buffer::new(HV_PAGE_SIZE, HV_PAGE_SIZE)?; + let mut vp_state = mshv_get_set_vp_state { + buf_ptr: buffer.buf as u64, + buf_sz: buffer.size() as u32, + type_: MSHV_VP_STATE_LAPIC as u8, + ..Default::default() + }; self.get_vp_state_ioctl(&mut vp_state)?; - Ok(LapicState::from(vp_state)) + LapicState::try_from(buffer) } /// Sets the state of the LAPIC (Local Advanced Programmable Interrupt Controller). pub fn set_lapic(&self, lapic_state: &LapicState) -> Result<()> { - let mut vp_state: mshv_vp_state = mshv_vp_state::from(*lapic_state); - let buffer = Buffer::new(0x1000, 0x1000)?; - let min: usize = cmp::min(buffer.size(), vp_state.buf_size as usize); - // SAFETY: src and dest are valid and properly aligned - unsafe { ptr::copy(vp_state.buf.bytes, buffer.buf, min) }; - vp_state.buf_size = buffer.size() as u64; - vp_state.buf.bytes = buffer.buf; + let buffer = Buffer::try_from(lapic_state)?; + let vp_state = mshv_get_set_vp_state { + type_: MSHV_VP_STATE_LAPIC as u8, + buf_sz: buffer.size() as u32, + buf_ptr: buffer.buf as u64, + ..Default::default() + }; self.set_vp_state_ioctl(&vp_state) } /// Returns the xsave data pub fn get_xsave(&self) -> Result { - let buffer = Buffer::new(0x1000, 0x1000)?; - let mut vp_state: mshv_vp_state = mshv_vp_state::default(); - vp_state.buf.bytes = buffer.buf; - vp_state.buf_size = buffer.size() as u64; - vp_state.type_ = hv_get_set_vp_state_type_HV_GET_SET_VP_STATE_XSAVE; + let buffer = Buffer::new(HV_PAGE_SIZE, HV_PAGE_SIZE)?; + let mut vp_state = mshv_get_set_vp_state { + buf_ptr: buffer.buf as u64, + buf_sz: buffer.size() as u32, + type_: MSHV_VP_STATE_XSAVE as u8, + ..Default::default() + }; self.get_vp_state_ioctl(&mut vp_state)?; - let ret = XSave::from(vp_state); - Ok(ret) + XSave::try_from(buffer) } /// Set the xsave data pub fn set_xsave(&self, data: &XSave) -> Result<()> { - let mut vp_state: mshv_vp_state = mshv_vp_state::from(*data); - let buffer = Buffer::new(0x1000, 0x1000)?; - let min: usize = cmp::min(buffer.size(), vp_state.buf_size as usize); - // SAFETY: src and dest are valid and properly aligned - unsafe { ptr::copy(data.buffer.as_ptr().offset(24) as *mut u8, buffer.buf, min) }; - vp_state.buf_size = buffer.size() as u64; - vp_state.buf.bytes = buffer.buf; + let buffer = Buffer::try_from(data)?; + let vp_state = mshv_get_set_vp_state { + type_: MSHV_VP_STATE_XSAVE as u8, + buf_sz: buffer.size() as u32, + buf_ptr: buffer.buf as u64, + ..Default::default() + }; self.set_vp_state_ioctl(&vp_state) } /// Translate guest virtual address to guest physical address diff --git a/mshv-ioctls/src/ioctls/vm.rs b/mshv-ioctls/src/ioctls/vm.rs index 7c676a06..6b912651 100644 --- a/mshv-ioctls/src/ioctls/vm.rs +++ b/mshv-ioctls/src/ioctls/vm.rs @@ -223,6 +223,7 @@ impl VmFd { }, dest_addr: request.apic_id, vector: request.vector, + ..Default::default() }; // SAFETY: IOCTL with correct types let ret = unsafe { ioctl_with_ref(&self.vm, MSHV_ASSERT_INTERRUPT(), &interrupt_arg) }; @@ -762,11 +763,11 @@ mod tests { let vm = hv.create_vm().unwrap(); let vcpu = vm.create_vcpu(0).unwrap(); let state = vcpu.get_lapic().unwrap(); - let vp_state: mshv_vp_state = mshv_vp_state::from(state); - let lapic: hv_local_interrupt_controller_state = unsafe { *(vp_state.buf.lapic) }; + let buffer = Buffer::try_from(&state).unwrap(); + let hv_state = unsafe { &*(buffer.buf as *const hv_local_interrupt_controller_state) }; let cfg = InterruptRequest { interrupt_type: hv_interrupt_type_HV_X64_INTERRUPT_TYPE_EXTINT, - apic_id: lapic.apic_id as u64, + apic_id: hv_state.apic_id as u64, vector: 0, level_triggered: false, logical_destination_mode: false, diff --git a/mshv-ioctls/src/mshv_ioctls.rs b/mshv-ioctls/src/mshv_ioctls.rs index 12b0d716..d16578dc 100644 --- a/mshv-ioctls/src/mshv_ioctls.rs +++ b/mshv-ioctls/src/mshv_ioctls.rs @@ -7,8 +7,8 @@ ioctl_iow_nr!(MSHV_CREATE_VP, MSHV_IOCTL, 0x04, mshv_create_vp); ioctl_iowr_nr!(MSHV_GET_VP_REGISTERS, MSHV_IOCTL, 0x05, mshv_vp_registers); ioctl_iow_nr!(MSHV_SET_VP_REGISTERS, MSHV_IOCTL, 0x06, mshv_vp_registers); ioctl_ior_nr!(MSHV_RUN_VP, MSHV_IOCTL, 0x07, hv_message); -ioctl_iowr_nr!(MSHV_GET_VP_STATE, MSHV_IOCTL, 0x0A, mshv_vp_state); -ioctl_iowr_nr!(MSHV_SET_VP_STATE, MSHV_IOCTL, 0x0B, mshv_vp_state); +ioctl_iowr_nr!(MSHV_GET_VP_STATE, MSHV_IOCTL, 0x0A, mshv_get_set_vp_state); +ioctl_iowr_nr!(MSHV_SET_VP_STATE, MSHV_IOCTL, 0x0B, mshv_get_set_vp_state); ioctl_iow_nr!( MSHV_CREATE_PARTITION, MSHV_IOCTL, diff --git a/scripts/generate_binding.py b/scripts/generate_binding.py index 9ac563c4..06b9c431 100755 --- a/scripts/generate_binding.py +++ b/scripts/generate_binding.py @@ -58,7 +58,7 @@ def generate_unified_mshv_headers(kernel_hdr_path): regexp = f".*{header_name}.*" data = re.sub(regexp, "", data, flags=re.M) - data = re.sub(r"BIT\(([0-9]+)\)", "(1 << (\\1))", data, flags=re.M) + data = re.sub(r"BIT\(([A-Z_0-9]+)\)", "(1 << (\\1))", data, flags=re.M) fp.write(data)