Skip to main content

MemoryRegion

Struct MemoryRegion 

Source
pub struct MemoryRegion {
    pub name: String,
    pub size: u64,
    pub region_type: RegionType,
    pub priority: i32,
    pub subregions: Vec<SubRegion>,
    pub enabled: bool,
}

Fields§

§name: String§size: u64§region_type: RegionType§priority: i32§subregions: Vec<SubRegion>§enabled: bool

Implementations§

Source§

impl MemoryRegion

Source

pub fn container(name: &str, size: u64) -> Self

Create a pure container (no backing storage).

Source

pub fn ram(name: &str, size: u64) -> (Self, Arc<RamBlock>)

Create a RAM-backed region and return the shared RamBlock handle alongside it.

Source

pub fn rom(name: &str, size: u64) -> (Self, Arc<RamBlock>)

Create a read-only ROM region and return the shared RamBlock handle alongside it. Writes to ROM are silently dropped.

Source

pub fn io(name: &str, size: u64, ops: Box<dyn MmioOps>) -> Self

Create an MMIO region backed by device callbacks.

Source

pub fn alias(name: &str, target: MemoryRegion, offset: u64, size: u64) -> Self

Create an alias window into target starting at byte offset within the target region.

Source

pub fn add_subregion(&mut self, region: MemoryRegion, offset: GPA)

Add a child region at offset within this region’s address space, using the child’s existing priority.

Source

pub fn add_subregion_with_priority( &mut self, region: MemoryRegion, offset: GPA, priority: i32, )

Add a child region at offset, overriding its priority.

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