pub struct OwningPciRegion { /* private fields */ }
Expand description
This is “owning” in the sense that it doesn’t borrow the PciDevice
it came from.
You can use the read and write methods to access the region. This should always work, but may
not be the most efficient method to access it. If the region is “mappable”, consider mapping it
into memory using OwningPciRegion::map
and using volatile memory accesses.
For instance, BARs can be I/O Space BARs or Memory Space BARs. In either case, you can access
them through the PciRegion
methods. In addition, if a BAR is a Memory Space BAR, you can map
it, which gives you another type implementing PciRegion
, but accesses through it should be
more efficient. You can also obtain a *const u8
or *mut u8
from that second PciRegion
and use that directly.
Implementations§
Source§impl OwningPciRegion
impl OwningPciRegion
Sourcepub fn is_mappable(&self) -> bool
pub fn is_mappable(&self) -> bool
Whether the region can be memory-mapped.
If false
, OwningPciRegion::map
will always fail.
Sourcepub fn owning_subregion(&self, range: impl RangeBounds<u64>) -> OwningPciRegion
pub fn owning_subregion(&self, range: impl RangeBounds<u64>) -> OwningPciRegion
Like PciSubregion’s similar method, but returns an “owning” subregion.
Sourcepub fn map(
&self,
range: impl RangeBounds<u64>,
permissions: Permissions,
) -> Result<MappedOwningPciRegion>
pub fn map( &self, range: impl RangeBounds<u64>, permissions: Permissions, ) -> Result<MappedOwningPciRegion>
Memory-map some range of the region into the current process’ address space.
Trait Implementations§
Source§impl<'a> AsPciSubregion<'a> for &'a OwningPciRegion
impl<'a> AsPciSubregion<'a> for &'a OwningPciRegion
Source§fn as_subregion(&self) -> PciSubregion<'a>
fn as_subregion(&self) -> PciSubregion<'a>
PciSubregion
corresponding to self
.Source§fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
PciSubregion
corresponding to a range of self
.