MmapRegion
is an mmap'ed memory region backed by volatile memory (RAM).
pub struct MmapRegion {
addr: *mut u8,
size: usize,
}
impl VolatileMemory for MmapRegion
impl Drop for MmapRegion
GuestRegionMmap
is a guest memory region, mmap'ed to the host RAM.
It is a esentially a MmapRegion
linked to a base guest physical address.
pub struct GuestRegionMmap {
mapping: MmapRegion,
guest_base: GuestAddress,
}
/// Represents a guest physical address (GPA).
///
/// Notes:
/// - On ARM64, a 32-bit hypervisor may be used to support a 64-bit guest. For simplicity,
/// u64 is used to store the the raw value no matter the guest a 32-bit or 64-bit virtual machine.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct GuestAddress(pub u64);
impl_address_ops!(GuestAddress, u64);
/// Represents an offset inside a region.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct MemoryRegionAddress(pub u64);
impl_address_ops!(MemoryRegionAddress, u64);
impl Bytes<MemoryRegionAddress> for GuestRegionMmap
impl GuestMemoryRegion for GuestRegionMmap
GuestMemoryMmap
represents a guest memory mmap'ed to the host RAM.
It is an array of GuestRegionMmap
.
pub struct GuestMemoryMmap {
regions: Arc<Vec<GuestRegionMmap>>,
}
impl GuestMemory for GuestMemoryMmap