Skip to main content

FakeBtiPinnedVmos

Struct FakeBtiPinnedVmos 

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

A collection of pinned VMOs returned by FakeBti::get_pinned_vmo.

Implementations§

Source§

impl FakeBtiPinnedVmos

Source

pub fn find_phys( &self, physical_address: usize, ) -> Option<(Arc<Vmo>, Range<u64>)>

Looks up a physical address in the pinned VMOs.

Returns the VMO and the range of offsets within that VMO starting at the offset corresponding to physical_address and ending at the end of the contiguous pinned block.

Source

pub fn read_bytes(&self, phys_addr: usize, len: usize) -> Result<Vec<u8>, Error>

Reads bytes from physical memory.

The read can span across multiple non-contiguous pinned ranges.

Source

pub fn read<T: FromBytes>(&self, phys_addr: usize) -> Result<T, Error>

Reads T from physical memory.

Source

pub fn write_bytes(&self, phys_addr: usize, data: &[u8]) -> Result<(), Error>

Writes bytes to physical memory.

The write can span across multiple non-contiguous pinned ranges.

Source

pub fn write<T: IntoBytes + Immutable>( &self, phys_addr: usize, value: T, ) -> Result<(), Error>

Writes T to physical memory.

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.