sel4/arch/riscv/
mod.rs

1//
2// Copyright 2023, Colias Group, LLC
3//
4// SPDX-License-Identifier: MIT
5//
6
7mod invocations;
8mod object;
9mod user_context;
10mod vm_attributes;
11mod vspace;
12
13pub(crate) mod fault;
14
15pub(crate) mod top_level {
16    pub use super::{
17        object::{ObjectBlueprintArch, ObjectBlueprintRiscV, ObjectTypeArch, ObjectTypeRISCV},
18        user_context::UserContext,
19        vm_attributes::VmAttributes,
20        vspace::{FrameObjectType, TranslationTableObjectType},
21        NUM_FAST_MESSAGE_REGISTERS,
22    };
23}
24
25pub(crate) use vspace::vspace_levels;
26
27pub const NUM_FAST_MESSAGE_REGISTERS: usize = 4;
28
29pub(crate) mod cap_type_arch {
30    use crate::declare_cap_type_for_object_of_fixed_size;
31
32    declare_cap_type_for_object_of_fixed_size!(_4kPage {
33        ObjectTypeArch,
34        ObjectBlueprintArch
35    });
36    declare_cap_type_for_object_of_fixed_size!(MegaPage {
37        ObjectTypeArch,
38        ObjectBlueprintArch
39    });
40
41    #[sel4_config::sel4_cfg(any(PT_LEVELS = "3", PT_LEVELS = "4"))]
42    declare_cap_type_for_object_of_fixed_size!(GigaPage {
43        ObjectTypeArch,
44        ObjectBlueprintArch
45    });
46
47    declare_cap_type_for_object_of_fixed_size!(PageTable {
48        ObjectTypeArch,
49        ObjectBlueprintArch
50    });
51
52    pub type VSpace = PageTable;
53    pub type Granule = _4kPage;
54}
55
56pub(crate) mod cap_arch {
57    use crate::declare_cap_alias;
58
59    declare_cap_alias!(_4kPage);
60    declare_cap_alias!(MegaPage);
61
62    #[sel4_config::sel4_cfg(any(PT_LEVELS = "3", PT_LEVELS = "4"))]
63    declare_cap_alias!(GigaPage);
64
65    declare_cap_alias!(PageTable);
66}