sel4/arch/arm/arch/aarch64/
object.rs1use core::ffi::c_uint;
8
9use crate::{const_helpers::u32_into_usize, sys};
10
11pub type ObjectTypeSeL4Arch = ObjectTypeAArch64;
13
14pub type ObjectBlueprintSeL4Arch = ObjectBlueprintAArch64;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq)]
19pub enum ObjectTypeAArch64 {
20 HugePage,
21 VSpace,
22}
23
24impl ObjectTypeAArch64 {
25 pub(crate) const fn into_sys(self) -> c_uint {
26 match self {
27 Self::HugePage => sys::_mode_object::seL4_ARM_HugePageObject,
28 Self::VSpace => sys::_mode_object::seL4_ARM_VSpaceObject,
29 }
30 }
31}
32
33#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
35pub enum ObjectBlueprintAArch64 {
36 HugePage,
37 VSpace,
38}
39
40impl ObjectBlueprintAArch64 {
41 pub(crate) const fn ty(self) -> ObjectTypeAArch64 {
42 match self {
43 Self::HugePage => ObjectTypeAArch64::HugePage,
44 Self::VSpace => ObjectTypeAArch64::VSpace,
45 }
46 }
47
48 pub(crate) const fn physical_size_bits(self) -> usize {
49 match self {
50 Self::HugePage => u32_into_usize(sys::seL4_HugePageBits),
51 Self::VSpace => u32_into_usize(sys::seL4_VSpaceBits),
52 }
53 }
54}