Struct pci_driver::iommu::PciIommu
source · [−]pub struct PciIommu<'a> { /* private fields */ }Expand description
Represents an IOMMU that controls DMA done by some PCI function, device, or group of devices.
You’ll probably need std::sync::atomic::fence or use types like
AtomicU32 somewhere to synchronize accesses properly with the
device.
Implementations
sourceimpl PciIommu<'_>
impl PciIommu<'_>
sourcepub fn alignment(&self) -> usize
pub fn alignment(&self) -> usize
Both iova and process address must be aligned to this value.
This is always a power of 2, and never less than the system’s page size.
sourcepub fn valid_iova_ranges(&self) -> &[Range<u64>]
pub fn valid_iova_ranges(&self) -> &[Range<u64>]
IOVA ranges given to PciIommu::map must be contained in one of the ranges that this
method returns.
sourcepub unsafe fn map(
&self,
iova: u64,
length: usize,
address: *const u8,
device_permissions: Permissions
) -> Result<()>
pub unsafe fn map(
&self,
iova: u64,
length: usize,
address: *const u8,
device_permissions: Permissions
) -> Result<()>
Add the given mapping to the IOMMU.
iovais the start address of the region in the device’s address space.sizeis the length of the region.addressis a pointer (in the current process’ address space) to the start of the region to be mapped.
TODO: Alignment constraints?
Safety
Must make sense.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PciIommu<'a>
impl<'a> !Send for PciIommu<'a>
impl<'a> !Sync for PciIommu<'a>
impl<'a> Unpin for PciIommu<'a>
impl<'a> !UnwindSafe for PciIommu<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more