pub struct MmioCam<'a> { /* private fields */ }Expand description
ConfigurationAccess implementation for memory-mapped access to a PCI root complex, via either
a 16 MiB region for the PCI Configuration Access Mechanism or a 256 MiB region for the PCIe
Enhanced Configuration Access Mechanism.
Implementations§
Source§impl MmioCam<'_>
impl MmioCam<'_>
Sourcepub unsafe fn new(mmio_base: *mut u8, cam: Cam) -> Self
pub unsafe fn new(mmio_base: *mut u8, cam: Cam) -> Self
Wraps the PCI root complex with the given MMIO base address.
Panics if the base address is not aligned to a 4-byte boundary.
§Safety
mmio_base must be a valid pointer to an appropriately-mapped MMIO region of at least
16 MiB (if cam == Cam::MmioCam) or 256 MiB (if cam == Cam::Ecam). The pointer must be
valid for the lifetime 'a, which implies that no Rust references may be used to access any
of the memory region at least during that lifetime.
Trait Implementations§
Source§impl ConfigurationAccess for MmioCam<'_>
impl ConfigurationAccess for MmioCam<'_>
Source§fn read_word(&self, device_function: DeviceFunction, register_offset: u8) -> u32
fn read_word(&self, device_function: DeviceFunction, register_offset: u8) -> u32
Reads 4 bytes from the configuration space.
Source§fn write_word(
&mut self,
device_function: DeviceFunction,
register_offset: u8,
data: u32,
)
fn write_word( &mut self, device_function: DeviceFunction, register_offset: u8, data: u32, )
Writes 4 bytes to the configuration space.
Source§unsafe fn unsafe_clone(&self) -> Self
unsafe fn unsafe_clone(&self) -> Self
Makes a clone of the
ConfigurationAccess, accessing the same PCI bus. Read more