sel4/arch/x86/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
// Copyright 2023, Colias Group, LLC
//
// SPDX-License-Identifier: MIT
//

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, ObjectBlueprintX86, ObjectTypeArch, ObjectTypeX86},
        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, declare_cap_type_for_object_of_fixed_size};

    declare_cap_type_for_object_of_fixed_size!(_4k {
        ObjectTypeArch,
        ObjectBlueprintArch
    });
    declare_cap_type_for_object_of_fixed_size!(LargePage {
        ObjectTypeArch,
        ObjectBlueprintArch
    });
    declare_cap_type_for_object_of_fixed_size!(HugePage {
        ObjectTypeSeL4Arch,
        ObjectBlueprintSeL4Arch
    });

    declare_cap_type_for_object_of_fixed_size!(PML4 {
        ObjectTypeSeL4Arch,
        ObjectBlueprintSeL4Arch
    });
    declare_cap_type_for_object_of_fixed_size!(PDPT {
        ObjectTypeSeL4Arch,
        ObjectBlueprintSeL4Arch
    });
    declare_cap_type_for_object_of_fixed_size!(PageDirectory {
        ObjectTypeArch,
        ObjectBlueprintArch
    });
    declare_cap_type_for_object_of_fixed_size!(PageTable {
        ObjectTypeArch,
        ObjectBlueprintArch
    });

    pub type VSpace = PML4;
    pub type Granule = _4k;

    declare_cap_type!(IOPortControl);
}

pub(crate) mod cap_arch {
    use crate::declare_cap_alias;

    declare_cap_alias!(_4k);
    declare_cap_alias!(LargePage);
    declare_cap_alias!(HugePage);

    declare_cap_alias!(PML4);
    declare_cap_alias!(PDPT);
    declare_cap_alias!(PageDirectory);
    declare_cap_alias!(PageTable);

    declare_cap_alias!(IOPortControl);
}