pub struct VirtioBlkDevice {
base_addr: u64,
block_size: u64,
features: u32,
queue: Option<BootVirtqueue>,
}Expand description
VirtIO block device (boot-time MMIO transport)
Fields§
§base_addr: u64Base address of the device registers (MMIO BAR)
block_size: u64Block size in bytes
features: u32Device features
queue: Option<BootVirtqueue>Boot-time virtqueue
Implementations§
Source§impl VirtioBlkDevice
impl VirtioBlkDevice
Sourcepub unsafe fn new(base_addr: u64) -> Self
pub unsafe fn new(base_addr: u64) -> Self
Create a new VirtIO block device from MMIO base address.
§Safety
base_addr must point to valid VirtIO device registers.
unsafe fn read_status(&self) -> u32
unsafe fn write_status(&self, val: u32)
unsafe fn add_status(&self, bit: u32)
unsafe fn read_device_features(&self) -> u32
unsafe fn write_driver_features(&self, features: u32)
Trait Implementations§
Source§impl BlockDevice for VirtioBlkDevice
impl BlockDevice for VirtioBlkDevice
Auto Trait Implementations§
impl Freeze for VirtioBlkDevice
impl RefUnwindSafe for VirtioBlkDevice
impl Send for VirtioBlkDevice
impl Sync for VirtioBlkDevice
impl Unpin for VirtioBlkDevice
impl UnsafeUnpin for VirtioBlkDevice
impl UnwindSafe for VirtioBlkDevice
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more