pub struct AhciDriver<H> { /* private fields */ }Implementations§
Source§impl<H: Hal> AhciDriver<H>
impl<H: Hal> AhciDriver<H>
Sourcepub unsafe fn try_new(base: usize) -> Option<Self>
pub unsafe fn try_new(base: usize) -> Option<Self>
Try to construct a new AHCI driver from the given MMIO base address.
§Safety
The caller must ensure that:
baseis a valid virtual address pointing to the AHCI controller’s MMIO register block.- The memory region starting at
baseis properly mapped and accessible. - No other code is concurrently accessing the same AHCI controller.
- The AHCI controller hardware is present and functional at the given address.
pub fn capacity(&self) -> u64
pub fn block_size(&self) -> usize
pub fn read(&mut self, block_id: u64, buf: &mut [u8]) -> bool
pub fn write(&mut self, block_id: u64, buf: &[u8]) -> bool
Trait Implementations§
impl<H: Hal> Send for AhciDriver<H>
Safety:
Send: The driver takes ownership of the MMIO region and can be safely moved between threads.Sync: The driver’s mutating operations require&mut self, ensuring exclusive access. Read-only operations (like getting block size) are safe to perform concurrently.
impl<H: Hal> Sync for AhciDriver<H>
Auto Trait Implementations§
impl<H> Freeze for AhciDriver<H>
impl<H> RefUnwindSafe for AhciDriver<H>where
H: RefUnwindSafe,
impl<H> Unpin for AhciDriver<H>where
H: Unpin,
impl<H> UnwindSafe for AhciDriver<H>where
H: UnwindSafe,
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