use crate::{const_helpers::u32_into_usize, sys};
mod arch;
mod invocations;
mod object;
mod vm_attributes;
mod vspace;
pub(crate) mod fault;
pub(crate) mod top_level {
pub use super::{
arch::top_level::*,
object::{ObjectBlueprintArch, ObjectBlueprintArm, ObjectTypeArch, ObjectTypeArm},
vm_attributes::VmAttributes,
vspace::{FrameObjectType, TranslationTableObjectType},
NUM_FAST_MESSAGE_REGISTERS,
};
}
pub(crate) use vspace::vspace_levels;
pub const NUM_FAST_MESSAGE_REGISTERS: usize = u32_into_usize(sys::seL4_FastMessageRegisters);
pub(crate) mod cap_type_arch {
use crate::{declare_cap_type_for_object_of_fixed_size, sel4_cfg};
#[sel4_cfg(ARM_HYPERVISOR_SUPPORT)]
declare_cap_type_for_object_of_fixed_size! {
VCpu { ObjectTypeArch, ObjectBlueprintArch }
}
declare_cap_type_for_object_of_fixed_size! {
SmallPage { ObjectTypeArch, ObjectBlueprintArch }
}
declare_cap_type_for_object_of_fixed_size! {
LargePage { ObjectTypeArch, ObjectBlueprintArch }
}
#[sel4_cfg(ARCH_AARCH64)]
declare_cap_type_for_object_of_fixed_size! {
HugePage { ObjectTypeSeL4Arch, ObjectBlueprintSeL4Arch }
}
#[sel4_cfg(ARCH_AARCH32)]
declare_cap_type_for_object_of_fixed_size! {
Section { ObjectTypeSeL4Arch, ObjectBlueprintSeL4Arch }
}
#[sel4_cfg(ARCH_AARCH64)]
declare_cap_type_for_object_of_fixed_size! {
VSpace { ObjectTypeSeL4Arch, ObjectBlueprintSeL4Arch }
}
#[sel4_cfg(ARCH_AARCH32)]
declare_cap_type_for_object_of_fixed_size! {
PD { ObjectTypeSeL4Arch, ObjectBlueprintSeL4Arch }
}
declare_cap_type_for_object_of_fixed_size! {
PT { ObjectTypeArch, ObjectBlueprintArch }
}
pub type Granule = SmallPage;
#[sel4_cfg(ARCH_AARCH32)]
pub type VSpace = PD;
}
pub(crate) mod cap_arch {
use crate::{declare_cap_alias, sel4_cfg};
#[sel4_cfg(ARM_HYPERVISOR_SUPPORT)]
declare_cap_alias!(VCpu);
declare_cap_alias!(SmallPage);
declare_cap_alias!(LargePage);
#[sel4_cfg(ARCH_AARCH64)]
declare_cap_alias!(HugePage);
#[sel4_cfg(ARCH_AARCH32)]
declare_cap_alias!(PD);
declare_cap_alias!(PT);
}