Skip to content

Instantly share code, notes, and snippets.

@ant4g0nist
Last active August 3, 2021 13:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ant4g0nist/9b1786b73293052ed17ffaa1a38e4608 to your computer and use it in GitHub Desktop.
Save ant4g0nist/9b1786b73293052ed17ffaa1a38e4608 to your computer and use it in GitHub Desktop.
Apple Silicon Hypervisor.framework ffi
/* automatically generated by rust-bindgen 0.56.0 */
pub const true_: u32 = 1;
pub const false_: u32 = 0;
pub const __bool_true_false_are_defined: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 1;
pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1;
pub const __DARWIN_ONLY_VERS_1050: u32 = 1;
pub const __DARWIN_UNIX03: u32 = 1;
pub const __DARWIN_64_BIT_INO_T: u32 = 1;
pub const __DARWIN_VERS_1050: u32 = 1;
pub const __DARWIN_NON_CANCELABLE: u32 = 0;
pub const __DARWIN_SUF_EXTSN: &'static [u8; 14usize] = b"$DARWIN_EXTSN\0";
pub const __DARWIN_C_ANSI: u32 = 4096;
pub const __DARWIN_C_FULL: u32 = 900000;
pub const __DARWIN_C_LEVEL: u32 = 900000;
pub const __STDC_WANT_LIB_EXT1__: u32 = 1;
pub const __DARWIN_NO_LONG_LONG: u32 = 0;
pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_64_BIT_INODE: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_VERS_1050: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1;
pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3;
pub const __PTHREAD_SIZE__: u32 = 8176;
pub const __PTHREAD_ATTR_SIZE__: u32 = 56;
pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8;
pub const __PTHREAD_MUTEX_SIZE__: u32 = 56;
pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8;
pub const __PTHREAD_COND_SIZE__: u32 = 40;
pub const __PTHREAD_ONCE_SIZE__: u32 = 8;
pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const INT64_MAX: u64 = 9223372036854775807;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT64_MIN: i64 = -9223372036854775808;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const UINT64_MAX: i32 = -1;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST64_MIN: i64 = -9223372036854775808;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const INT_LEAST64_MAX: u64 = 9223372036854775807;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const UINT_LEAST64_MAX: i32 = -1;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i32 = -32768;
pub const INT_FAST32_MIN: i32 = -2147483648;
pub const INT_FAST64_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u32 = 32767;
pub const INT_FAST32_MAX: u32 = 2147483647;
pub const INT_FAST64_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: u32 = 65535;
pub const UINT_FAST32_MAX: u32 = 4294967295;
pub const UINT_FAST64_MAX: i32 = -1;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const UINTPTR_MAX: i32 = -1;
pub const SIZE_MAX: i32 = -1;
pub const RSIZE_MAX: i32 = -1;
pub const WINT_MIN: i32 = -2147483648;
pub const WINT_MAX: u32 = 2147483647;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const API_TO_BE_DEPRECATED: u32 = 100000;
pub const __ENABLE_LEGACY_MAC_AVAILABILITY: u32 = 1;
pub const _QUAD_HIGHWORD: u32 = 1;
pub const _QUAD_LOWWORD: u32 = 0;
pub const __DARWIN_LITTLE_ENDIAN: u32 = 1234;
pub const __DARWIN_BIG_ENDIAN: u32 = 4321;
pub const __DARWIN_PDP_ENDIAN: u32 = 3412;
pub const __DARWIN_BYTE_ORDER: u32 = 1234;
pub const LITTLE_ENDIAN: u32 = 1234;
pub const BIG_ENDIAN: u32 = 4321;
pub const PDP_ENDIAN: u32 = 3412;
pub const BYTE_ORDER: u32 = 1234;
pub const __API_TO_BE_DEPRECATED: u32 = 100000;
pub const __MAC_10_0: u32 = 1000;
pub const __MAC_10_1: u32 = 1010;
pub const __MAC_10_2: u32 = 1020;
pub const __MAC_10_3: u32 = 1030;
pub const __MAC_10_4: u32 = 1040;
pub const __MAC_10_5: u32 = 1050;
pub const __MAC_10_6: u32 = 1060;
pub const __MAC_10_7: u32 = 1070;
pub const __MAC_10_8: u32 = 1080;
pub const __MAC_10_9: u32 = 1090;
pub const __MAC_10_10: u32 = 101000;
pub const __MAC_10_10_2: u32 = 101002;
pub const __MAC_10_10_3: u32 = 101003;
pub const __MAC_10_11: u32 = 101100;
pub const __MAC_10_11_2: u32 = 101102;
pub const __MAC_10_11_3: u32 = 101103;
pub const __MAC_10_11_4: u32 = 101104;
pub const __MAC_10_12: u32 = 101200;
pub const __MAC_10_12_1: u32 = 101201;
pub const __MAC_10_12_2: u32 = 101202;
pub const __MAC_10_12_4: u32 = 101204;
pub const __MAC_10_13: u32 = 101300;
pub const __MAC_10_13_1: u32 = 101301;
pub const __MAC_10_13_2: u32 = 101302;
pub const __MAC_10_13_4: u32 = 101304;
pub const __MAC_10_14: u32 = 101400;
pub const __MAC_10_14_1: u32 = 101401;
pub const __MAC_10_14_4: u32 = 101404;
pub const __MAC_10_14_6: u32 = 101406;
pub const __MAC_10_15: u32 = 101500;
pub const __MAC_10_15_1: u32 = 101501;
pub const __MAC_10_15_4: u32 = 101504;
pub const __MAC_10_16: u32 = 101600;
pub const __MAC_11_0: u32 = 110000;
pub const __IPHONE_2_0: u32 = 20000;
pub const __IPHONE_2_1: u32 = 20100;
pub const __IPHONE_2_2: u32 = 20200;
pub const __IPHONE_3_0: u32 = 30000;
pub const __IPHONE_3_1: u32 = 30100;
pub const __IPHONE_3_2: u32 = 30200;
pub const __IPHONE_4_0: u32 = 40000;
pub const __IPHONE_4_1: u32 = 40100;
pub const __IPHONE_4_2: u32 = 40200;
pub const __IPHONE_4_3: u32 = 40300;
pub const __IPHONE_5_0: u32 = 50000;
pub const __IPHONE_5_1: u32 = 50100;
pub const __IPHONE_6_0: u32 = 60000;
pub const __IPHONE_6_1: u32 = 60100;
pub const __IPHONE_7_0: u32 = 70000;
pub const __IPHONE_7_1: u32 = 70100;
pub const __IPHONE_8_0: u32 = 80000;
pub const __IPHONE_8_1: u32 = 80100;
pub const __IPHONE_8_2: u32 = 80200;
pub const __IPHONE_8_3: u32 = 80300;
pub const __IPHONE_8_4: u32 = 80400;
pub const __IPHONE_9_0: u32 = 90000;
pub const __IPHONE_9_1: u32 = 90100;
pub const __IPHONE_9_2: u32 = 90200;
pub const __IPHONE_9_3: u32 = 90300;
pub const __IPHONE_10_0: u32 = 100000;
pub const __IPHONE_10_1: u32 = 100100;
pub const __IPHONE_10_2: u32 = 100200;
pub const __IPHONE_10_3: u32 = 100300;
pub const __IPHONE_11_0: u32 = 110000;
pub const __IPHONE_11_1: u32 = 110100;
pub const __IPHONE_11_2: u32 = 110200;
pub const __IPHONE_11_3: u32 = 110300;
pub const __IPHONE_11_4: u32 = 110400;
pub const __IPHONE_12_0: u32 = 120000;
pub const __IPHONE_12_1: u32 = 120100;
pub const __IPHONE_12_2: u32 = 120200;
pub const __IPHONE_12_3: u32 = 120300;
pub const __IPHONE_12_4: u32 = 120400;
pub const __IPHONE_13_0: u32 = 130000;
pub const __IPHONE_13_1: u32 = 130100;
pub const __IPHONE_13_2: u32 = 130200;
pub const __IPHONE_13_3: u32 = 130300;
pub const __IPHONE_13_4: u32 = 130400;
pub const __IPHONE_13_5: u32 = 130500;
pub const __IPHONE_13_6: u32 = 130600;
pub const __IPHONE_13_7: u32 = 130700;
pub const __IPHONE_14_0: u32 = 140000;
pub const __IPHONE_14_1: u32 = 140100;
pub const __IPHONE_14_2: u32 = 140200;
pub const __TVOS_9_0: u32 = 90000;
pub const __TVOS_9_1: u32 = 90100;
pub const __TVOS_9_2: u32 = 90200;
pub const __TVOS_10_0: u32 = 100000;
pub const __TVOS_10_0_1: u32 = 100001;
pub const __TVOS_10_1: u32 = 100100;
pub const __TVOS_10_2: u32 = 100200;
pub const __TVOS_11_0: u32 = 110000;
pub const __TVOS_11_1: u32 = 110100;
pub const __TVOS_11_2: u32 = 110200;
pub const __TVOS_11_3: u32 = 110300;
pub const __TVOS_11_4: u32 = 110400;
pub const __TVOS_12_0: u32 = 120000;
pub const __TVOS_12_1: u32 = 120100;
pub const __TVOS_12_2: u32 = 120200;
pub const __TVOS_12_3: u32 = 120300;
pub const __TVOS_12_4: u32 = 120400;
pub const __TVOS_13_0: u32 = 130000;
pub const __TVOS_13_2: u32 = 130200;
pub const __TVOS_13_3: u32 = 130300;
pub const __TVOS_13_4: u32 = 130400;
pub const __TVOS_14_0: u32 = 140000;
pub const __TVOS_14_1: u32 = 140100;
pub const __TVOS_14_2: u32 = 140200;
pub const __WATCHOS_1_0: u32 = 10000;
pub const __WATCHOS_2_0: u32 = 20000;
pub const __WATCHOS_2_1: u32 = 20100;
pub const __WATCHOS_2_2: u32 = 20200;
pub const __WATCHOS_3_0: u32 = 30000;
pub const __WATCHOS_3_1: u32 = 30100;
pub const __WATCHOS_3_1_1: u32 = 30101;
pub const __WATCHOS_3_2: u32 = 30200;
pub const __WATCHOS_4_0: u32 = 40000;
pub const __WATCHOS_4_1: u32 = 40100;
pub const __WATCHOS_4_2: u32 = 40200;
pub const __WATCHOS_4_3: u32 = 40300;
pub const __WATCHOS_5_0: u32 = 50000;
pub const __WATCHOS_5_1: u32 = 50100;
pub const __WATCHOS_5_2: u32 = 50200;
pub const __WATCHOS_5_3: u32 = 50300;
pub const __WATCHOS_6_0: u32 = 60000;
pub const __WATCHOS_6_1: u32 = 60100;
pub const __WATCHOS_6_2: u32 = 60200;
pub const __WATCHOS_7_0: u32 = 70000;
pub const __WATCHOS_7_1: u32 = 70100;
pub const MAC_OS_X_VERSION_10_0: u32 = 1000;
pub const MAC_OS_X_VERSION_10_1: u32 = 1010;
pub const MAC_OS_X_VERSION_10_2: u32 = 1020;
pub const MAC_OS_X_VERSION_10_3: u32 = 1030;
pub const MAC_OS_X_VERSION_10_4: u32 = 1040;
pub const MAC_OS_X_VERSION_10_5: u32 = 1050;
pub const MAC_OS_X_VERSION_10_6: u32 = 1060;
pub const MAC_OS_X_VERSION_10_7: u32 = 1070;
pub const MAC_OS_X_VERSION_10_8: u32 = 1080;
pub const MAC_OS_X_VERSION_10_9: u32 = 1090;
pub const MAC_OS_X_VERSION_10_10: u32 = 101000;
pub const MAC_OS_X_VERSION_10_10_2: u32 = 101002;
pub const MAC_OS_X_VERSION_10_10_3: u32 = 101003;
pub const MAC_OS_X_VERSION_10_11: u32 = 101100;
pub const MAC_OS_X_VERSION_10_11_2: u32 = 101102;
pub const MAC_OS_X_VERSION_10_11_3: u32 = 101103;
pub const MAC_OS_X_VERSION_10_11_4: u32 = 101104;
pub const MAC_OS_X_VERSION_10_12: u32 = 101200;
pub const MAC_OS_X_VERSION_10_12_1: u32 = 101201;
pub const MAC_OS_X_VERSION_10_12_2: u32 = 101202;
pub const MAC_OS_X_VERSION_10_12_4: u32 = 101204;
pub const MAC_OS_X_VERSION_10_13: u32 = 101300;
pub const MAC_OS_X_VERSION_10_13_1: u32 = 101301;
pub const MAC_OS_X_VERSION_10_13_2: u32 = 101302;
pub const MAC_OS_X_VERSION_10_13_4: u32 = 101304;
pub const MAC_OS_X_VERSION_10_14: u32 = 101400;
pub const MAC_OS_X_VERSION_10_14_1: u32 = 101401;
pub const MAC_OS_X_VERSION_10_14_4: u32 = 101404;
pub const MAC_OS_X_VERSION_10_14_6: u32 = 101406;
pub const MAC_OS_X_VERSION_10_15: u32 = 101500;
pub const MAC_OS_X_VERSION_10_15_1: u32 = 101501;
pub const MAC_OS_X_VERSION_10_16: u32 = 101600;
pub const MAC_OS_VERSION_11_0: u32 = 110000;
pub const __DRIVERKIT_19_0: u32 = 190000;
pub const __DRIVERKIT_20_0: u32 = 200000;
pub const __DARWIN_FD_SETSIZE: u32 = 1024;
pub const __DARWIN_NBBY: u32 = 8;
pub const NBBY: u32 = 8;
pub const FD_SETSIZE: u32 = 1024;
pub const KERN_SUCCESS: u32 = 0;
pub const KERN_INVALID_ADDRESS: u32 = 1;
pub const KERN_PROTECTION_FAILURE: u32 = 2;
pub const KERN_NO_SPACE: u32 = 3;
pub const KERN_INVALID_ARGUMENT: u32 = 4;
pub const KERN_FAILURE: u32 = 5;
pub const KERN_RESOURCE_SHORTAGE: u32 = 6;
pub const KERN_NOT_RECEIVER: u32 = 7;
pub const KERN_NO_ACCESS: u32 = 8;
pub const KERN_MEMORY_FAILURE: u32 = 9;
pub const KERN_MEMORY_ERROR: u32 = 10;
pub const KERN_ALREADY_IN_SET: u32 = 11;
pub const KERN_NOT_IN_SET: u32 = 12;
pub const KERN_NAME_EXISTS: u32 = 13;
pub const KERN_ABORTED: u32 = 14;
pub const KERN_INVALID_NAME: u32 = 15;
pub const KERN_INVALID_TASK: u32 = 16;
pub const KERN_INVALID_RIGHT: u32 = 17;
pub const KERN_INVALID_VALUE: u32 = 18;
pub const KERN_UREFS_OVERFLOW: u32 = 19;
pub const KERN_INVALID_CAPABILITY: u32 = 20;
pub const KERN_RIGHT_EXISTS: u32 = 21;
pub const KERN_INVALID_HOST: u32 = 22;
pub const KERN_MEMORY_PRESENT: u32 = 23;
pub const KERN_MEMORY_DATA_MOVED: u32 = 24;
pub const KERN_MEMORY_RESTART_COPY: u32 = 25;
pub const KERN_INVALID_PROCESSOR_SET: u32 = 26;
pub const KERN_POLICY_LIMIT: u32 = 27;
pub const KERN_INVALID_POLICY: u32 = 28;
pub const KERN_INVALID_OBJECT: u32 = 29;
pub const KERN_ALREADY_WAITING: u32 = 30;
pub const KERN_DEFAULT_SET: u32 = 31;
pub const KERN_EXCEPTION_PROTECTED: u32 = 32;
pub const KERN_INVALID_LEDGER: u32 = 33;
pub const KERN_INVALID_MEMORY_CONTROL: u32 = 34;
pub const KERN_INVALID_SECURITY: u32 = 35;
pub const KERN_NOT_DEPRESSED: u32 = 36;
pub const KERN_TERMINATED: u32 = 37;
pub const KERN_LOCK_SET_DESTROYED: u32 = 38;
pub const KERN_LOCK_UNSTABLE: u32 = 39;
pub const KERN_LOCK_OWNED: u32 = 40;
pub const KERN_LOCK_OWNED_SELF: u32 = 41;
pub const KERN_SEMAPHORE_DESTROYED: u32 = 42;
pub const KERN_RPC_SERVER_TERMINATED: u32 = 43;
pub const KERN_RPC_TERMINATE_ORPHAN: u32 = 44;
pub const KERN_RPC_CONTINUE_ORPHAN: u32 = 45;
pub const KERN_NOT_SUPPORTED: u32 = 46;
pub const KERN_NODE_DOWN: u32 = 47;
pub const KERN_NOT_WAITING: u32 = 48;
pub const KERN_OPERATION_TIMED_OUT: u32 = 49;
pub const KERN_CODESIGN_ERROR: u32 = 50;
pub const KERN_POLICY_STATIC: u32 = 51;
pub const KERN_INSUFFICIENT_BUFFER_SIZE: u32 = 52;
pub const KERN_DENIED: u32 = 53;
pub const KERN_RETURN_MAX: u32 = 256;
pub const code_emask: u32 = 16383;
pub const err_max_system: u32 = 63;
pub const DYNAMIC_TARGETS_ENABLED: u32 = 0;
pub const TARGET_OS_MAC: u32 = 1;
pub const TARGET_OS_WIN32: u32 = 0;
pub const TARGET_OS_UNIX: u32 = 0;
pub const TARGET_OS_OSX: u32 = 1;
pub const TARGET_OS_IPHONE: u32 = 0;
pub const TARGET_OS_IOS: u32 = 0;
pub const TARGET_OS_WATCH: u32 = 0;
pub const TARGET_OS_TV: u32 = 0;
pub const TARGET_OS_MACCATALYST: u32 = 0;
pub const TARGET_OS_UIKITFORMAC: u32 = 0;
pub const TARGET_OS_SIMULATOR: u32 = 0;
pub const TARGET_OS_EMBEDDED: u32 = 0;
pub const TARGET_OS_RTKIT: u32 = 0;
pub const TARGET_OS_DRIVERKIT: u32 = 0;
pub const TARGET_IPHONE_SIMULATOR: u32 = 0;
pub const TARGET_OS_NANO: u32 = 0;
pub const TARGET_CPU_PPC: u32 = 0;
pub const TARGET_CPU_PPC64: u32 = 0;
pub const TARGET_CPU_68K: u32 = 0;
pub const TARGET_CPU_X86: u32 = 0;
pub const TARGET_CPU_X86_64: u32 = 0;
pub const TARGET_CPU_ARM: u32 = 0;
pub const TARGET_CPU_ARM64: u32 = 1;
pub const TARGET_CPU_MIPS: u32 = 0;
pub const TARGET_CPU_SPARC: u32 = 0;
pub const TARGET_CPU_ALPHA: u32 = 0;
pub const TARGET_RT_MAC_CFM: u32 = 0;
pub const TARGET_RT_MAC_MACHO: u32 = 1;
pub const TARGET_RT_LITTLE_ENDIAN: u32 = 1;
pub const TARGET_RT_BIG_ENDIAN: u32 = 0;
pub const TARGET_RT_64_BIT: u32 = 1;
pub const OS_OBJECT_HAVE_OBJC_SUPPORT: u32 = 0;
pub const OS_OBJECT_USE_OBJC: u32 = 0;
pub const OS_OBJECT_SWIFT3: u32 = 0;
pub const OS_OBJECT_USE_OBJC_RETAIN_RELEASE: u32 = 0;
pub type int_least8_t = i8;
pub type int_least16_t = i16;
pub type int_least32_t = i32;
pub type int_least64_t = i64;
pub type uint_least8_t = u8;
pub type uint_least16_t = u16;
pub type uint_least32_t = u32;
pub type uint_least64_t = u64;
pub type int_fast8_t = i8;
pub type int_fast16_t = i16;
pub type int_fast32_t = i32;
pub type int_fast64_t = i64;
pub type uint_fast8_t = u8;
pub type uint_fast16_t = u16;
pub type uint_fast32_t = u32;
pub type uint_fast64_t = u64;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __uint64_t = ::std::os::raw::c_ulonglong;
pub type __darwin_intptr_t = ::std::os::raw::c_long;
pub type __darwin_natural_t = ::std::os::raw::c_uint;
pub type __darwin_ct_rune_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __mbstate_t {
pub __mbstate8: [::std::os::raw::c_char; 128usize],
pub _mbstateL: ::std::os::raw::c_longlong,
_bindgen_union_align: [u64; 16usize],
}
#[test]
fn bindgen_test_layout___mbstate_t() {
assert_eq!(
::std::mem::size_of::<__mbstate_t>(),
128usize,
concat!("Size of: ", stringify!(__mbstate_t))
);
assert_eq!(
::std::mem::align_of::<__mbstate_t>(),
8usize,
concat!("Alignment of ", stringify!(__mbstate_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__mbstate8 as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__mbstate_t),
"::",
stringify!(__mbstate8)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__mbstate_t>()))._mbstateL as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__mbstate_t),
"::",
stringify!(_mbstateL)
)
);
}
pub type __darwin_mbstate_t = __mbstate_t;
pub type __darwin_ptrdiff_t = ::std::os::raw::c_long;
pub type __darwin_size_t = ::std::os::raw::c_ulong;
pub type __darwin_va_list = __builtin_va_list;
pub type __darwin_wchar_t = ::std::os::raw::c_int;
pub type __darwin_rune_t = __darwin_wchar_t;
pub type __darwin_wint_t = ::std::os::raw::c_int;
pub type __darwin_clock_t = ::std::os::raw::c_ulong;
pub type __darwin_socklen_t = __uint32_t;
pub type __darwin_ssize_t = ::std::os::raw::c_long;
pub type __darwin_time_t = ::std::os::raw::c_long;
pub type __darwin_blkcnt_t = __int64_t;
pub type __darwin_blksize_t = __int32_t;
pub type __darwin_dev_t = __int32_t;
pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint;
pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint;
pub type __darwin_gid_t = __uint32_t;
pub type __darwin_id_t = __uint32_t;
pub type __darwin_ino64_t = __uint64_t;
pub type __darwin_ino_t = __darwin_ino64_t;
pub type __darwin_mach_port_name_t = __darwin_natural_t;
pub type __darwin_mach_port_t = __darwin_mach_port_name_t;
pub type __darwin_mode_t = __uint16_t;
pub type __darwin_off_t = __int64_t;
pub type __darwin_pid_t = __int32_t;
pub type __darwin_sigset_t = __uint32_t;
pub type __darwin_suseconds_t = __int32_t;
pub type __darwin_uid_t = __uint32_t;
pub type __darwin_useconds_t = __uint32_t;
pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize];
pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __darwin_pthread_handler_rec {
pub __routine: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
pub __arg: *mut ::std::os::raw::c_void,
pub __next: *mut __darwin_pthread_handler_rec,
}
#[test]
fn bindgen_test_layout___darwin_pthread_handler_rec() {
assert_eq!(
::std::mem::size_of::<__darwin_pthread_handler_rec>(),
24usize,
concat!("Size of: ", stringify!(__darwin_pthread_handler_rec))
);
assert_eq!(
::std::mem::align_of::<__darwin_pthread_handler_rec>(),
8usize,
concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__routine as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(__darwin_pthread_handler_rec),
"::",
stringify!(__routine)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__arg as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(__darwin_pthread_handler_rec),
"::",
stringify!(__arg)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<__darwin_pthread_handler_rec>())).__next as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(__darwin_pthread_handler_rec),
"::",
stringify!(__next)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_attr_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 56usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_attr_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_attr_t>(),
64usize,
concat!("Size of: ", stringify!(_opaque_pthread_attr_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_attr_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_attr_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_attr_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_attr_t>())).__opaque as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_attr_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_cond_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 40usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_cond_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_cond_t>(),
48usize,
concat!("Size of: ", stringify!(_opaque_pthread_cond_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_cond_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_cond_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_cond_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_cond_t>())).__opaque as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_cond_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_condattr_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_condattr_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_condattr_t>(),
16usize,
concat!("Size of: ", stringify!(_opaque_pthread_condattr_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_condattr_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__sig as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_condattr_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_condattr_t>())).__opaque as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_condattr_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_mutex_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 56usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_mutex_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_mutex_t>(),
64usize,
concat!("Size of: ", stringify!(_opaque_pthread_mutex_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_mutex_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_mutex_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_mutex_t>())).__opaque as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_mutex_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_mutexattr_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_mutexattr_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_mutexattr_t>(),
16usize,
concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_mutexattr_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__sig as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_mutexattr_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_mutexattr_t>())).__opaque as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_mutexattr_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_once_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_once_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_once_t>(),
16usize,
concat!("Size of: ", stringify!(_opaque_pthread_once_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_once_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_once_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_once_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_once_t>())).__opaque as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_once_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_rwlock_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 192usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_rwlock_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_rwlock_t>(),
200usize,
concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_rwlock_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_rwlock_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__opaque as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_rwlock_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_rwlockattr_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 16usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_rwlockattr_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(),
24usize,
concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__sig as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_rwlockattr_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_rwlockattr_t>())).__opaque as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_rwlockattr_t),
"::",
stringify!(__opaque)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _opaque_pthread_t {
pub __sig: ::std::os::raw::c_long,
pub __cleanup_stack: *mut __darwin_pthread_handler_rec,
pub __opaque: [::std::os::raw::c_char; 8176usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_t() {
assert_eq!(
::std::mem::size_of::<_opaque_pthread_t>(),
8192usize,
concat!("Size of: ", stringify!(_opaque_pthread_t))
);
assert_eq!(
::std::mem::align_of::<_opaque_pthread_t>(),
8usize,
concat!("Alignment of ", stringify!(_opaque_pthread_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__sig as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_t),
"::",
stringify!(__sig)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_opaque_pthread_t>())).__cleanup_stack as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_t),
"::",
stringify!(__cleanup_stack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_opaque_pthread_t>())).__opaque as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_opaque_pthread_t),
"::",
stringify!(__opaque)
)
);
}
pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t;
pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t;
pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t;
pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong;
pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t;
pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t;
pub type __darwin_pthread_once_t = _opaque_pthread_once_t;
pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t;
pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t;
pub type __darwin_pthread_t = *mut _opaque_pthread_t;
pub type u_int8_t = ::std::os::raw::c_uchar;
pub type u_int16_t = ::std::os::raw::c_ushort;
pub type u_int32_t = ::std::os::raw::c_uint;
pub type u_int64_t = ::std::os::raw::c_ulonglong;
pub type register_t = i64;
pub type user_addr_t = u_int64_t;
pub type user_size_t = u_int64_t;
pub type user_ssize_t = i64;
pub type user_long_t = i64;
pub type user_ulong_t = u_int64_t;
pub type user_time_t = i64;
pub type user_off_t = i64;
pub type syscall_arg_t = u_int64_t;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
pub type os_function_t =
::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>;
pub type os_block_t = *mut ::std::os::raw::c_void;
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct _OSUnalignedU16 {
pub __val: u16,
}
#[test]
fn bindgen_test_layout__OSUnalignedU16() {
assert_eq!(
::std::mem::size_of::<_OSUnalignedU16>(),
2usize,
concat!("Size of: ", stringify!(_OSUnalignedU16))
);
assert_eq!(
::std::mem::align_of::<_OSUnalignedU16>(),
1usize,
concat!("Alignment of ", stringify!(_OSUnalignedU16))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_OSUnalignedU16>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_OSUnalignedU16),
"::",
stringify!(__val)
)
);
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct _OSUnalignedU32 {
pub __val: u32,
}
#[test]
fn bindgen_test_layout__OSUnalignedU32() {
assert_eq!(
::std::mem::size_of::<_OSUnalignedU32>(),
4usize,
concat!("Size of: ", stringify!(_OSUnalignedU32))
);
assert_eq!(
::std::mem::align_of::<_OSUnalignedU32>(),
1usize,
concat!("Alignment of ", stringify!(_OSUnalignedU32))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_OSUnalignedU32>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_OSUnalignedU32),
"::",
stringify!(__val)
)
);
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct _OSUnalignedU64 {
pub __val: u64,
}
#[test]
fn bindgen_test_layout__OSUnalignedU64() {
assert_eq!(
::std::mem::size_of::<_OSUnalignedU64>(),
8usize,
concat!("Size of: ", stringify!(_OSUnalignedU64))
);
assert_eq!(
::std::mem::align_of::<_OSUnalignedU64>(),
1usize,
concat!("Alignment of ", stringify!(_OSUnalignedU64))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_OSUnalignedU64>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_OSUnalignedU64),
"::",
stringify!(__val)
)
);
}
pub type u_char = ::std::os::raw::c_uchar;
pub type u_short = ::std::os::raw::c_ushort;
pub type u_int = ::std::os::raw::c_uint;
pub type u_long = ::std::os::raw::c_ulong;
pub type ushort = ::std::os::raw::c_ushort;
pub type uint = ::std::os::raw::c_uint;
pub type u_quad_t = u_int64_t;
pub type quad_t = i64;
pub type qaddr_t = *mut quad_t;
pub type caddr_t = *mut ::std::os::raw::c_char;
pub type daddr_t = i32;
pub type dev_t = __darwin_dev_t;
pub type fixpt_t = u_int32_t;
pub type blkcnt_t = __darwin_blkcnt_t;
pub type blksize_t = __darwin_blksize_t;
pub type gid_t = __darwin_gid_t;
pub type in_addr_t = __uint32_t;
pub type in_port_t = __uint16_t;
pub type ino_t = __darwin_ino_t;
pub type ino64_t = __darwin_ino64_t;
pub type key_t = __int32_t;
pub type mode_t = __darwin_mode_t;
pub type nlink_t = __uint16_t;
pub type id_t = __darwin_id_t;
pub type pid_t = __darwin_pid_t;
pub type off_t = __darwin_off_t;
pub type segsz_t = i32;
pub type swblk_t = i32;
pub type uid_t = __darwin_uid_t;
pub type clock_t = __darwin_clock_t;
pub type size_t = __darwin_size_t;
pub type ssize_t = __darwin_ssize_t;
pub type time_t = __darwin_time_t;
pub type useconds_t = __darwin_useconds_t;
pub type suseconds_t = __darwin_suseconds_t;
pub type rsize_t = __darwin_size_t;
pub type errno_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fd_set {
pub fds_bits: [__int32_t; 32usize],
}
#[test]
fn bindgen_test_layout_fd_set() {
assert_eq!(
::std::mem::size_of::<fd_set>(),
128usize,
concat!("Size of: ", stringify!(fd_set))
);
assert_eq!(
::std::mem::align_of::<fd_set>(),
4usize,
concat!("Alignment of ", stringify!(fd_set))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<fd_set>())).fds_bits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(fd_set),
"::",
stringify!(fds_bits)
)
);
}
extern "C" {
pub fn __darwin_check_fd_set_overflow(
arg1: ::std::os::raw::c_int,
arg2: *const ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub type fd_mask = __int32_t;
pub type pthread_attr_t = __darwin_pthread_attr_t;
pub type pthread_cond_t = __darwin_pthread_cond_t;
pub type pthread_condattr_t = __darwin_pthread_condattr_t;
pub type pthread_mutex_t = __darwin_pthread_mutex_t;
pub type pthread_mutexattr_t = __darwin_pthread_mutexattr_t;
pub type pthread_once_t = __darwin_pthread_once_t;
pub type pthread_rwlock_t = __darwin_pthread_rwlock_t;
pub type pthread_rwlockattr_t = __darwin_pthread_rwlockattr_t;
pub type pthread_t = __darwin_pthread_t;
pub type pthread_key_t = __darwin_pthread_key_t;
pub type fsblkcnt_t = __darwin_fsblkcnt_t;
pub type fsfilcnt_t = __darwin_fsfilcnt_t;
pub type kern_return_t = ::std::os::raw::c_int;
pub type mach_error_t = kern_return_t;
pub type mach_error_fn_t = ::std::option::Option<unsafe extern "C" fn() -> mach_error_t>;
pub const HV_SUCCESS: ::std::os::raw::c_int = 0;
pub const HV_ERROR: ::std::os::raw::c_int = -85377023;
pub const HV_BUSY: ::std::os::raw::c_int = -85377022;
pub const HV_BAD_ARGUMENT: ::std::os::raw::c_int = -85377021;
pub const HV_ILLEGAL_GUEST_STATE: ::std::os::raw::c_int = -85377020;
pub const HV_NO_RESOURCES: ::std::os::raw::c_int = -85377019;
pub const HV_NO_DEVICE: ::std::os::raw::c_int = -85377018;
pub const HV_DENIED: ::std::os::raw::c_int = -85377017;
pub const HV_UNSUPPORTED: ::std::os::raw::c_int = -85377009;
pub type _bindgen_ty_1 = ::std::os::raw::c_int;
pub type hv_return_t = mach_error_t;
pub const HV_MEMORY_READ: ::std::os::raw::c_uint = 1;
pub const HV_MEMORY_WRITE: ::std::os::raw::c_uint = 2;
pub const HV_MEMORY_EXEC: ::std::os::raw::c_uint = 4;
pub type _bindgen_ty_2 = ::std::os::raw::c_uint;
#[doc = " @enum hv_memory_flags_t"]
#[doc = " @abstract Guest physical memory region permissions for hv_vm_map()"]
#[doc = " and hv_vm_protect()"]
pub type hv_memory_flags_t = u64;
extern "C" {
pub fn os_retain(object: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn os_release(object: *mut ::std::os::raw::c_void);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hv_vm_config_s {
_unused: [u8; 0],
}
pub type hv_vm_config_t = *mut hv_vm_config_s;
#[doc = " @typedef hv_ipa_t"]
#[doc = " @abstract Type of an Intermediate Physical Address (a guest physical address)"]
pub type hv_ipa_t = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hv_vcpu_config_s {
_unused: [u8; 0],
}
pub type hv_vcpu_config_t = *mut hv_vcpu_config_s;
#[doc = " @typedef hv_vcpu_t"]
#[doc = " @abstract Type of a vcpu instance ID"]
pub type hv_vcpu_t = u64;
pub const HV_EXIT_REASON_CANCELED: hv_exit_reason_t = 0;
pub const HV_EXIT_REASON_EXCEPTION: hv_exit_reason_t = 1;
pub const HV_EXIT_REASON_VTIMER_ACTIVATED: hv_exit_reason_t = 2;
pub const HV_EXIT_REASON_UNKNOWN: hv_exit_reason_t = 3;
pub type hv_exit_reason_t = u32;
#[doc = " @typedef hv_exception_syndrome_t"]
#[doc = " @abstract Type of a vcpu exception syndrome (Corresponds to ESR_EL2)."]
pub type hv_exception_syndrome_t = u64;
#[doc = " @typedef hv_exception_address_t"]
#[doc = " @abstract Type of a vcpu exception virtual address. (Corresponds to FAR_EL2)."]
pub type hv_exception_address_t = u64;
#[doc = " @typedef hv_vcpu_exit_exception_t"]
#[doc = " @abstract Contains details of a vcpu exception."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hv_vcpu_exit_exception_t {
pub syndrome: hv_exception_syndrome_t,
pub virtual_address: hv_exception_address_t,
pub physical_address: hv_ipa_t,
}
#[test]
fn bindgen_test_layout_hv_vcpu_exit_exception_t() {
assert_eq!(
::std::mem::size_of::<hv_vcpu_exit_exception_t>(),
24usize,
concat!("Size of: ", stringify!(hv_vcpu_exit_exception_t))
);
assert_eq!(
::std::mem::align_of::<hv_vcpu_exit_exception_t>(),
8usize,
concat!("Alignment of ", stringify!(hv_vcpu_exit_exception_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<hv_vcpu_exit_exception_t>())).syndrome as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(hv_vcpu_exit_exception_t),
"::",
stringify!(syndrome)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<hv_vcpu_exit_exception_t>())).virtual_address as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(hv_vcpu_exit_exception_t),
"::",
stringify!(virtual_address)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<hv_vcpu_exit_exception_t>())).physical_address as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(hv_vcpu_exit_exception_t),
"::",
stringify!(physical_address)
)
);
}
#[doc = " @typedef hv_vcpu_exit_t"]
#[doc = " @abstract Contains information about an exit from the vcpu to the host."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hv_vcpu_exit_t {
pub reason: hv_exit_reason_t,
pub exception: hv_vcpu_exit_exception_t,
}
#[test]
fn bindgen_test_layout_hv_vcpu_exit_t() {
assert_eq!(
::std::mem::size_of::<hv_vcpu_exit_t>(),
32usize,
concat!("Size of: ", stringify!(hv_vcpu_exit_t))
);
assert_eq!(
::std::mem::align_of::<hv_vcpu_exit_t>(),
8usize,
concat!("Alignment of ", stringify!(hv_vcpu_exit_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hv_vcpu_exit_t>())).reason as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(hv_vcpu_exit_t),
"::",
stringify!(reason)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hv_vcpu_exit_t>())).exception as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(hv_vcpu_exit_t),
"::",
stringify!(exception)
)
);
}
#[doc = " @typedef hv_simd_fp_uchar16_t"]
#[doc = " @abstract Value of an ARM SIMD&FP register."]
pub type hv_simd_fp_uchar16_t = u128;
pub const HV_REG_X0: hv_reg_t = 0;
pub const HV_REG_X1: hv_reg_t = 1;
pub const HV_REG_X2: hv_reg_t = 2;
pub const HV_REG_X3: hv_reg_t = 3;
pub const HV_REG_X4: hv_reg_t = 4;
pub const HV_REG_X5: hv_reg_t = 5;
pub const HV_REG_X6: hv_reg_t = 6;
pub const HV_REG_X7: hv_reg_t = 7;
pub const HV_REG_X8: hv_reg_t = 8;
pub const HV_REG_X9: hv_reg_t = 9;
pub const HV_REG_X10: hv_reg_t = 10;
pub const HV_REG_X11: hv_reg_t = 11;
pub const HV_REG_X12: hv_reg_t = 12;
pub const HV_REG_X13: hv_reg_t = 13;
pub const HV_REG_X14: hv_reg_t = 14;
pub const HV_REG_X15: hv_reg_t = 15;
pub const HV_REG_X16: hv_reg_t = 16;
pub const HV_REG_X17: hv_reg_t = 17;
pub const HV_REG_X18: hv_reg_t = 18;
pub const HV_REG_X19: hv_reg_t = 19;
pub const HV_REG_X20: hv_reg_t = 20;
pub const HV_REG_X21: hv_reg_t = 21;
pub const HV_REG_X22: hv_reg_t = 22;
pub const HV_REG_X23: hv_reg_t = 23;
pub const HV_REG_X24: hv_reg_t = 24;
pub const HV_REG_X25: hv_reg_t = 25;
pub const HV_REG_X26: hv_reg_t = 26;
pub const HV_REG_X27: hv_reg_t = 27;
pub const HV_REG_X28: hv_reg_t = 28;
pub const HV_REG_X29: hv_reg_t = 29;
pub const HV_REG_FP: hv_reg_t = 29;
pub const HV_REG_X30: hv_reg_t = 30;
pub const HV_REG_LR: hv_reg_t = 30;
pub const HV_REG_PC: hv_reg_t = 31;
pub const HV_REG_FPCR: hv_reg_t = 32;
pub const HV_REG_FPSR: hv_reg_t = 33;
pub const HV_REG_CPSR: hv_reg_t = 34;
pub type hv_reg_t = u32;
pub const HV_SIMD_FP_REG_Q0: hv_simd_fp_reg_t = 0;
pub const HV_SIMD_FP_REG_Q1: hv_simd_fp_reg_t = 1;
pub const HV_SIMD_FP_REG_Q2: hv_simd_fp_reg_t = 2;
pub const HV_SIMD_FP_REG_Q3: hv_simd_fp_reg_t = 3;
pub const HV_SIMD_FP_REG_Q4: hv_simd_fp_reg_t = 4;
pub const HV_SIMD_FP_REG_Q5: hv_simd_fp_reg_t = 5;
pub const HV_SIMD_FP_REG_Q6: hv_simd_fp_reg_t = 6;
pub const HV_SIMD_FP_REG_Q7: hv_simd_fp_reg_t = 7;
pub const HV_SIMD_FP_REG_Q8: hv_simd_fp_reg_t = 8;
pub const HV_SIMD_FP_REG_Q9: hv_simd_fp_reg_t = 9;
pub const HV_SIMD_FP_REG_Q10: hv_simd_fp_reg_t = 10;
pub const HV_SIMD_FP_REG_Q11: hv_simd_fp_reg_t = 11;
pub const HV_SIMD_FP_REG_Q12: hv_simd_fp_reg_t = 12;
pub const HV_SIMD_FP_REG_Q13: hv_simd_fp_reg_t = 13;
pub const HV_SIMD_FP_REG_Q14: hv_simd_fp_reg_t = 14;
pub const HV_SIMD_FP_REG_Q15: hv_simd_fp_reg_t = 15;
pub const HV_SIMD_FP_REG_Q16: hv_simd_fp_reg_t = 16;
pub const HV_SIMD_FP_REG_Q17: hv_simd_fp_reg_t = 17;
pub const HV_SIMD_FP_REG_Q18: hv_simd_fp_reg_t = 18;
pub const HV_SIMD_FP_REG_Q19: hv_simd_fp_reg_t = 19;
pub const HV_SIMD_FP_REG_Q20: hv_simd_fp_reg_t = 20;
pub const HV_SIMD_FP_REG_Q21: hv_simd_fp_reg_t = 21;
pub const HV_SIMD_FP_REG_Q22: hv_simd_fp_reg_t = 22;
pub const HV_SIMD_FP_REG_Q23: hv_simd_fp_reg_t = 23;
pub const HV_SIMD_FP_REG_Q24: hv_simd_fp_reg_t = 24;
pub const HV_SIMD_FP_REG_Q25: hv_simd_fp_reg_t = 25;
pub const HV_SIMD_FP_REG_Q26: hv_simd_fp_reg_t = 26;
pub const HV_SIMD_FP_REG_Q27: hv_simd_fp_reg_t = 27;
pub const HV_SIMD_FP_REG_Q28: hv_simd_fp_reg_t = 28;
pub const HV_SIMD_FP_REG_Q29: hv_simd_fp_reg_t = 29;
pub const HV_SIMD_FP_REG_Q30: hv_simd_fp_reg_t = 30;
pub const HV_SIMD_FP_REG_Q31: hv_simd_fp_reg_t = 31;
pub type hv_simd_fp_reg_t = u32;
pub const HV_SYS_REG_DBGBVR0_EL1: hv_sys_reg_t = 32772;
pub const HV_SYS_REG_DBGBCR0_EL1: hv_sys_reg_t = 32773;
pub const HV_SYS_REG_DBGWVR0_EL1: hv_sys_reg_t = 32774;
pub const HV_SYS_REG_DBGWCR0_EL1: hv_sys_reg_t = 32775;
pub const HV_SYS_REG_DBGBVR1_EL1: hv_sys_reg_t = 32780;
pub const HV_SYS_REG_DBGBCR1_EL1: hv_sys_reg_t = 32781;
pub const HV_SYS_REG_DBGWVR1_EL1: hv_sys_reg_t = 32782;
pub const HV_SYS_REG_DBGWCR1_EL1: hv_sys_reg_t = 32783;
pub const HV_SYS_REG_MDCCINT_EL1: hv_sys_reg_t = 32784;
pub const HV_SYS_REG_MDSCR_EL1: hv_sys_reg_t = 32786;
pub const HV_SYS_REG_DBGBVR2_EL1: hv_sys_reg_t = 32788;
pub const HV_SYS_REG_DBGBCR2_EL1: hv_sys_reg_t = 32789;
pub const HV_SYS_REG_DBGWVR2_EL1: hv_sys_reg_t = 32790;
pub const HV_SYS_REG_DBGWCR2_EL1: hv_sys_reg_t = 32791;
pub const HV_SYS_REG_DBGBVR3_EL1: hv_sys_reg_t = 32796;
pub const HV_SYS_REG_DBGBCR3_EL1: hv_sys_reg_t = 32797;
pub const HV_SYS_REG_DBGWVR3_EL1: hv_sys_reg_t = 32798;
pub const HV_SYS_REG_DBGWCR3_EL1: hv_sys_reg_t = 32799;
pub const HV_SYS_REG_DBGBVR4_EL1: hv_sys_reg_t = 32804;
pub const HV_SYS_REG_DBGBCR4_EL1: hv_sys_reg_t = 32805;
pub const HV_SYS_REG_DBGWVR4_EL1: hv_sys_reg_t = 32806;
pub const HV_SYS_REG_DBGWCR4_EL1: hv_sys_reg_t = 32807;
pub const HV_SYS_REG_DBGBVR5_EL1: hv_sys_reg_t = 32812;
pub const HV_SYS_REG_DBGBCR5_EL1: hv_sys_reg_t = 32813;
pub const HV_SYS_REG_DBGWVR5_EL1: hv_sys_reg_t = 32814;
pub const HV_SYS_REG_DBGWCR5_EL1: hv_sys_reg_t = 32815;
pub const HV_SYS_REG_DBGBVR6_EL1: hv_sys_reg_t = 32820;
pub const HV_SYS_REG_DBGBCR6_EL1: hv_sys_reg_t = 32821;
pub const HV_SYS_REG_DBGWVR6_EL1: hv_sys_reg_t = 32822;
pub const HV_SYS_REG_DBGWCR6_EL1: hv_sys_reg_t = 32823;
pub const HV_SYS_REG_DBGBVR7_EL1: hv_sys_reg_t = 32828;
pub const HV_SYS_REG_DBGBCR7_EL1: hv_sys_reg_t = 32829;
pub const HV_SYS_REG_DBGWVR7_EL1: hv_sys_reg_t = 32830;
pub const HV_SYS_REG_DBGWCR7_EL1: hv_sys_reg_t = 32831;
pub const HV_SYS_REG_DBGBVR8_EL1: hv_sys_reg_t = 32836;
pub const HV_SYS_REG_DBGBCR8_EL1: hv_sys_reg_t = 32837;
pub const HV_SYS_REG_DBGWVR8_EL1: hv_sys_reg_t = 32838;
pub const HV_SYS_REG_DBGWCR8_EL1: hv_sys_reg_t = 32839;
pub const HV_SYS_REG_DBGBVR9_EL1: hv_sys_reg_t = 32844;
pub const HV_SYS_REG_DBGBCR9_EL1: hv_sys_reg_t = 32845;
pub const HV_SYS_REG_DBGWVR9_EL1: hv_sys_reg_t = 32846;
pub const HV_SYS_REG_DBGWCR9_EL1: hv_sys_reg_t = 32847;
pub const HV_SYS_REG_DBGBVR10_EL1: hv_sys_reg_t = 32852;
pub const HV_SYS_REG_DBGBCR10_EL1: hv_sys_reg_t = 32853;
pub const HV_SYS_REG_DBGWVR10_EL1: hv_sys_reg_t = 32854;
pub const HV_SYS_REG_DBGWCR10_EL1: hv_sys_reg_t = 32855;
pub const HV_SYS_REG_DBGBVR11_EL1: hv_sys_reg_t = 32860;
pub const HV_SYS_REG_DBGBCR11_EL1: hv_sys_reg_t = 32861;
pub const HV_SYS_REG_DBGWVR11_EL1: hv_sys_reg_t = 32862;
pub const HV_SYS_REG_DBGWCR11_EL1: hv_sys_reg_t = 32863;
pub const HV_SYS_REG_DBGBVR12_EL1: hv_sys_reg_t = 32868;
pub const HV_SYS_REG_DBGBCR12_EL1: hv_sys_reg_t = 32869;
pub const HV_SYS_REG_DBGWVR12_EL1: hv_sys_reg_t = 32870;
pub const HV_SYS_REG_DBGWCR12_EL1: hv_sys_reg_t = 32871;
pub const HV_SYS_REG_DBGBVR13_EL1: hv_sys_reg_t = 32876;
pub const HV_SYS_REG_DBGBCR13_EL1: hv_sys_reg_t = 32877;
pub const HV_SYS_REG_DBGWVR13_EL1: hv_sys_reg_t = 32878;
pub const HV_SYS_REG_DBGWCR13_EL1: hv_sys_reg_t = 32879;
pub const HV_SYS_REG_DBGBVR14_EL1: hv_sys_reg_t = 32884;
pub const HV_SYS_REG_DBGBCR14_EL1: hv_sys_reg_t = 32885;
pub const HV_SYS_REG_DBGWVR14_EL1: hv_sys_reg_t = 32886;
pub const HV_SYS_REG_DBGWCR14_EL1: hv_sys_reg_t = 32887;
pub const HV_SYS_REG_DBGBVR15_EL1: hv_sys_reg_t = 32892;
pub const HV_SYS_REG_DBGBCR15_EL1: hv_sys_reg_t = 32893;
pub const HV_SYS_REG_DBGWVR15_EL1: hv_sys_reg_t = 32894;
pub const HV_SYS_REG_DBGWCR15_EL1: hv_sys_reg_t = 32895;
pub const HV_SYS_REG_MIDR_EL1: hv_sys_reg_t = 49152;
pub const HV_SYS_REG_MPIDR_EL1: hv_sys_reg_t = 49157;
pub const HV_SYS_REG_ID_AA64PFR0_EL1: hv_sys_reg_t = 49184;
pub const HV_SYS_REG_ID_AA64PFR1_EL1: hv_sys_reg_t = 49185;
pub const HV_SYS_REG_ID_AA64DFR0_EL1: hv_sys_reg_t = 49192;
pub const HV_SYS_REG_ID_AA64DFR1_EL1: hv_sys_reg_t = 49193;
pub const HV_SYS_REG_ID_AA64ISAR0_EL1: hv_sys_reg_t = 49200;
pub const HV_SYS_REG_ID_AA64ISAR1_EL1: hv_sys_reg_t = 49201;
pub const HV_SYS_REG_ID_AA64MMFR0_EL1: hv_sys_reg_t = 49208;
pub const HV_SYS_REG_ID_AA64MMFR1_EL1: hv_sys_reg_t = 49209;
pub const HV_SYS_REG_ID_AA64MMFR2_EL1: hv_sys_reg_t = 49210;
pub const HV_SYS_REG_SCTLR_EL1: hv_sys_reg_t = 49280;
pub const HV_SYS_REG_CPACR_EL1: hv_sys_reg_t = 49282;
pub const HV_SYS_REG_TTBR0_EL1: hv_sys_reg_t = 49408;
pub const HV_SYS_REG_TTBR1_EL1: hv_sys_reg_t = 49409;
pub const HV_SYS_REG_TCR_EL1: hv_sys_reg_t = 49410;
pub const HV_SYS_REG_APIAKEYLO_EL1: hv_sys_reg_t = 49416;
pub const HV_SYS_REG_APIAKEYHI_EL1: hv_sys_reg_t = 49417;
pub const HV_SYS_REG_APIBKEYLO_EL1: hv_sys_reg_t = 49418;
pub const HV_SYS_REG_APIBKEYHI_EL1: hv_sys_reg_t = 49419;
pub const HV_SYS_REG_APDAKEYLO_EL1: hv_sys_reg_t = 49424;
pub const HV_SYS_REG_APDAKEYHI_EL1: hv_sys_reg_t = 49425;
pub const HV_SYS_REG_APDBKEYLO_EL1: hv_sys_reg_t = 49426;
pub const HV_SYS_REG_APDBKEYHI_EL1: hv_sys_reg_t = 49427;
pub const HV_SYS_REG_APGAKEYLO_EL1: hv_sys_reg_t = 49432;
pub const HV_SYS_REG_APGAKEYHI_EL1: hv_sys_reg_t = 49433;
pub const HV_SYS_REG_SPSR_EL1: hv_sys_reg_t = 49664;
pub const HV_SYS_REG_ELR_EL1: hv_sys_reg_t = 49665;
pub const HV_SYS_REG_SP_EL0: hv_sys_reg_t = 49672;
pub const HV_SYS_REG_AFSR0_EL1: hv_sys_reg_t = 49800;
pub const HV_SYS_REG_AFSR1_EL1: hv_sys_reg_t = 49801;
pub const HV_SYS_REG_ESR_EL1: hv_sys_reg_t = 49808;
pub const HV_SYS_REG_FAR_EL1: hv_sys_reg_t = 49920;
pub const HV_SYS_REG_PAR_EL1: hv_sys_reg_t = 50080;
pub const HV_SYS_REG_MAIR_EL1: hv_sys_reg_t = 50448;
pub const HV_SYS_REG_AMAIR_EL1: hv_sys_reg_t = 50456;
pub const HV_SYS_REG_VBAR_EL1: hv_sys_reg_t = 50688;
pub const HV_SYS_REG_CONTEXTIDR_EL1: hv_sys_reg_t = 50817;
pub const HV_SYS_REG_TPIDR_EL1: hv_sys_reg_t = 50820;
pub const HV_SYS_REG_CNTKCTL_EL1: hv_sys_reg_t = 50952;
pub const HV_SYS_REG_CSSELR_EL1: hv_sys_reg_t = 53248;
pub const HV_SYS_REG_TPIDR_EL0: hv_sys_reg_t = 56962;
pub const HV_SYS_REG_TPIDRRO_EL0: hv_sys_reg_t = 56963;
pub const HV_SYS_REG_CNTV_CTL_EL0: hv_sys_reg_t = 57113;
pub const HV_SYS_REG_CNTV_CVAL_EL0: hv_sys_reg_t = 57114;
pub const HV_SYS_REG_SP_EL1: hv_sys_reg_t = 57864;
pub type hv_sys_reg_t = u16;
pub const HV_INTERRUPT_TYPE_IRQ: hv_interrupt_type_t = 0;
pub const HV_INTERRUPT_TYPE_FIQ: hv_interrupt_type_t = 1;
pub type hv_interrupt_type_t = u32;
pub const HV_CACHE_TYPE_DATA: hv_cache_type_t = 0;
pub const HV_CACHE_TYPE_INSTRUCTION: hv_cache_type_t = 1;
pub type hv_cache_type_t = u32;
extern "C" {
#[doc = " @function hv_vcpu_create"]
#[doc = " @abstract Creates a vCPU instance for the current thread"]
#[doc = " @param vcpu Pointer to the ID of the vCPU instance (written on success)"]
#[doc = " @param exit Pointer to pointer to the vcpu exit information"]
#[doc = " (written on success)"]
#[doc = " @param config Configuration."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion Each thread can only have one vCPU associated at a time."]
pub fn hv_vcpu_create(
vcpu: *mut hv_vcpu_t,
exit: *mut *mut hv_vcpu_exit_t,
config: hv_vcpu_config_t,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_destroy"]
#[doc = " @abstract Destroys the vCPU instance associated with the current thread"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_destroy(vcpu: hv_vcpu_t) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_reg"]
#[doc = " @abstract Returns the current value of a vCPU register."]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the register."]
#[doc = " @param value Pointer to the register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_get_reg(vcpu: hv_vcpu_t, reg: hv_reg_t, value: *mut u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_reg"]
#[doc = " @abstract Sets the value of a vCPU register."]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the register."]
#[doc = " @param value The register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_set_reg(vcpu: hv_vcpu_t, reg: hv_reg_t, value: u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_simd_fp_reg"]
#[doc = " @abstract Returns the current value of a vCPU SIMD&FP register"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the SIMD&FP register."]
#[doc = " @param value Pointer to the register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_get_simd_fp_reg(
vcpu: hv_vcpu_t,
reg: hv_simd_fp_reg_t,
value: *mut hv_simd_fp_uchar16_t,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_simd_fp_reg"]
#[doc = " @abstract Sets the value of a vCPU SIMD&FP register"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the register."]
#[doc = " @param value The register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_set_simd_fp_reg(
vcpu: hv_vcpu_t,
reg: hv_simd_fp_reg_t,
value: hv_simd_fp_uchar16_t,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_sys_reg"]
#[doc = " @abstract Returns the current value of a vCPU system register"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the system register."]
#[doc = " @param value Pointer to the system register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_get_sys_reg(vcpu: hv_vcpu_t, reg: hv_sys_reg_t, value: *mut u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_sys_reg"]
#[doc = " @abstract Sets the value of a vCPU system register"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @param reg ID of the system register."]
#[doc = " @param value The system register value."]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_set_sys_reg(vcpu: hv_vcpu_t, reg: hv_sys_reg_t, value: u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_pending_interrupt."]
#[doc = " @abstract Gets pending interrupts for a vcpu."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param type Interrupt type."]
#[doc = " @param pending Returns whether the interrupt is pending or not."]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
pub fn hv_vcpu_get_pending_interrupt(
vcpu: hv_vcpu_t,
type_: hv_interrupt_type_t,
pending: *mut bool,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_pending_interrupt."]
#[doc = " @abstract Sets pending interrupts for a vcpu."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param type Interrupt type."]
#[doc = " @param pending Whether the interrupt is pending or not."]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
#[doc = " The pending interrupts automatically cleared after hv_vcpu_run returns. It is expected that"]
#[doc = " hv_vcpu_set_pending_interrupt be called before every hv_vcpu_run to set pending interrupts."]
pub fn hv_vcpu_set_pending_interrupt(
vcpu: hv_vcpu_t,
type_: hv_interrupt_type_t,
pending: bool,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_trap_debug_exceptions."]
#[doc = " @abstract Get whether debug exceptions in the guest are trapped to the host."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param value Pointer to the result."]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
pub fn hv_vcpu_get_trap_debug_exceptions(vcpu: hv_vcpu_t, value: *mut bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_trap_debug_exceptions."]
#[doc = " @abstract Set whether debug exceptions in the guest are trapped to the host."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param value If true, debug exceptions in the guest are trapped to the host"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
pub fn hv_vcpu_set_trap_debug_exceptions(vcpu: hv_vcpu_t, value: bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_trap_debug_reg_accesses."]
#[doc = " @abstract Get whether debug register accesses in the guest are trapped to the host."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param value Pointer to the result."]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
#[doc = " This includes the DBGBCR<n>_EL1, DBGBVR<n>_EL1, DBGWCR<n>_EL1,"]
#[doc = " DBGWVR<n>_EL1 and MDSCR_EL1 registers."]
pub fn hv_vcpu_get_trap_debug_reg_accesses(vcpu: hv_vcpu_t, value: *mut bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_trap_debug_reg_accesses."]
#[doc = " @abstract Set whether debug register accesses in the guest are trapped to the host."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param value If true, debug register accesses in the guest are trapped to the host."]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread."]
#[doc = " This includes the DBGBCR<n>_EL1, DBGBVR<n>_EL1, DBGWCR<n>_EL1,"]
#[doc = " DBGWVR<n>_EL1 and MDSCR_EL1 registers."]
pub fn hv_vcpu_set_trap_debug_reg_accesses(vcpu: hv_vcpu_t, value: bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_run"]
#[doc = " @abstract Executes a vCPU"]
#[doc = " @param vcpu ID of the vCPU instance"]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Call blocks until the next exit from the vCPU or the"]
#[doc = " execution is canceled using hv_vcpus_exit."]
#[doc = ""]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_run(vcpu: hv_vcpu_t) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpus_exit"]
#[doc = " @abstract Forces an immediate exit of a set of vcpus of the VM."]
#[doc = " @param vcpus Pointer to a list of vcpu IDs"]
#[doc = " @param vcpu_count Number of vcpus in the list"]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " If a vcpu is not running, the next time hv_vcpu_run is called for the corresponding"]
#[doc = " vcpu, it will return immediately without entering the guest."]
pub fn hv_vcpus_exit(vcpus: *mut hv_vcpu_t, vcpu_count: u32) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_exec_time"]
#[doc = " @abstract Returns the cumulative execution time of a vCPU in units of"]
#[doc = " mach_absolute_time()"]
#[doc = " @param vcpu vCPU ID"]
#[doc = " @param time Pointer to execution time value (written on success)"]
#[doc = " @result 0 on success or error code"]
#[doc = " @discussion"]
#[doc = " Must be called by the owning thread"]
pub fn hv_vcpu_get_exec_time(vcpu: hv_vcpu_t, time: *mut u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_vtimer_mask"]
#[doc = " @abstract Gets the VTimer mask."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param vtimer_is_masked Value of the mask."]
#[doc = " @result 0 on success or error code."]
pub fn hv_vcpu_get_vtimer_mask(vcpu: hv_vcpu_t, vtimer_is_masked: *mut bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_vtimer_mask"]
#[doc = " @abstract Sets the VTimer mask."]
#[doc = " @param vcpu ID of the vcpu instance."]
#[doc = " @param vtimer_is_masked New value of the mask."]
#[doc = " @result 0 on success or error code."]
#[doc = " @discussion"]
#[doc = " When the mask is set, the vCPU does not exit if the VTimer times out."]
#[doc = ""]
#[doc = " After hv_vcpu_run() returns with the exit reason"]
#[doc = " HV_EXIT_REASON_VTIMER_ACTIVATED, the timer is masked automatically."]
#[doc = " The vCPU will not exit with this reason again until the masked is cleared"]
#[doc = " even when hv_vcpu_run() is called with the VTimer interrupt in a"]
#[doc = " pending state."]
#[doc = ""]
#[doc = " After receiving a HV_EXIT_REASON_VTIMER_ACTIVATED exit reason,"]
#[doc = " the caller of hv_vcpu_run() is expected to make the interrupt"]
#[doc = " corresponding to the VTimer pending in the guest's virtual"]
#[doc = " interrupt controller and to be able to detect when"]
#[doc = " the guest has completed servicing this interrupt. For example,"]
#[doc = " when emulating a GIC, this function should be called when"]
#[doc = " deactivating an interrupt whose ID matches that of the VTimer."]
pub fn hv_vcpu_set_vtimer_mask(vcpu: hv_vcpu_t, vtimer_is_masked: bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_vtimer_offset"]
#[doc = " @abstract Gets the VTimer offset."]
#[doc = " @param vcpu ID of the vCPU instance."]
#[doc = " @param vtimer_offset Pointer to VTimer offset. (Written on success)."]
#[doc = " @result 0 on success or error code."]
#[doc = " @discussion"]
#[doc = " This corresponds to the CNTVOFF_EL2 register."]
pub fn hv_vcpu_get_vtimer_offset(vcpu: hv_vcpu_t, vtimer_offset: *mut u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_set_vtimer_offset"]
#[doc = " @abstract Sets the VTimer offset."]
#[doc = " @param vcpu ID of the vCPU instance."]
#[doc = " @param vtimer_offset New VTimer offset."]
#[doc = " @result 0 on success or error code."]
#[doc = " @discussion"]
#[doc = " This corresponds to the CNTVOFF_EL2 register."]
pub fn hv_vcpu_set_vtimer_offset(vcpu: hv_vcpu_t, vtimer_offset: u64) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_config_create"]
#[doc = " @abstract Creates a vcpu configuration object."]
#[doc = " @result A new vcpu configuration object. This should be released with os_release"]
#[doc = " when no longer used."]
pub fn hv_vcpu_config_create() -> hv_vcpu_config_t;
}
pub const HV_FEATURE_REG_ID_AA64DFR0_EL1: hv_feature_reg_t = 0;
pub const HV_FEATURE_REG_ID_AA64DFR1_EL1: hv_feature_reg_t = 1;
pub const HV_FEATURE_REG_ID_AA64ISAR0_EL1: hv_feature_reg_t = 2;
pub const HV_FEATURE_REG_ID_AA64ISAR1_EL1: hv_feature_reg_t = 3;
pub const HV_FEATURE_REG_ID_AA64MMFR0_EL1: hv_feature_reg_t = 4;
pub const HV_FEATURE_REG_ID_AA64MMFR1_EL1: hv_feature_reg_t = 5;
pub const HV_FEATURE_REG_ID_AA64MMFR2_EL1: hv_feature_reg_t = 6;
pub const HV_FEATURE_REG_ID_AA64PFR0_EL1: hv_feature_reg_t = 7;
pub const HV_FEATURE_REG_ID_AA64PFR1_EL1: hv_feature_reg_t = 8;
pub const HV_FEATURE_REG_CTR_EL0: hv_feature_reg_t = 9;
pub const HV_FEATURE_REG_CLIDR_EL1: hv_feature_reg_t = 10;
pub const HV_FEATURE_REG_DCZID_EL0: hv_feature_reg_t = 11;
pub type hv_feature_reg_t = u32;
extern "C" {
#[doc = " @function hv_vcpu_config_get_feature_reg"]
#[doc = " @abstract For a vcpu configuration, return the given feature register value."]
#[doc = " @param config Configuration."]
#[doc = " @param feature_reg The feature register."]
#[doc = " @param value Pointer to the feature register value."]
#[doc = " @result 0 on success or error code."]
pub fn hv_vcpu_config_get_feature_reg(
config: hv_vcpu_config_t,
feature_reg: hv_feature_reg_t,
value: *mut u64,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_config_get_ccs_idr_el1_sys_reg"]
#[doc = " @abstract For a vcpu configuration, return the given CCSIDR_EL1 values for a given cache type"]
#[doc = " @param config Configuration."]
#[doc = " @param cache_type The cache type."]
#[doc = " @param value Pointer to the CCSIDR_EL1 register values."]
#[doc = " @result 0 on success or error code."]
pub fn hv_vcpu_config_get_ccsidr_el1_sys_reg_values(
config: hv_vcpu_config_t,
cache_type: hv_cache_type_t,
values: *mut u64,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_get_max_vcpu_count"]
#[doc = " @abstract Return the max number of vcpus supported."]
#[doc = " @param max_vcpu_count pointer to the max vcpu count."]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_get_max_vcpu_count(max_vcpu_count: *mut u32) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_create"]
#[doc = " @abstract Creates a VM instance for the current process."]
#[doc = " @param config Configuration. Pass NULL for the default configuration."]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_create(config: hv_vm_config_t) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_destroy"]
#[doc = " @abstract Destroys the VM instance associated with the current process."]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_destroy() -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_map"]
#[doc = " @abstract Maps a region in the virtual address space of the current process"]
#[doc = " into the guest physical address space of the VM."]
#[doc = " @param addr Page aligned virtual address in the current process"]
#[doc = " @param ipa Page aligned address in the guest physical address space"]
#[doc = " @param size Size in bytes of the region to be mapped (must be a multiple of the page size)"]
#[doc = " @param flags READ, WRITE and EXECUTE permissions of the region"]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_map(
addr: *mut ::std::os::raw::c_void,
ipa: hv_ipa_t,
size: size_t,
flags: hv_memory_flags_t,
) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_unmap"]
#[doc = " @abstract Unmaps a region in the guest physical address space of the VM."]
#[doc = " @param ipa Page aligned address in the guest physical address space"]
#[doc = " @param size Size in bytes of the region to be unmapped (must be a multiple of the page size)"]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_unmap(ipa: hv_ipa_t, size: size_t) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vm_protect"]
#[doc = " @abstract Modifies the permissions of a region in the guest physical"]
#[doc = " address space of the VM."]
#[doc = " @param ipa Page aligned address in the guest physical address space"]
#[doc = " @param size Size in bytes of the region to be modified (must be a multiple of the page size)"]
#[doc = " @param flags New READ, WRITE and EXECUTE permissions of the region"]
#[doc = " @result 0 on success or error code"]
pub fn hv_vm_protect(ipa: hv_ipa_t, size: size_t, flags: hv_memory_flags_t) -> hv_return_t;
}
pub type __builtin_va_list = *mut ::std::os::raw::c_char;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment