pub struct VmMapping { /* private fields */ }Expand description
A leaf mapping that maps a VMO into the address space.
This is an opaque FFI wrapper around Zircon’s C++ VmMapping class.
Implementations§
Source§impl VmMapping
impl VmMapping
Sourcepub fn destroy(&self) -> Result<(), Status>
pub fn destroy(&self) -> Result<(), Status>
Destroys this mapping, unmapping all pages and removing dependencies on the underlying VMO.
Sourcepub fn object_offset(&self) -> u64
pub fn object_offset(&self) -> u64
Returns the offset into the underlying VMO for this mapping.
Sourcepub fn decommit_range(&self, offset: usize, len: usize) -> Result<(), Status>
pub fn decommit_range(&self, offset: usize, len: usize) -> Result<(), Status>
Convenience wrapper for vmo()->DecommitRange() with the necessary offset modification and locking.
Sourcepub fn map_range(
&self,
offset: usize,
len: usize,
commit: bool,
ignore_existing: bool,
) -> Result<(), Status>
pub fn map_range( &self, offset: usize, len: usize, commit: bool, ignore_existing: bool, ) -> Result<(), Status>
Map in pages from the underlying vm object, optionally committing pages as it goes. |ignore_existing| controls whether existing hardware mappings in the specified range should be ignored or treated as an error. |ignore_existing| should only be set to true for user mappings where populating mappings may already be racy with multiple threads, and where we are already tolerant of mappings being arbitrarily created and destroyed.
Sourcepub fn debug_unmap(&self, base: usize, size: usize) -> Result<(), Status>
pub fn debug_unmap(&self, base: usize, size: usize) -> Result<(), Status>
Unlocked convenience wrapper around unmap for testing.
Sourcepub fn debug_protect(
&self,
base: usize,
size: usize,
new_arch_mmu_flags: ArchMmuFlags,
) -> Result<(), Status>
pub fn debug_protect( &self, base: usize, size: usize, new_arch_mmu_flags: ArchMmuFlags, ) -> Result<(), Status>
Unlocked convenience wrapper around protect for testing.
Trait Implementations§
Source§impl HasRefCount for VmMapping
impl HasRefCount for VmMapping
Source§fn ref_count(&self) -> &RefCounted
fn ref_count(&self) -> &RefCounted
RefCounted field.Source§impl Recyclable for VmMapping
impl Recyclable for VmMapping
Auto Trait Implementations§
impl Freeze for VmMapping
impl RefUnwindSafe for VmMapping
impl Send for VmMapping
impl Sync for VmMapping
impl !Unpin for VmMapping
impl UnsafeUnpin for VmMapping
impl UnwindSafe for VmMapping
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