pub trait VMObjectTrait: Sync + Send {
Show 22 methods fn read(&self, offset: usize, buf: &mut [u8]) -> ZxResult; fn write(&self, offset: usize, buf: &[u8]) -> ZxResult; fn zero(&self, offset: usize, len: usize) -> ZxResult; fn len(&self) -> usize; fn set_len(&self, len: usize) -> ZxResult; fn commit_page(&self, page_idx: usize, flags: MMUFlags) -> ZxResult<PhysAddr>; fn commit_pages_with(
        &self,
        f: &mut dyn FnMut(&mut dyn FnMut(usize, MMUFlags) -> ZxResult<PhysAddr>) -> ZxResult
    ) -> ZxResult; fn commit(&self, offset: usize, len: usize) -> ZxResult; fn decommit(&self, offset: usize, len: usize) -> ZxResult; fn create_child(
        &self,
        offset: usize,
        len: usize
    ) -> ZxResult<Arc<dyn VMObjectTrait>>; fn complete_info(&self, info: &mut VmoInfo); fn cache_policy(&self) -> CachePolicy; fn set_cache_policy(&self, policy: CachePolicy) -> ZxResult; fn committed_pages_in_range(&self, start_idx: usize, end_idx: usize) -> usize; fn append_mapping(&self, _mapping: Weak<VmMapping>) { ... } fn remove_mapping(&self, _mapping: Weak<VmMapping>) { ... } fn pin(&self, _offset: usize, _len: usize) -> ZxResult { ... } fn unpin(&self, _offset: usize, _len: usize) -> ZxResult { ... } fn is_contiguous(&self) -> bool { ... } fn is_paged(&self) -> bool { ... } fn as_mut_buf(&self) -> ZxResult<(MutexGuard<'_, ()>, &mut [u8])> { ... } fn unset_contiguous(&self) { ... }
}
Expand description

Virtual Memory Object Trait

Required Methods

Read memory to buf from VMO at offset.

Write memory from buf to VMO at offset.

Resets the range of bytes in the VMO from offset to offset+len to 0.

Get the length of VMO.

Set the length of VMO.

Commit a page.

Commit pages with an external function f. the vmo is internally locked before it calls f, allowing VmMapping to avoid deadlock

Commit allocating physical memory.

Decommit allocated physical memory.

Create a child VMO.

Complete the VmoInfo.

Get the cache policy.

Set the cache policy.

Count committed pages of the VMO.

Provided Methods

Append a mapping to the VMO’s mapping list.

Remove a mapping from the VMO’s mapping list.

Pin the given range of the VMO.

Unpin the given range of the VMO.

Returns true if the object is backed by a contiguous range of physical memory.

Returns true if the object is backed by RAM.

If contiguous, transmute vmo to a mutable buffer

Mark as not contiguous

Implementors