Skip to main content

Arena

Struct Arena 

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

The DMA arena the kernel granted this driver. Not Copy: Arena::layout takes it, so a laid-out arena is reached only through its parts.

Implementations§

Source§

impl Arena

Source

pub fn len(&self) -> usize

The arena’s size in bytes.

Source

pub fn phys_at(&self, off: usize) -> u64

The physical address of byte off: what the device is given.

Source

pub fn zero(&self)

Zero the whole arena, with aligned volatile stores (never a memset, which may fault on the Device memory a non-coherent port maps it as).

Source

pub fn layout(self) -> Layout

Lay the arena out in named parts, from its start. The arena is taken: from here on it is reached through the parts.

Source

pub fn read8(&self, off: usize) -> u8

Read 8 bits at off.

Source

pub fn read16(&self, off: usize) -> u16

Read 16 bits at off.

Source

pub fn read32(&self, off: usize) -> u32

Read 32 bits at off.

Source

pub fn read64(&self, off: usize) -> u64

Read 64 bits at off.

Source

pub fn write8(&self, off: usize, val: u8)

Write 8 bits at off.

Source

pub fn write16(&self, off: usize, val: u16)

Write 16 bits at off.

Source

pub fn write32(&self, off: usize, val: u32)

Write 32 bits at off.

Source

pub fn write64(&self, off: usize, val: u64)

Write 64 bits at off.

Auto Trait Implementations§

§

impl Freeze for Arena

§

impl RefUnwindSafe for Arena

§

impl !Send for Arena

§

impl !Sync for Arena

§

impl Unpin for Arena

§

impl UnsafeUnpin for Arena

§

impl UnwindSafe for Arena

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.