Trait zircon_object::vm::VMObjectTrait[][src]

pub trait VMObjectTrait: Sync + Send {
    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 { ... } }

Virtual Memory Object Trait

Required methods

fn read(&self, offset: usize, buf: &mut [u8]) -> ZxResult[src]

Read memory to buf from VMO at offset.

fn write(&self, offset: usize, buf: &[u8]) -> ZxResult[src]

Write memory from buf to VMO at offset.

fn zero(&self, offset: usize, len: usize) -> ZxResult[src]

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

fn len(&self) -> usize[src]

Get the length of VMO.

fn set_len(&self, len: usize) -> ZxResult[src]

Set the length of VMO.

fn commit_page(&self, page_idx: usize, flags: MMUFlags) -> ZxResult<PhysAddr>[src]

Commit a page.

fn commit_pages_with(
    &self,
    f: &mut dyn FnMut(&mut dyn FnMut(usize, MMUFlags) -> ZxResult<PhysAddr>) -> ZxResult
) -> ZxResult
[src]

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

fn commit(&self, offset: usize, len: usize) -> ZxResult[src]

Commit allocating physical memory.

fn decommit(&self, offset: usize, len: usize) -> ZxResult[src]

Decommit allocated physical memory.

fn create_child(
    &self,
    offset: usize,
    len: usize
) -> ZxResult<Arc<dyn VMObjectTrait>>
[src]

Create a child VMO.

fn complete_info(&self, info: &mut VmoInfo)[src]

Complete the VmoInfo.

fn cache_policy(&self) -> CachePolicy[src]

Get the cache policy.

fn set_cache_policy(&self, policy: CachePolicy) -> ZxResult[src]

Set the cache policy.

fn committed_pages_in_range(&self, start_idx: usize, end_idx: usize) -> usize[src]

Count committed pages of the VMO.

Loading content...

Provided methods

fn append_mapping(&self, _mapping: Weak<VmMapping>)[src]

Append a mapping to the VMO’s mapping list.

fn remove_mapping(&self, _mapping: Weak<VmMapping>)[src]

Remove a mapping from the VMO’s mapping list.

fn pin(&self, _offset: usize, _len: usize) -> ZxResult[src]

Pin the given range of the VMO.

fn unpin(&self, _offset: usize, _len: usize) -> ZxResult[src]

Unpin the given range of the VMO.

fn is_contiguous(&self) -> bool[src]

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

fn is_paged(&self) -> bool[src]

Returns true if the object is backed by RAM.

Loading content...

Implementors

Loading content...