Struct magenta::Vmo
[−]
[src]
pub struct Vmo(_);
An object representing a Magenta virtual memory object.
As essentially a subtype of Handle
, it can be freely interconverted.
Methods
impl Vmo
[src]
fn create(size: u64, options: VmoOpts) -> Result<Vmo, Status>
Create a virtual memory object.
Wraps the
mx_vmo_create
syscall. See the
Shared Memory: Virtual Memory Objects (VMOs)
for more information.
fn read(&self, data: &mut [u8], offset: u64) -> Result<usize, Status>
Read from a virtual memory object.
Wraps the mx_vmo_read
syscall.
fn write(&self, data: &[u8], offset: u64) -> Result<usize, Status>
Write to a virtual memory object.
Wraps the mx_vmo_write
syscall.
fn get_size(&self) -> Result<u64, Status>
Get the size of a virtual memory object.
Wraps the mx_vmo_get_size
syscall.
fn set_size(&self, size: u64) -> Result<(), Status>
Attempt to change the size of a virtual memory object.
Wraps the mx_vmo_set_size
syscall.
fn op_range(&self, op: VmoOp, offset: u64, size: u64) -> Result<(), Status>
Perform an operation on a range of a virtual memory object.
Wraps the mx_vmo_op_range syscall.
fn lookup(
&self,
offset: u64,
size: u64,
buffer: &mut [mx_paddr_t]
) -> Result<(), Status>
&self,
offset: u64,
size: u64,
buffer: &mut [mx_paddr_t]
) -> Result<(), Status>
Look up a list of physical addresses corresponding to the pages held by the VMO from
offset
to offset
+size
, and store them in buffer
.
Wraps the mx_vmo_op_range syscall with MX_VMO_OP_LOOKUP.
fn clone(
&self,
options: VmoCloneOpts,
offset: u64,
size: u64
) -> Result<Vmo, Status>
&self,
options: VmoCloneOpts,
offset: u64,
size: u64
) -> Result<Vmo, Status>
Create a new virtual memory object that clones a range of this one.
Wraps the mx_vmo_clone syscall.
Trait Implementations
impl Debug for Vmo
[src]
impl Eq for Vmo
[src]
impl PartialEq for Vmo
[src]
fn eq(&self, __arg_0: &Vmo) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vmo) -> bool
This method tests for !=
.
impl HandleBase for Vmo
[src]
fn get_ref(&self) -> HandleRef
Get a reference to the handle. One important use of such a reference is for object_wait_many
. Read more
fn from_handle(handle: Handle) -> Self
A method for converting an untyped Handle
into a more specific reference.
fn raw_handle(&self) -> mx_handle_t
Interpret the reference as a raw handle (an integer type). Two distinct handles will have different raw values (so it can perhaps be used as a key in a data structure). Read more
fn duplicate(&self, rights: Rights) -> Result<Self, Status>
Duplicate a handle, possibly reducing the rights available. Wraps the mx_handle_duplicate syscall. Read more
fn replace(self, rights: Rights) -> Result<Self, Status>
Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the mx_handle_replace syscall. Read more
fn signal(&self, clear_mask: Signals, set_mask: Signals) -> Result<(), Status>
Set and clear userspace-accessible signal bits on an object. Wraps the mx_object_signal syscall. Read more
fn wait(&self, signals: Signals, deadline: mx_time_t) -> Result<Signals, Status>
Waits on a handle. Wraps the mx_object_wait_one syscall. Read more
fn wait_async(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
Causes packet delivery on the given port when the object changes state and matches signals. mx_object_wait_async syscall. Read more
fn into_handle(self) -> Handle
A method for converting the object into a generic Handle.