[][src]Trait sunrise_libuser::ahci::IDisk

pub trait IDisk {
    fn sector_count(
        &mut self,
        manager: WorkQueue<'static>
    ) -> Result<u64, Error>;
fn read_dma(
        &mut self,
        manager: WorkQueue<'static>,
        address: u64,
        unknown_1: &mut [Block]
    ) -> Result<(), Error>;
fn write_dma(
        &mut self,
        manager: WorkQueue<'static>,
        address: u64,
        blocks: &[Block]
    ) -> Result<(), Error>; fn dispatch<'a>(
        &'a mut self,
        manager: WorkQueue<'static>,
        cmdid: u32,
        buf: &'a mut [u8]
    ) -> FutureObj<Result<(), Error>> { ... } }

Interface to an AHCI device.

It can:

Required methods

fn sector_count(&mut self, manager: WorkQueue<'static>) -> Result<u64, Error>

Retrieves the number of addressable 512-octet sectors on this disk.

fn read_dma(
    &mut self,
    manager: WorkQueue<'static>,
    address: u64,
    unknown_1: &mut [Block]
) -> Result<(), Error>

Reads sectors from the disk.

This IPC call will invoke the AHCI driver and make it copy sector_count sectors from the disk to the memory pointed to by the output buffer.

Error

  • address..address+sector_count should be in the range 0..IDisk.sector_count().

fn write_dma(
    &mut self,
    manager: WorkQueue<'static>,
    address: u64,
    blocks: &[Block]
) -> Result<(), Error>

Writes sectors to the disk.

This IPC call will invoke the AHCI driver and make it copy sector_count sectors to the disk from the memory pointed to by the input buffer.

Error

  • address..address+sector_count should be in the range 0..IDisk.sector_count().
Loading content...

Provided methods

fn dispatch<'a>(
    &'a mut self,
    manager: WorkQueue<'static>,
    cmdid: u32,
    buf: &'a mut [u8]
) -> FutureObj<Result<(), Error>>

Handle an incoming IPC request.

Loading content...

Implementors

Loading content...