pub struct VirtioMmioTransport { /* private fields */ }Expand description
Handle for a single virtio-mmio device.
Wraps the kernel-virtual base address of a virtio-mmio register region and provides typed read/write accessors. The base address must point to a valid 0x200-byte MMIO region that is mapped in the kernel’s address space (identity-mapped on AArch64/RISC-V, or via the physical memory window on x86_64).
§Safety Invariant
The base address must remain valid and mapped for the lifetime of this
struct. All register accesses use volatile reads/writes to prevent the
compiler from reordering or eliding MMIO operations.
Implementations§
Source§impl VirtioMmioTransport
impl VirtioMmioTransport
pub fn new(base: usize) -> Self
pub fn matches_blk(&self) -> bool
pub fn begin_init(&self)
pub fn set_failed(&self)
pub fn set_features_ok(&self) -> bool
pub fn set_driver_ok(&self)
pub fn read_device_features(&self) -> u32
pub fn write_driver_features(&self, features: u32)
pub fn select_queue(&self, idx: u16)
pub fn read_queue_size_max(&self) -> u16
pub fn set_queue_size(&self, size: u16)
pub fn set_queue_ready(&self)
pub fn write_queue_phys(&self, desc: u64, avail: u64, used: u64)
pub fn notify_queue(&self, idx: u16)
pub fn ack_interrupts(&self)
pub fn read_config_u64(&self, offset: usize) -> u64
pub fn version(&self) -> u32
Trait Implementations§
Source§impl Clone for VirtioMmioTransport
impl Clone for VirtioMmioTransport
Source§fn clone(&self) -> VirtioMmioTransport
fn clone(&self) -> VirtioMmioTransport
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtioMmioTransport
impl Debug for VirtioMmioTransport
impl Copy for VirtioMmioTransport
Auto Trait Implementations§
impl Freeze for VirtioMmioTransport
impl RefUnwindSafe for VirtioMmioTransport
impl Send for VirtioMmioTransport
impl Sync for VirtioMmioTransport
impl Unpin for VirtioMmioTransport
impl UnwindSafe for VirtioMmioTransport
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)