Skip to main content

Mmio

Struct Mmio 

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

A mapped MMIO region granted to a driver (e.g. via crate::ServiceContext::xhci_mmio). Read/write device registers by byte offset. All accesses are volatile - never reordered or elided - and target the uncached device registers directly, with no kernel mediation (§12).

Implementations§

Source§

impl Mmio

Source

pub fn len(&self) -> usize

Length of the mapped register window in bytes.

Source

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

Read an 8-bit register at off bytes from the base.

Source

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

Read a 16-bit register at off (must be 2-byte aligned).

Source

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

Read a 32-bit register at off (must be 4-byte aligned).

Source

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

Write an 8-bit register at off.

Source

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

Write a 16-bit register at off (must be 2-byte aligned).

Source

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

Write a 32-bit register at off (must be 4-byte aligned).

Source

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

Read a 64-bit register at off (must be 8-byte aligned). For the controller’s 64-bit registers (DCBAAP, CRCR, ERSTBA, ERDP).

Source

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

Write a 64-bit register at off (must be 8-byte aligned).

Trait Implementations§

Source§

impl Clone for Mmio

Source§

fn clone(&self) -> Mmio

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Mmio

Auto Trait Implementations§

§

impl Freeze for Mmio

§

impl RefUnwindSafe for Mmio

§

impl !Send for Mmio

§

impl !Sync for Mmio

§

impl Unpin for Mmio

§

impl UnsafeUnpin for Mmio

§

impl UnwindSafe for Mmio

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.