pub struct ExportedRegion {
inner: Arc<Mutex<ExportedRegionInner>>,
}Expand description
A region exported from the virtio-iommu.
Fields§
§inner: Arc<Mutex<ExportedRegionInner>>Implementations§
Source§impl ExportedRegion
impl ExportedRegion
Sourcepub fn new(
mem: &GuestMemory,
iommu: Arc<Mutex<IpcMemoryMapper>>,
iova: u64,
size: u64,
) -> Result<Self>
pub fn new( mem: &GuestMemory, iommu: Arc<Mutex<IpcMemoryMapper>>, iova: u64, size: u64, ) -> Result<Self>
Creates a new, fully initialized exported region.
fn do_copy<C>( &self, iova: u64, remaining: usize, prot: Protection, copy_fn: C, ) -> Result<()>
Sourcepub fn read_obj_from_addr<T: IntoBytes + FromBytes + FromZeros>(
&self,
mem: &GuestMemory,
iova: u64,
) -> Result<T>
pub fn read_obj_from_addr<T: IntoBytes + FromBytes + FromZeros>( &self, mem: &GuestMemory, iova: u64, ) -> Result<T>
Reads an object from the given iova. Fails if the specified iova range does not lie within this region, or if part of the region isn’t readable.
Sourcepub fn write_obj_at_addr<T: Immutable + IntoBytes>(
&self,
mem: &GuestMemory,
val: T,
iova: u64,
) -> Result<()>
pub fn write_obj_at_addr<T: Immutable + IntoBytes>( &self, mem: &GuestMemory, val: T, iova: u64, ) -> Result<()>
Writes an object at a given iova. Fails if the specified iova range does not lie within this region, or if part of the region isn’t writable.
Sourcepub fn is_valid(&self, mem: &GuestMemory, iova: u64, size: u64) -> bool
pub fn is_valid(&self, mem: &GuestMemory, iova: u64, size: u64) -> bool
Validates that [iova, iova+size) lies within this region, and that the region is valid according to mem.
Sourcepub fn get_mem_regions(&self) -> SmallVec<[MemRegion; 1]>
pub fn get_mem_regions(&self) -> SmallVec<[MemRegion; 1]>
Gets the list of guest physical regions for the exported region.
Trait Implementations§
Source§impl Clone for ExportedRegion
impl Clone for ExportedRegion
Source§fn clone(&self) -> ExportedRegion
fn clone(&self) -> ExportedRegion
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExportedRegion
impl RefUnwindSafe for ExportedRegion
impl Send for ExportedRegion
impl Sync for ExportedRegion
impl Unpin for ExportedRegion
impl UnwindSafe for ExportedRegion
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