#![doc(
html_favicon_url = "https://media.githubusercontent.com/media/hermit-os/uhyve/main/img/uhyve_128.png"
)]
#![doc(
html_logo_url = "https://media.githubusercontent.com/media/hermit-os/uhyve/main/img/uhyve_512.png"
)]
#![cfg_attr(not(feature = "std"), no_std)]
macro_rules! into_hypercall_addresses {
(@internal $Self:ty; $name1:ident => $name2:ident) => { <$Self>::$name2 };
(@internal $Self:ty; $name1:ident) => { <$Self>::$name1 };
(
impl From<$hc:ident> for $hca:ty {
match {
$( $name1:ident $(=> $name2:ident)? ),*
$(,)?
}
}
) => {
impl From<$hc<'_>> for $hca {
fn from(value: $hc<'_>) -> Self {
match value {
$($hc::$name1 { .. } => into_hypercall_addresses!(@internal Self; $name1 $(=> $name2)?)),*
}
}
}
impl From<&$hc<'_>> for $hca {
fn from(value: &$hc<'_>) -> Self {
match value {
$($hc::$name1 { .. } => into_hypercall_addresses!(@internal Self; $name1 $(=> $name2)?)),*
}
}
}
}
}
mod parameters;
pub mod v1;
pub mod v2;
pub use memory_addresses::{PhysAddr as GuestPhysAddr, VirtAddr as GuestVirtAddr};
#[cfg(not(target_pointer_width = "64"))]
compile_error!("Using uhyve-interface on a non-64-bit system is not (yet?) supported");
pub const UHYVE_INTERFACE_VERSION: u32 = 3;