pub enum ChildRef<'a, C: PageTableConfig> {
PageTable(PageTableNodeRef<'a, C>),
Frame(Paddr, PagingLevel, PageProperty),
None,
}Expand description
A reference to the child of a page table node.
Variants§
PageTable(PageTableNodeRef<'a, C>)
A child page table node.
Frame(Paddr, PagingLevel, PageProperty)
Physical address of a mapped physical frame.
It is associated with the virtual page property and the level of the mapping node, which decides the size of the frame.
None
Implementations§
Source§impl<'a, C: PageTableConfig> ChildRef<'a, C>
impl<'a, C: PageTableConfig> ChildRef<'a, C>
pub fn arrow_1(self) -> PagingLevel
pub fn arrow_2(self) -> PageProperty
pub fn arrow_PageTable_0(self) -> PageTableNodeRef<'a, C>
pub fn arrow_Frame_0(self) -> Paddr
pub fn arrow_Frame_1(self) -> PagingLevel
pub fn arrow_Frame_2(self) -> PageProperty
Source§impl<C: PageTableConfig> ChildRef<'_, C>
impl<C: PageTableConfig> ChildRef<'_, C>
Sourcepub exec fn from_pte(pte: &C::E, level: PagingLevel) -> res : Self
pub exec fn from_pte(pte: &C::E, level: PagingLevel) -> res : Self
with
Tracked(regions): Tracked <& mut MetaRegionOwners>,
Tracked(entry_owner): Tracked <& EntryOwner <C>>,requiresentry_owner.match_pte(*pte, level),entry_owner.inv(),pte.paddr() % PAGE_SIZE() == 0,pte.paddr() < MAX_PADDR(),old(regions).inv(),entry_owner.is_node() ==> entry_owner.node.unwrap().relate_region(*old(regions)),ensuresregions.inv(),res.wf(*entry_owner),Converts a PTE to a child.
§Safety
The PTE must be the output of a Child::into_pte, where the child
outlives the reference created by this function.
The provided level must be the same with the level of the page table node that contains this PTE.
Trait Implementations§
Source§impl<'a, C: PageTableConfig> Inv for ChildRef<'a, C>
impl<'a, C: PageTableConfig> Inv for ChildRef<'a, C>
Source§impl<'a, C: PageTableConfig> OwnerOf for ChildRef<'a, C>
impl<'a, C: PageTableConfig> OwnerOf for ChildRef<'a, C>
Source§open spec fn wf(self, owner: Self::Owner) -> bool
open spec fn wf(self, owner: Self::Owner) -> bool
{
match self {
Self::PageTable(node) => (
&&& owner.is_node()
&&& manually_drop_deref_spec(&node.inner.0).ptr.addr()
== owner.node.unwrap().meta_perm.addr()
),
Self::Frame(paddr, level, prop) => (
&&& owner.is_frame()
&&& owner.frame.unwrap().mapped_pa == paddr
&&& owner.frame.unwrap().prop == prop
),
Self::None => owner.is_absent(),
}
}Source§type Owner = EntryOwner<C>
type Owner = EntryOwner<C>
The owner of the concrete type.
The Owner must implement
Inv, indicating that it must
has a consistent state.Auto Trait Implementations§
impl<'a, C> Freeze for ChildRef<'a, C>
impl<'a, C> !RefUnwindSafe for ChildRef<'a, C>
impl<'a, C> Send for ChildRef<'a, C>
impl<'a, C> Sync for ChildRef<'a, C>
impl<'a, C> Unpin for ChildRef<'a, C>where
C: Unpin,
impl<'a, C> !UnwindSafe for ChildRef<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more