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
impl Mmio
Sourcepub fn read16(&self, off: usize) -> u16
pub fn read16(&self, off: usize) -> u16
Read a 16-bit register at off (must be 2-byte aligned).
Sourcepub fn read32(&self, off: usize) -> u32
pub fn read32(&self, off: usize) -> u32
Read a 32-bit register at off (must be 4-byte aligned).
Sourcepub fn write16(&self, off: usize, val: u16)
pub fn write16(&self, off: usize, val: u16)
Write a 16-bit register at off (must be 2-byte aligned).
Sourcepub fn write32(&self, off: usize, val: u32)
pub fn write32(&self, off: usize, val: u32)
Write a 32-bit register at off (must be 4-byte aligned).
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more