pub fn sys_vmo_op_range(
        &self,
        handle_value: HandleValue,
        op: u32,
        offset: usize,
        len: usize,
        _buffer: UserOutPtr<u8>,
        _buffer_size: usize,
    ) -> ZxResult {
        info!(
            "vmo.op_range: handle={:#x}, op={:#X}, offset={:#x}, len={:#x}, buffer_size={:#x}",
            handle_value, op, offset, len, _buffer_size,
        );
        let op = VmoOpType::try_from(op).or(Err(ZxError::INVALID_ARGS))?;
        let proc = self.thread.proc();
        let (vmo, rights) = proc.get_object_and_rights::<VmObject>(handle_value)?;
        match op {
            VmoOpType::Commit => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                if !page_aligned(offset) || !page_aligned(len) {
                    return Err(ZxError::INVALID_ARGS);
                }
                vmo.commit(offset, len)?;
                Ok(())
            }
            VmoOpType::Decommit => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                if !page_aligned(offset) || !page_aligned(len) {
                    return Err(ZxError::INVALID_ARGS);
                }
                vmo.decommit(offset, len)
            }
            VmoOpType::Zero => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                vmo.zero(offset, len)
            }
            _ => unimplemented!(),
        }
    }
/// Perform an operation on a range of a VMO.
///
/// Performs cache and memory operations against pages held by the VMO.
Perform an operation on a range of a VMO.
Performs cache and memory operations against pages held by the VMO.
Perform an operation on a range of a VMO . Performs cache and memory operations against pages held by the VMO .
pub fn sys_vmo_op_range(
        &self,
        handle_value: HandleValue,
        op: u32,
        offset: usize,
        len: usize,
        _buffer: UserOutPtr<u8>,
        _buffer_size: usize,
    ) -> ZxResult {
        info!(
            "vmo.op_range: handle={:#x}, op={:#X}, offset={:#x}, len={:#x}, buffer_size={:#x}",
            handle_value, op, offset, len, _buffer_size,
        );
        let op = VmoOpType::try_from(op).or(Err(ZxError::INVALID_ARGS))?;
        let proc = self.thread.proc();
        let (vmo, rights) = proc.get_object_and_rights::<VmObject>(handle_value)?;
        match op {
            VmoOpType::Commit => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                if !page_aligned(offset) || !page_aligned(len) {
                    return Err(ZxError::INVALID_ARGS);
                }
                vmo.commit(offset, len)?;
                Ok(())
            }
            VmoOpType::Decommit => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                if !page_aligned(offset) || !page_aligned(len) {
                    return Err(ZxError::INVALID_ARGS);
                }
                vmo.decommit(offset, len)
            }
            VmoOpType::Zero => {
                if !rights.contains(Rights::WRITE) {
                    return Err(ZxError::ACCESS_DENIED);
                }
                vmo.zero(offset, len)
            }
            _ => unimplemented!(),
        }
    }
pub fn sys_vmo_op_range ( & self , handle_value : HandleValue , op : u32 , offset : usize , len : usize , _buffer : UserOutPtr < u8 > , _buffer_size : usize , ) -> ZxResult { info ! ( " " handle_value op offset len _buffer_size ) ; let op = VmoOpType :: try_from ( op ) . or ( Err ( ZxError :: INVALID_ARGS ) ) ? ; let proc = self . thread . proc ( ) ; let ( vmo , rights ) = proc . get_object_and_rights :: < VmObject > ( handle_value ) ? ; match op { VmoOpType :: Commit => { if ! rights . contains ( Rights :: WRITE ) { return Err ( ZxError :: ACCESS_DENIED ) ; } if ! page_aligned ( offset ) || ! page_aligned ( len ) { return Err ( ZxError :: INVALID_ARGS ) ; } vmo . commit ( offset , len ) ? ; Ok ( ( ) ) } VmoOpType :: Decommit => { if ! rights . contains ( Rights :: WRITE ) { return Err ( ZxError :: ACCESS_DENIED ) ; } if ! page_aligned ( offset ) || ! page_aligned ( len ) { return Err ( ZxError :: INVALID_ARGS ) ; } vmo . decommit ( offset , len ) } VmoOpType :: Zero => { if ! rights . contains ( Rights :: WRITE ) { return Err ( ZxError :: ACCESS_DENIED ) ; } vmo . zero ( offset , len ) } _ => unimplemented ! ( ) , } }
Perform an operation on a range of a VMO.
Perform an operation on a range of a VMO .
&self
handle_value
HandleValue
op
u32
offset
usize
len
usize
_buffer
UserOutPtr<u8>
_buffer_size
usize
&self
handle_value
HandleValue
op
u32
offset
usize
len
usize
_buffer
UserOutPtr<u8>
_buffer_size
usize