pub fn sys_vmo_create_contiguous(
        &self,
        bti: HandleValue,
        size: usize,
        align_log2: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "vmo.create_contiguous: handle={:#x?}, size={:#x?}, align={}, out={:#x?}",
            bti, size, align_log2, out
        );
        if size == 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let align_log2 = if align_log2 == 0 {
            PAGE_SIZE_LOG2
        } else {
            align_log2 as usize
        };
        if align_log2 < PAGE_SIZE_LOG2 || align_log2 >= 8 * core::mem::size_of::<usize>() {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        proc.check_policy(PolicyCondition::NewVMO)?;
        let _bti = proc.get_object_with_rights::<BusTransactionInitiator>(bti, Rights::MAP)?;
        let vmo = VmObject::new_contiguous(pages(size), align_log2)?;
        let handle_value = proc.add_handle(Handle::new(vmo, Rights::DEFAULT_VMO));
        out.write(handle_value)?;
        Ok(())
    }
/// Create a VM object referring to a specific contiguous range of physical frame.
Create a VM object referring to a specific contiguous range of physical frame.
Create a VM object referring to a specific contiguous range of physical frame .
pub fn sys_vmo_create_contiguous(
        &self,
        bti: HandleValue,
        size: usize,
        align_log2: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "vmo.create_contiguous: handle={:#x?}, size={:#x?}, align={}, out={:#x?}",
            bti, size, align_log2, out
        );
        if size == 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let align_log2 = if align_log2 == 0 {
            PAGE_SIZE_LOG2
        } else {
            align_log2 as usize
        };
        if align_log2 < PAGE_SIZE_LOG2 || align_log2 >= 8 * core::mem::size_of::<usize>() {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        proc.check_policy(PolicyCondition::NewVMO)?;
        let _bti = proc.get_object_with_rights::<BusTransactionInitiator>(bti, Rights::MAP)?;
        let vmo = VmObject::new_contiguous(pages(size), align_log2)?;
        let handle_value = proc.add_handle(Handle::new(vmo, Rights::DEFAULT_VMO));
        out.write(handle_value)?;
        Ok(())
    }
pub fn sys_vmo_create_contiguous ( & self , bti : HandleValue , size : usize , align_log2 : u32 , mut out : UserOutPtr < HandleValue > , ) -> ZxResult { info ! ( " " bti size align_log2 out ) ; if size == 0 { return Err ( ZxError :: INVALID_ARGS ) ; } let align_log2 = if align_log2 == 0 { PAGE_SIZE_LOG2 } else { align_log2 as usize } ; if align_log2 < PAGE_SIZE_LOG2 || align_log2 >= 8 * core :: mem :: size_of :: < usize > ( ) { return Err ( ZxError :: INVALID_ARGS ) ; } let proc = self . thread . proc ( ) ; proc . check_policy ( PolicyCondition :: NewVMO ) ? ; let _bti = proc . get_object_with_rights :: < BusTransactionInitiator > ( bti , Rights :: MAP ) ? ; let vmo = VmObject :: new_contiguous ( pages ( size ) , align_log2 ) ? ; let handle_value = proc . add_handle ( Handle :: new ( vmo , Rights :: DEFAULT_VMO ) ) ; out . write ( handle_value ) ? ; Ok ( ( ) ) }
Create a VM object referring to a specific contiguous range of physical frame.
Create a VM object referring to a specific contiguous range of physical frame .
&self
bti
HandleValue
size
usize
align_log2
u32
out
UserOutPtr<HandleValue>
&self
bti
HandleValue
size
usize
align_log2
u32
out
UserOutPtr<HandleValue>