pub struct MmioCam { /* 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 entire lifetime of the program (i.e. 'static), which implies that no Rust
references may be used to access any of the memory region at any point.
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 moreimpl Send for MmioCam
impl Sync for MmioCam
Auto Trait Implementations§
impl Freeze for MmioCam
impl RefUnwindSafe for MmioCam
impl Unpin for MmioCam
impl UnwindSafe for MmioCam
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more