Skip to main content

islet_rmm/realm/mm/
attribute.rs

1pub mod shareable {
2    pub const NON_SHAREABLE: u64 = 0b00;
3    pub const RESERVED: u64 = 0b01;
4    pub const OUTER: u64 = 0b10;
5    pub const INNER: u64 = 0b11;
6}
7
8pub mod permission {
9    pub const RW: u64 = 0b11;
10    pub const WO: u64 = 0b10;
11    pub const RO: u64 = 0b01;
12    pub const NONE: u64 = 0b00;
13}
14
15// MemAttr[3:2]:
16//      0b01 - Normal, Outer Non-cacheable
17//      0b10 - Normal, Outer Write-Through Cacheable
18//      0b10 - Normal, Outer Write-Back Cacheable
19// MemAttr[1:0]: if MemAttr[3:2] != 0b00
20//      0b01 - Inner Non-cacheable
21//      0b10 - Inner Write-Through Cacheable
22//      0b11 - Inner Write-Back Cacheable
23// MemAttr[1:0]: if MemAttr[3:2] == 0b00
24//      0b00 - Device-nGnRnE
25//      0b01 - Device-nGnRE
26//      0b10 - Device-nGRE
27//      0b11 - Device-GRE
28pub mod memattr {
29    pub const NORMAL_FWB: u64 = 0b0110;
30    pub const NORMAL: u64 = 0b0111;
31    pub const NORMAL_NC: u64 = 0b0101;
32    pub const FWB_RESERVED: u64 = 0b0100;
33    pub const DEVICE_NGNRE: u64 = 0b0001;
34}
35
36pub mod page_type {
37    pub const BLOCK: u64 = 0b0;
38    pub const TABLE_OR_PAGE: u64 = 0b1;
39}
40
41pub mod desc_type {
42    pub const L012_TABLE: u64 = 0x3;
43    pub const L012_BLOCK: u64 = 0x1;
44    pub const L3_PAGE: u64 = 0x3;
45    pub const LX_INVALID: u64 = 0x0;
46}