[][src]Struct sunrise_ahci::hba::HbaMemoryRegisters

#[repr(packed)]pub struct HbaMemoryRegisters {
    generic_host_control: GenericHostControl,
    _rsv: [Mmio<u8>; 116],
    _rsv_vendor: [Mmio<u8>; 96],
    ports: [Px; 32],
}

HBA memory registers.

See spec section 3.1

Found at address in pci configuration register BAR5.

Fields

generic_host_control: GenericHostControl_rsv: [Mmio<u8>; 116]_rsv_vendor: [Mmio<u8>; 96]ports: [Px; 32]

Implementations

impl HbaMemoryRegisters[src]

pub fn init(bar5: usize) -> Vec<Disk>[src]

Initializes an AHCI Controller.

BAR5 is the physical address of HBA Memory Register, usually obtained via PCI discovery.

This function will map the root Mmio region, allocate memory for every 'implemented' port, put them in the running state, and return an interface to the plugged devices which is up and running.

Error

If an error occurred, this function will stop trying to initialize the HBA and return an empty Vec as if no disks were found. This can happen if:

  • mapping BAR5 failed.
  • GHC.AE is not set (controller is in legacy support mode), because conditions specified in section 10.2 are tedious.

Auto Trait Implementations

impl RefUnwindSafe for HbaMemoryRegisters

impl Send for HbaMemoryRegisters

impl Sync for HbaMemoryRegisters

impl Unpin for HbaMemoryRegisters

impl UnwindSafe for HbaMemoryRegisters

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.