pub struct PageTablePageMeta<C: PageTableConfig> {
pub nr_children: PCell<u16>,
pub stray: PCell<bool>,
pub level: PagingLevel,
pub lock: PAtomicU8,
pub _phantom: PhantomData<C>,
}Expand description
The metadata of any kinds of page table pages. Make sure the the generic parameters don’t effect the memory layout.
Fields§
§nr_children: PCell<u16>The number of valid PTEs. It is mutable if the lock is held.
stray: PCell<bool>If the page table is detached from its parent.
A page table can be detached from its parent while still being accessed, since we use a RCU scheme to recycle page tables. If this flag is set, it means that the parent is recycling the page table.
level: PagingLevelThe level of the page table page. A page table page cannot be referenced by page tables of different levels.
lock: PAtomicU8The lock for the page table page.
_phantom: PhantomData<C>Implementations§
Source§impl<C: PageTableConfig> PageTablePageMeta<C>
impl<C: PageTableConfig> PageTablePageMeta<C>
Sourcepub open spec fn into_spec(self) -> StoredPageTablePageMeta
pub open spec fn into_spec(self) -> StoredPageTablePageMeta
{
StoredPageTablePageMeta {
nr_children: self.nr_children,
stray: self.stray,
level: self.level,
lock: self.lock,
}
}Sourcepub exec fn into(self) -> res : StoredPageTablePageMeta
pub exec fn into(self) -> res : StoredPageTablePageMeta
ensures
res == self.into_spec(),Source§impl<C: PageTableConfig> PageTablePageMeta<C>
impl<C: PageTableConfig> PageTablePageMeta<C>
Sourcepub exec fn new(level: PagingLevel) -> Self
pub exec fn new(level: PagingLevel) -> Self
Trait Implementations§
Source§impl<C: PageTableConfig> AnyFrameMeta for PageTablePageMeta<C>
impl<C: PageTableConfig> AnyFrameMeta for PageTablePageMeta<C>
Source§impl<C: PageTableConfig> OwnerOf for PageTablePageMeta<C>
impl<C: PageTableConfig> OwnerOf for PageTablePageMeta<C>
Source§open spec fn wf(self, owner: Self::Owner) -> bool
open spec fn wf(self, owner: Self::Owner) -> bool
{
&&& self.nr_children.id() == owner.nr_children.id()
&&& self.stray.id() == owner.stray.id()
&&& 0 <= owner.nr_children.value() <= NR_ENTRIES()
}Source§type Owner = PageMetaOwner
type Owner = PageMetaOwner
The owner of the concrete type.
The Owner must implement
Inv, indicating that it must
has a consistent state.Source§impl<C: PageTableConfig> Repr<MetaSlot> for PageTablePageMeta<C>
impl<C: PageTableConfig> Repr<MetaSlot> for PageTablePageMeta<C>
Source§uninterp fn to_repr_spec(self) -> MetaSlot
uninterp fn to_repr_spec(self) -> MetaSlot
Source§uninterp fn from_repr_spec(r: MetaSlot) -> Self
uninterp fn from_repr_spec(r: MetaSlot) -> Self
Source§exec fn from_borrowed<'a>(r: &'a MetaSlot) -> &'a Self
exec fn from_borrowed<'a>(r: &'a MetaSlot) -> &'a Self
Source§proof fn from_to_repr(self)
proof fn from_to_repr(self)
Source§proof fn to_from_repr(r: MetaSlot)
proof fn to_from_repr(r: MetaSlot)
Source§proof fn to_repr_wf(self)
proof fn to_repr_wf(self)
Auto Trait Implementations§
impl<C> !Freeze for PageTablePageMeta<C>
impl<C> !RefUnwindSafe for PageTablePageMeta<C>
impl<C> Send for PageTablePageMeta<C>
impl<C> Sync for PageTablePageMeta<C>
impl<C> Unpin for PageTablePageMeta<C>where
C: Unpin,
impl<C> UnwindSafe for PageTablePageMeta<C>where
C: UnwindSafe,
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