Struct AddressSpaceManager

Source
pub struct AddressSpaceManager {
    address_space: ArrayVec<AddressRange, MAX_ADDRESS_RANGES>,
    vtl2_pool: bool,
}

Fields§

§address_space: ArrayVec<AddressRange, MAX_ADDRESS_RANGES>

Track the whole address space - this must be sorted.

§vtl2_pool: bool

Track that the VTL2 GPA pool has at least one allocation.

Implementations§

Source§

impl AddressSpaceManager

Source

pub const fn new_const() -> Self

Source

fn allocate_range( &mut self, index: usize, len: u64, usage: AddressUsage, allocation_policy: AllocationPolicy, ) -> AllocatedRange

Split a free range into two, with allocation policy deciding if we allocate the low part or high part.

Source

pub fn allocate( &mut self, required_vnode: Option<u32>, len: u64, allocation_type: AllocationType, allocation_policy: AllocationPolicy, ) -> Option<AllocatedRange>

Allocate a new range of memory with the given type and policy. None is returned if the allocation was unable to be satisfied.

len is the number of bytes to allocate. The number of bytes are rounded up to the next 4K page size increment. if len is 0, then None is returned.

required_vnode if Some(u32) is the vnode to allocate from. If there are no free ranges left in that vnode, None is returned.

Source

pub fn vtl2_ranges( &self, ) -> impl Iterator<Item = (MemoryRange, MemoryVtlType)> + use<'_>

Returns an iterator for all VTL2 ranges.

Source

pub fn reserved_vtl2_ranges( &self, ) -> impl Iterator<Item = (MemoryRange, ReservedMemoryType)> + use<'_>

Returns an iterator for reserved VTL2 ranges that should not be described as ram to the kernel.

Source

pub fn has_vtl2_pool(&self) -> bool

Returns true if there are VTL2 pool allocations.

Trait Implementations§

Source§

impl Debug for AddressSpaceManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more