pub struct VirtioMemoryRange { /* private fields */ }Expand description
Describes a memory region accessible by a virtio device.
The memory region is contiguous in the PCI device’s physical address space. If no IOMMU is involved, the PCI device’s physical address space is the same as the CPU physical address space visible to the guest (virtualized) OS.
Each instance describes a memory region that is submitted (owned by the device) or is about to be submitted (owned by the device). Device ownership is conceptually equivalent to a Rust mutable reference covering the entire memory range. Here are two immediate implications:
- No Rust references may point into a range described by an instance.
- The memory ranges described by any two instances must not overlap.
Implementations§
Source§impl VirtioMemoryRange
impl VirtioMemoryRange
Sourcepub unsafe fn new(
start_physical_address: u64,
size: NonZero<u32>,
device_access: VirtioMemoryRangeAccess,
) -> VirtioMemoryRange
pub unsafe fn new( start_physical_address: u64, size: NonZero<u32>, device_access: VirtioMemoryRangeAccess, ) -> VirtioMemoryRange
Describes a memory range that will be submitted to a virtio device.
§Safety
start_physical_address and size must identify a valid range
of memory that is contiguous in the PCI virtio device’s physical address
space. The newly created instance must be treated like a mutable Rust
reference covering the entire memory range.
Sourcepub fn start_physical_address(&self) -> u64
pub fn start_physical_address(&self) -> u64
Points to the first byte in the memory region.
Uses the PCI device’s physical addressable space.
Sourcepub fn device_access(&self) -> VirtioMemoryRangeAccess
pub fn device_access(&self) -> VirtioMemoryRangeAccess
Constrains a device’s accesses to the memory range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VirtioMemoryRange
impl RefUnwindSafe for VirtioMemoryRange
impl Send for VirtioMemoryRange
impl Sync for VirtioMemoryRange
impl Unpin for VirtioMemoryRange
impl UnsafeUnpin for VirtioMemoryRange
impl UnwindSafe for VirtioMemoryRange
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]