Trait chipset_device::pio::PortIoIntercept

source ·
pub trait PortIoIntercept: ChipsetDevice {
    // Required methods
    fn io_read(&mut self, io_port: u16, data: &mut [u8]) -> IoResult;
    fn io_write(&mut self, io_port: u16, data: &[u8]) -> IoResult;

    // Provided method
    fn get_static_regions(&mut self) -> &[(&str, RangeInclusive<u16>)] { ... }
}
Expand description

Implemented by devices which use port IO intercepts.

Required Methods§

source

fn io_read(&mut self, io_port: u16, data: &mut [u8]) -> IoResult

Dispatch an IO port read to the device with the given address.

source

fn io_write(&mut self, io_port: u16, data: &[u8]) -> IoResult

Dispatch an IO port write to the device with the given address.

Provided Methods§

source

fn get_static_regions(&mut self) -> &[(&str, RangeInclusive<u16>)]

Report a set of static io port regions (region_name, port_range) that cannot be remapped at runtime and are always registered.

Note: This is a convenience method that makes it easy for simple devices to declare some fixed IO regions without having to do through the rigamarole of obtaining a reference to an instance of RegisterPortIoIntercept + manually registering fixed ranges as part of device init.

Implementors§