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§
Sourcetype D: DeviceMmio
type D: DeviceMmio
Type of the objects that can be registered with this MmioManager.
Required Methods§
Sourcefn mmio_device(&self, addr: MmioAddress) -> Option<(&MmioRange, &Self::D)>
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.
Sourcefn mmio_read(&self, addr: MmioAddress, data: &mut [u8]) -> Result<(), Error>
fn mmio_read(&self, addr: MmioAddress, data: &mut [u8]) -> Result<(), Error>
Dispatch a read operation to the device registered at addr.
Sourcefn mmio_write(&self, addr: MmioAddress, data: &[u8]) -> Result<(), Error>
fn mmio_write(&self, addr: MmioAddress, data: &[u8]) -> Result<(), Error>
Dispatch a write operation to the device registered at addr.
Sourcefn register_mmio(
&mut self,
range: MmioRange,
device: Self::D,
) -> Result<(), Error>
fn register_mmio( &mut self, range: MmioRange, device: Self::D, ) -> Result<(), Error>
Register the provided device with the specified range.
Sourcefn deregister_mmio(&mut self, addr: MmioAddress) -> Option<(MmioRange, Self::D)>
fn deregister_mmio(&mut self, addr: MmioAddress) -> Option<(MmioRange, Self::D)>
Deregister the device currently registered at addr together with the
associated range.