MmioManager

Trait MmioManager 

Source
pub trait MmioManager {
    type D: DeviceMmio;

    // Required methods
    fn mmio_device(&self, addr: MmioAddress) -> Option<(&MmioRange, &Self::D)>;
    fn mmio_read(&self, addr: MmioAddress, data: &mut [u8]) -> Result<(), Error>;
    fn mmio_write(&self, addr: MmioAddress, data: &[u8]) -> Result<(), Error>;
    fn register_mmio(
        &mut self,
        range: MmioRange,
        device: Self::D,
    ) -> Result<(), Error>;
    fn deregister_mmio(
        &mut self,
        addr: MmioAddress,
    ) -> Option<(MmioRange, Self::D)>;
}
Expand description

Represents an object that provides MMIO manager operations.

Required Associated Types§

Source

type D: DeviceMmio

Type of the objects that can be registered with this MmioManager.

Required Methods§

Source

fn mmio_device(&self, addr: MmioAddress) -> Option<(&MmioRange, &Self::D)>

Return a reference to the device registered at addr, together with the associated range, if available.

Source

fn mmio_read(&self, addr: MmioAddress, data: &mut [u8]) -> Result<(), Error>

Dispatch a read operation to the device registered at addr.

Source

fn mmio_write(&self, addr: MmioAddress, data: &[u8]) -> Result<(), Error>

Dispatch a write operation to the device registered at addr.

Source

fn register_mmio( &mut self, range: MmioRange, device: Self::D, ) -> Result<(), Error>

Register the provided device with the specified range.

Source

fn deregister_mmio(&mut self, addr: MmioAddress) -> Option<(MmioRange, Self::D)>

Deregister the device currently registered at addr together with the associated range.

Implementors§