pub struct VmAddressRegion { /* private fields */ }Expand description
A contiguous region of the virtual address space.
Implementations§
Source§impl VmAddressRegion
impl VmAddressRegion
Sourcepub fn create_sub_vmar(
&self,
offset: usize,
size: usize,
align_pow2: u8,
vmar_flags: u32,
name: &CStr,
) -> Result<RefPtr<VmAddressRegion>, Status>
pub fn create_sub_vmar( &self, offset: usize, size: usize, align_pow2: u8, vmar_flags: u32, name: &CStr, ) -> Result<RefPtr<VmAddressRegion>, Status>
Creates a subregion of this region.
Sourcepub fn create_vm_mapping(
&self,
mapping_offset: usize,
size: usize,
align_pow2: u8,
vmar_flags: u32,
vmo: RefPtr<VmObject>,
vmo_offset: u64,
arch_mmu_flags: ArchMmuFlags,
name: &CStr,
) -> Result<MapResult, Status>
pub fn create_vm_mapping( &self, mapping_offset: usize, size: usize, align_pow2: u8, vmar_flags: u32, vmo: RefPtr<VmObject>, vmo_offset: u64, arch_mmu_flags: ArchMmuFlags, name: &CStr, ) -> Result<MapResult, Status>
Creates a VmMapping within this region.
To avoid leaks, this should be paired with a call to VmMapping::destroy if desired;
dropping MapResult::mapping will not destroy the mapping.
Sourcepub fn destroy(&self) -> Result<(), Status>
pub fn destroy(&self) -> Result<(), Status>
Destroys this region and recursively destroys child VMARs.
Sourcepub fn has_parent(&self) -> bool
pub fn has_parent(&self) -> bool
Returns true if this region has a parent region.
Sourcepub fn set_memory_priority(
&self,
priority: MemoryPriority,
) -> Result<(), Status>
pub fn set_memory_priority( &self, priority: MemoryPriority, ) -> Result<(), Status>
Applies the given memory priority to this region and all subregions.
Sourcepub unsafe fn unmap(
&self,
base: VAddr,
size: usize,
op_children: VmAddressRegionOpChildren,
) -> Result<(), Status>
pub unsafe fn unmap( &self, base: VAddr, size: usize, op_children: VmAddressRegionOpChildren, ) -> Result<(), Status>
Unmaps a subset of the region of memory in the containing address space.
§Safety
Caller must ensure the specified virtual address region to unmap is no longer used.
Sourcepub fn protect(
&self,
base: VAddr,
size: usize,
new_arch_mmu_flags: ArchMmuFlags,
op_children: VmAddressRegionOpChildren,
) -> Result<(), Status>
pub fn protect( &self, base: VAddr, size: usize, new_arch_mmu_flags: ArchMmuFlags, op_children: VmAddressRegionOpChildren, ) -> Result<(), Status>
Changes protections on a subset of the region of memory in the containing address space.
Sourcepub fn reserve_space(
&self,
name: &CStr,
base: usize,
size: usize,
arch_mmu_flags: ArchMmuFlags,
) -> Result<(), Status>
pub fn reserve_space( &self, name: &CStr, base: usize, size: usize, arch_mmu_flags: ArchMmuFlags, ) -> Result<(), Status>
Reserves a memory region within this VMAR without allocating physical pages.
Trait Implementations§
Source§impl HasRefCount for VmAddressRegion
impl HasRefCount for VmAddressRegion
Source§fn ref_count(&self) -> &RefCounted
fn ref_count(&self) -> &RefCounted
RefCounted field.Source§impl Recyclable for VmAddressRegion
impl Recyclable for VmAddressRegion
Auto Trait Implementations§
impl Freeze for VmAddressRegion
impl RefUnwindSafe for VmAddressRegion
impl Send for VmAddressRegion
impl Sync for VmAddressRegion
impl !Unpin for VmAddressRegion
impl UnsafeUnpin for VmAddressRegion
impl UnwindSafe for VmAddressRegion
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Init<T> for T
impl<T> Init<T> for T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read more