sel4/arch/x86/
mod.rs

1//
2// Copyright 2023, Colias Group, LLC
3//
4// SPDX-License-Identifier: MIT
5//
6
7use crate::{const_helpers::u32_into_usize, sys};
8
9mod arch;
10mod invocations;
11mod object;
12mod vm_attributes;
13mod vspace;
14
15pub(crate) mod fault;
16
17pub(crate) mod top_level {
18    pub use super::{
19        arch::top_level::*,
20        object::{ObjectBlueprintArch, ObjectBlueprintX86, ObjectTypeArch, ObjectTypeX86},
21        vm_attributes::VmAttributes,
22        vspace::{FrameObjectType, TranslationTableObjectType},
23        NUM_FAST_MESSAGE_REGISTERS,
24    };
25}
26
27pub(crate) use vspace::vspace_levels;
28
29pub const NUM_FAST_MESSAGE_REGISTERS: usize = u32_into_usize(sys::seL4_FastMessageRegisters);
30
31pub(crate) mod cap_type_arch {
32    use crate::{declare_cap_type, declare_cap_type_for_object_of_fixed_size};
33
34    declare_cap_type_for_object_of_fixed_size!(_4k {
35        ObjectTypeArch,
36        ObjectBlueprintArch
37    });
38    declare_cap_type_for_object_of_fixed_size!(LargePage {
39        ObjectTypeArch,
40        ObjectBlueprintArch
41    });
42    declare_cap_type_for_object_of_fixed_size!(HugePage {
43        ObjectTypeSeL4Arch,
44        ObjectBlueprintSeL4Arch
45    });
46
47    declare_cap_type_for_object_of_fixed_size!(PML4 {
48        ObjectTypeSeL4Arch,
49        ObjectBlueprintSeL4Arch
50    });
51    declare_cap_type_for_object_of_fixed_size!(PDPT {
52        ObjectTypeSeL4Arch,
53        ObjectBlueprintSeL4Arch
54    });
55    declare_cap_type_for_object_of_fixed_size!(PageDirectory {
56        ObjectTypeArch,
57        ObjectBlueprintArch
58    });
59    declare_cap_type_for_object_of_fixed_size!(PageTable {
60        ObjectTypeArch,
61        ObjectBlueprintArch
62    });
63
64    pub type VSpace = PML4;
65    pub type Granule = _4k;
66
67    declare_cap_type!(IOPortControl);
68}
69
70pub(crate) mod cap_arch {
71    use crate::declare_cap_alias;
72
73    declare_cap_alias!(_4k);
74    declare_cap_alias!(LargePage);
75    declare_cap_alias!(HugePage);
76
77    declare_cap_alias!(PML4);
78    declare_cap_alias!(PDPT);
79    declare_cap_alias!(PageDirectory);
80    declare_cap_alias!(PageTable);
81
82    declare_cap_alias!(IOPortControl);
83}