Skip to main content

OwnershipTable

Struct OwnershipTable 

Source
pub struct OwnershipTable { /* private fields */ }
Expand description

Source of truth for block ownership.

Implementations§

Source§

impl OwnershipTable

Source

pub fn new() -> Self

Creates an empty ownership table.

Source

pub fn claim( &self, block: PhysBlock<BuddyReserved>, cap_id: CapId, ) -> Result<PhysBlock<Exclusive>, OwnerError>

Claims a reserved block for the provided capability.

Source

pub fn ensure_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<BlockState, OwnerError>

Ensures cap_id is recorded as a live reference on handle.

Source

pub fn add_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<BlockState, OwnerError>

Adds a capability reference to an existing owned block.

Source

pub fn pin(&self, handle: BlockHandle) -> Result<u32, OwnerError>

Adds a temporary pin to keep the block alive while publishing a mapping.

Source

pub fn remove_ref( &self, handle: BlockHandle, cap_id: CapId, ) -> Result<RemoveRefResult, OwnerError>

Removes a capability reference from a block.

Source

pub fn unpin(&self, handle: BlockHandle) -> Result<RemoveRefResult, OwnerError>

Removes one temporary pin and releases the block if this was the last live reference.

Source

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.

Source

pub fn get(&self, handle: BlockHandle) -> Option<OwnerEntry>

Returns a snapshot of the ownership entry for the given block.

Source

pub fn handle_for_base(&self, base: PhysAddr) -> Option<BlockHandle>

Returns the live handle whose base physical address matches base, if any.

Source

pub fn handle_containing(&self, phys: PhysAddr) -> Option<BlockHandle>

Returns the live handle whose block currently contains phys, if any.

Source

pub fn refcount(&self, handle: BlockHandle) -> Option<u32>

Returns the current reference count for the given block.

Trait Implementations§

Source§

impl Default for OwnershipTable

Source§

fn default() -> Self

Creates an empty ownership table.

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.

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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.
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.