Skip to main content

MetaSlotOwner

Struct MetaSlotOwner 

Source
pub struct MetaSlotOwner {
    pub metadata_perm: MetadataPerms,
    pub ref_count_perm: PermissionU64,
    pub in_list_perm: PermissionU64,
    pub slot_vaddr: Vaddr,
    pub usage: PageUsage,
    pub paths_in_pt: Set<TreePath<NR_ENTRIES>>,
}
Expand description

Permissions that remain under the authority of MetaRegionOwners.

ref_count and in_list exist for the complete lifetime of the corresponding MetaSlot (i.e., 'static).

Fields§

§metadata_perm: MetadataPerms§ref_count_perm: PermissionU64§in_list_perm: PermissionU64§slot_vaddr: Vaddr§usage: PageUsage§paths_in_pt: Set<TreePath<NR_ENTRIES>>

The set of tree paths at which this slot is referenced. For PT-node slots this is a singleton. For data-frame slots this tracks every location the frame is currently mapped — allowing a single frame to be mapped at multiple addresses.

Implementations§

Source§

impl MetaSlotOwner

Source

pub open spec fn same_permissions(self, other: Self) -> bool

{
    &&& self.metadata_perm == other.metadata_perm
    &&& self.ref_count_perm == other.ref_count_perm
    &&& self.in_list_perm == other.in_list_perm

}
Source

pub open spec fn ref_count(self) -> u64

{ self.ref_count_perm.value() }
Source

pub open spec fn storage_perm(self) -> PointsTo<MetaSlotStorage>

{ self.metadata_perm.storage_perm }
Source

pub open spec fn vtable_ptr_perm(self) -> PointsTo<usize>

{ self.metadata_perm.vtable_ptr_perm }
Source

pub proof fn tracked_borrow_mut_metadata_perms(tracked &mut self) -> tracked res : &mut MetadataPerms

ensures
*res == old(self).metadata_perm,
*final(self)
    == (Self {
        metadata_perm: *final(res),
        ..*old(self)
    }),

Trait Implementations§

Source§

impl Inv for MetaSlotOwner

Source§

open spec fn inv(self) -> bool

{
    &&& self.ref_count() == REF_COUNT_UNUSED
        ==> {
            &&& self.storage_perm().is_uninit()
            &&& self.vtable_ptr_perm().is_uninit()
            &&& self.in_list_perm.value() == 0
            &&& (self.usage != PageUsage::MMIO ==> self.paths_in_pt.is_empty())

        }
    &&& self.ref_count() == REF_COUNT_UNIQUE
        ==> {
            &&& self.vtable_ptr_perm().is_init()
            &&& self.storage_perm().is_init()
            &&& (self.usage != PageUsage::MMIO ==> self.paths_in_pt.is_empty())

        }
    &&& 0 < self.ref_count() <= REF_COUNT_MAX
        ==> {
            &&& self.vtable_ptr_perm().is_init()
            &&& self.storage_perm().is_init()
            &&& self.in_list_perm.value() == 0

        }
    &&& REF_COUNT_MAX < self.ref_count() < REF_COUNT_UNIQUE ==> { false }
    &&& self.ref_count() == 0
        ==> {
            &&& self.in_list_perm.value() == 0

        }
    &&& FRAME_METADATA_RANGE.start <= self.slot_vaddr < FRAME_METADATA_RANGE.end
    &&& self.slot_vaddr % META_SLOT_SIZE == 0

}
Source§

impl InvView for MetaSlotOwner

Source§

impl View for MetaSlotOwner

Source§

open spec fn view(&self) -> Self::V

{
    let storage = self.storage_perm().mem_contents();
    let ref_count = self.ref_count();
    let vtable_ptr = self.vtable_ptr_perm().mem_contents();
    let in_list = self.in_list_perm.value();
    let slot_vaddr = self.slot_vaddr;
    let usage = self.usage;
    let status = match ref_count {
        REF_COUNT_UNUSED => MetaSlotStatus::UNUSED,
        REF_COUNT_UNIQUE => MetaSlotStatus::UNIQUE,
        0 => MetaSlotStatus::UNDER_CONSTRUCTION,
        _ if ref_count <= REF_COUNT_MAX => MetaSlotStatus::SHARED,
        _ => MetaSlotStatus::OVERFLOW,
    };
    MetaSlotModel {
        status,
        storage,
        ref_count,
        vtable_ptr,
        in_list,
        slot_vaddr,
        usage,
    }
}
Source§

type V = MetaSlotModel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

impl<T, U> IntoSpecImpl<U> for T
where U: From<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

impl<T, U> TryIntoSpecImpl<U> for T
where U: TryFrom<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<U, <U as TryFrom<T>>::Error>

§

impl<A> SpecEq<&A> for A
where A: ?Sized,

§

impl<A> SpecEq<&mut A> for A
where A: ?Sized,

§

impl<A> SpecEq<A> for A
where A: ?Sized,

§

impl<A> SpecEq<Ghost<A>> for A

§

impl<A> SpecEq<Tracked<A>> for A