pub struct OwnershipTable { /* private fields */ }Expand description
Source of truth for block ownership.
Implementations§
Source§impl OwnershipTable
impl OwnershipTable
Sourcepub fn claim(
&self,
block: PhysBlock<BuddyReserved>,
cap_id: CapId,
) -> Result<PhysBlock<Exclusive>, OwnerError>
pub fn claim( &self, block: PhysBlock<BuddyReserved>, cap_id: CapId, ) -> Result<PhysBlock<Exclusive>, OwnerError>
Claims a reserved block for the provided capability.
Sourcepub fn ensure_ref(
&self,
handle: BlockHandle,
cap_id: CapId,
) -> Result<BlockState, OwnerError>
pub fn ensure_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<BlockState, OwnerError>
Ensures cap_id is recorded as a live reference on handle.
Sourcepub fn add_ref(
&self,
handle: BlockHandle,
cap_id: CapId,
) -> Result<BlockState, OwnerError>
pub fn add_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<BlockState, OwnerError>
Adds a capability reference to an existing owned block.
Sourcepub fn pin(&self, handle: BlockHandle) -> Result<u32, OwnerError>
pub fn pin(&self, handle: BlockHandle) -> Result<u32, OwnerError>
Adds a temporary pin to keep the block alive while publishing a mapping.
Sourcepub fn remove_ref(
&self,
handle: BlockHandle,
cap_id: CapId,
) -> Result<RemoveRefResult, OwnerError>
pub fn remove_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<RemoveRefResult, OwnerError>
Removes a capability reference from a block.
Sourcepub fn unpin(&self, handle: BlockHandle) -> Result<RemoveRefResult, OwnerError>
pub fn unpin(&self, handle: BlockHandle) -> Result<RemoveRefResult, OwnerError>
Removes one temporary pin and releases the block if this was the last live reference.
Sourcepub fn release(
&self,
block: PhysBlock<Exclusive>,
cap_id: CapId,
) -> Result<PhysBlock<Released>, OwnerError>
pub fn release( &self, block: PhysBlock<Exclusive>, cap_id: CapId, ) -> Result<PhysBlock<Released>, OwnerError>
Releases an exclusive block and returns a buddy-facing handle if it becomes free.
Sourcepub fn get(&self, handle: BlockHandle) -> Option<OwnerEntry>
pub fn get(&self, handle: BlockHandle) -> Option<OwnerEntry>
Returns a snapshot of the ownership entry for the given block.
Sourcepub fn handle_for_base(&self, base: PhysAddr) -> Option<BlockHandle>
pub fn handle_for_base(&self, base: PhysAddr) -> Option<BlockHandle>
Returns the live handle whose base physical address matches base, if any.
Sourcepub fn handle_containing(&self, phys: PhysAddr) -> Option<BlockHandle>
pub fn handle_containing(&self, phys: PhysAddr) -> Option<BlockHandle>
Returns the live handle whose block currently contains phys, if any.
Sourcepub fn refcount(&self, handle: BlockHandle) -> Option<u32>
pub fn refcount(&self, handle: BlockHandle) -> Option<u32>
Returns the current reference count for the given block.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OwnershipTable
impl !RefUnwindSafe for OwnershipTable
impl Send for OwnershipTable
impl Sync for OwnershipTable
impl Unpin for OwnershipTable
impl UnsafeUnpin for OwnershipTable
impl UnwindSafe for OwnershipTable
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more