pub trait PagingConstsTrait: Debug + Sync {
Show 14 methods
// Required methods
spec fn BASE_PAGE_SIZE_spec() -> usize;
proof fn lemma_BASE_PAGE_SIZE_properties();
exec fn BASE_PAGE_SIZE() -> res : usize;
spec fn NR_LEVELS_spec() -> PagingLevel;
exec fn NR_LEVELS() -> res : PagingLevel;
spec fn HIGHEST_TRANSLATION_LEVEL_spec() -> PagingLevel;
exec fn HIGHEST_TRANSLATION_LEVEL() -> res : PagingLevel;
spec fn PTE_SIZE_spec() -> usize;
exec fn PTE_SIZE() -> res : usize;
proof fn lemma_PTE_SIZE_properties();
spec fn ADDRESS_WIDTH_spec() -> usize;
exec fn ADDRESS_WIDTH() -> res : usize;
spec fn VA_SIGN_EXT_spec() -> bool;
exec fn VA_SIGN_EXT() -> bool;
}Required Methods§
Sourcespec fn BASE_PAGE_SIZE_spec() -> usize
spec fn BASE_PAGE_SIZE_spec() -> usize
Sourceproof fn lemma_BASE_PAGE_SIZE_properties()
proof fn lemma_BASE_PAGE_SIZE_properties()
0 < Self::BASE_PAGE_SIZE_spec(),is_pow2(Self::BASE_PAGE_SIZE_spec() as int),Sourceexec fn BASE_PAGE_SIZE() -> res : usize
exec fn BASE_PAGE_SIZE() -> res : usize
res == Self::BASE_PAGE_SIZE_spec(),0 < res,is_pow2(res as int),The smallest page size. This is also the page size at level 1 page tables.
Sourcespec fn NR_LEVELS_spec() -> PagingLevel
spec fn NR_LEVELS_spec() -> PagingLevel
Sourceexec fn NR_LEVELS() -> res : PagingLevel
exec fn NR_LEVELS() -> res : PagingLevel
res == Self::NR_LEVELS_spec(),res > 0,The number of levels in the page table. The numbering of levels goes from deepest node to the root node. For example, the level 1 to 5 on AMD64 corresponds to Page Tables, Page Directory Tables, Page Directory Pointer Tables, Page-Map Level-4 Table, and Page-Map Level-5 Table, respectively.
Sourcespec fn HIGHEST_TRANSLATION_LEVEL_spec() -> PagingLevel
spec fn HIGHEST_TRANSLATION_LEVEL_spec() -> PagingLevel
Sourceexec fn HIGHEST_TRANSLATION_LEVEL() -> res : PagingLevel
exec fn HIGHEST_TRANSLATION_LEVEL() -> res : PagingLevel
res == Self::HIGHEST_TRANSLATION_LEVEL_spec(),The highest level that a PTE can be directly used to translate a VA. This affects the the largest page size supported by the page table.
Sourcespec fn PTE_SIZE_spec() -> usize
spec fn PTE_SIZE_spec() -> usize
Sourceexec fn PTE_SIZE() -> res : usize
exec fn PTE_SIZE() -> res : usize
res == Self::PTE_SIZE_spec(),is_pow2(res as int),0 < res <= Self::BASE_PAGE_SIZE(),The size of a PTE.
Sourceproof fn lemma_PTE_SIZE_properties()
proof fn lemma_PTE_SIZE_properties()
0 < Self::PTE_SIZE_spec() <= Self::BASE_PAGE_SIZE(),is_pow2(Self::PTE_SIZE_spec() as int),Sourcespec fn ADDRESS_WIDTH_spec() -> usize
spec fn ADDRESS_WIDTH_spec() -> usize
Sourceexec fn ADDRESS_WIDTH() -> res : usize
exec fn ADDRESS_WIDTH() -> res : usize
res == Self::ADDRESS_WIDTH_spec(),The address width may be BASE_PAGE_SIZE.ilog2() + NR_LEVELS * IN_FRAME_INDEX_BITS. If it is shorter than that, the higher bits in the highest level are ignored.
Sourcespec fn VA_SIGN_EXT_spec() -> bool
spec fn VA_SIGN_EXT_spec() -> bool
Whether virtual addresses are sign-extended.
The sign bit of a Vaddr is the bit at index PagingConstsTrait::ADDRESS_WIDTH - 1.
If this constant is true, bits in Vaddr that are higher than the sign bit must be
equal to the sign bit. If an address violates this rule, both the hardware and OSTD
should reject it.
Otherwise, if this constant is false, higher bits must be zero.
Regardless of sign extension, Vaddr is always not signed upon calculation.
That means, 0xffff_ffff_ffff_0000 < 0xffff_ffff_ffff_0001 is true.
Sourceexec fn VA_SIGN_EXT() -> bool
exec fn VA_SIGN_EXT() -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.