Skip to main content

AhciDriver

Struct AhciDriver 

Source
pub struct AhciDriver<H> { /* private fields */ }

Implementations§

Source§

impl<H: Hal> AhciDriver<H>

Source

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:

  • base is a valid virtual address pointing to the AHCI controller’s MMIO register block.
  • The memory region starting at base is 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.
Source

pub fn capacity(&self) -> u64

Source

pub fn block_size(&self) -> usize

Source

pub fn read(&mut self, block_id: u64, buf: &mut [u8]) -> bool

Source

pub fn write(&mut self, block_id: u64, buf: &[u8]) -> bool

Trait Implementations§

Source§

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.
Source§

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> 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> 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.