1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
use core::ffi::c_void;
pub mod types;
use types::*;
extern "C" {
pub fn hv_vm_create(config: hv_vm_config_t) -> hv_return_t;
pub fn hv_vm_destroy() -> hv_return_t;
pub fn hv_vm_map(
address: *mut c_void,
ipa: hv_ipa_t,
size: usize,
flags: hv_memory_flags_t,
) -> hv_return_t;
pub fn hv_vm_unmap(ipa: hv_ipa_t, size: usize) -> hv_return_t;
pub fn hv_vm_protect(ipa: hv_ipa_t, size: usize, flags: hv_memory_flags_t) -> hv_return_t;
pub fn hv_vcpu_config_create() -> hv_vcpu_config_t;
pub fn hv_vcpu_config_get_feature_reg(
config: hv_vcpu_config_t,
feature_register: hv_feature_reg_t,
value: *mut u64,
) -> hv_return_t;
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;
pub fn hv_vcpu_create(
vcpu: *mut hv_vcpu_t,
exit: *mut *const hv_vcpu_exit_t,
config: *const hv_vcpu_config_t,
) -> hv_return_t;
pub fn hv_vcpu_destroy(vcpu: hv_vcpu_t) -> hv_return_t;
pub fn hv_vcpu_get_reg(vcpu: hv_vcpu_t, reg: hv_reg_t, value: *mut u64) -> hv_return_t;
pub fn hv_vcpu_set_reg(vcpu: hv_vcpu_t, reg: hv_reg_t, value: u64) -> hv_return_t;
pub fn hv_vcpu_get_sys_reg(vcpu: hv_vcpu_t, reg: hv_sys_reg_t, value: *mut u64) -> hv_return_t;
pub fn hv_vcpu_set_sys_reg(vcpu: hv_vcpu_t, reg: hv_sys_reg_t, value: u64) -> hv_return_t;
pub fn hv_vcpu_get_pending_interrupt(
vcpu: hv_vcpu_t,
interrupt: hv_interrupt_type_t,
pending: *mut bool,
) -> hv_return_t;
pub fn hv_vcpu_set_pending_interrupt(
vcpu: hv_vcpu_t,
interrupt: hv_interrupt_type_t,
pending: bool,
) -> hv_return_t;
pub fn hv_vcpu_get_trap_debug_exceptions(vcpu: hv_vcpu_t, value: *mut bool) -> hv_return_t;
pub fn hv_vcpu_set_trap_debug_exceptions(vcpu: hv_vcpu_t, value: bool) -> hv_return_t;
pub fn hv_vcpu_get_trap_debug_reg_accesses(vcpu: hv_vcpu_t, value: *mut bool) -> hv_return_t;
pub fn hv_vcpu_set_trap_debug_reg_accesses(vcpu: hv_vcpu_t, value: bool) -> hv_return_t;
pub fn hv_vcpu_run(vcpu: hv_vcpu_t) -> hv_return_t;
pub fn hv_vcpus_exit(vcpus: *const hv_vcpu_t, vcpu_count: u32) -> hv_return_t;
pub fn hv_vcpu_get_exec_time(vcpu: hv_vcpu_t, time: *mut u64) -> hv_return_t;
pub fn hv_vcpu_get_vtimer_mask(vcpu: hv_vcpu_t, vtimer_is_masked: *mut bool) -> hv_return_t;
pub fn hv_vcpu_set_vtimer_mask(vcpu: hv_vcpu_t, vtimer_is_masked: bool) -> hv_return_t;
pub fn hv_vcpu_get_vtimer_offset(vcpu: hv_vcpu_t, vtimer_offset: *mut u64) -> hv_return_t;
pub fn hv_vcpu_set_vtimer_offset(vcpu: hv_vcpu_t, vtimer_offset: u64) -> hv_return_t;
}