mshv_bindings/
lib.rs

1// Copyright © 2020, Microsoft Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
4//
5
6#[cfg(target_arch = "x86_64")]
7#[macro_use]
8#[cfg(feature = "fam-wrappers")]
9extern crate vmm_sys_util;
10
11#[cfg(target_arch = "x86_64")]
12mod x86_64;
13#[cfg(target_arch = "x86_64")]
14pub use self::x86_64::*;
15
16#[cfg(target_arch = "aarch64")]
17mod arm64;
18#[cfg(target_arch = "aarch64")]
19pub use self::arm64::*;
20
21pub mod hvdef;
22pub use hvdef::*;
23
24pub mod hvcall;
25pub use hvcall::*;
26
27#[derive(Debug)]
28pub struct RegisterPage(pub *mut hv_vp_register_page);
29
30// SAFETY: struct is based on register page in the hypervisor,
31// safe to Send across threads
32unsafe impl Send for RegisterPage {}
33
34// SAFETY: struct is based on Register page in the hypervisor,
35// safe to Sync across threads as this is only required for Vcpu trait
36// functionally not used anyway
37unsafe impl Sync for RegisterPage {}