pub fn sys_bti_pin(
        &self,
        bti: HandleValue,
        options: u32,
        vmo: HandleValue,
        offset: usize,
        size: usize,
        mut addrs: UserOutPtr<DevVAddr>,
        addrs_count: usize,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        let options = BtiOptions::from_bits_truncate(options);
        info!(
            "bti.pin: bti={:#x}, options={:?}, vmo={:#x}, offset={:#x}, size={:#x}, addrs={:#x?}, addrs_count={:#x}",
            bti, options, vmo, offset, size, addrs, addrs_count
        );
        let proc = self.thread.proc();
        let bti = proc.get_object_with_rights::<BusTransactionInitiator>(bti, Rights::MAP)?;
        if !page_aligned(offset) || !page_aligned(size) {
            return Err(ZxError::INVALID_ARGS);
        }
        let vmo = proc.get_object_with_rights::<VmObject>(vmo, options.to_vmo_rights())?;
        let compress_results = options.contains(BtiOptions::COMPRESS);
        let contiguous = options.contains(BtiOptions::CONTIGUOUS);
        if contiguous && (compress_results || !vmo.is_contiguous()) {
            return Err(ZxError::INVALID_ARGS);
        }
        let pmt = bti.pin(vmo, offset, size, options.to_iommu_perms())?;
        let encoded_addrs = pmt.encode_addrs(compress_results, contiguous)?;
        if encoded_addrs.len() != addrs_count {
            warn!(
                "bti.pin addrs_count = {}, but encoded_addrs.len = {}",
                addrs_count,
                encoded_addrs.len()
            );
            return Err(ZxError::INVALID_ARGS);
        }
        addrs.write_array(&encoded_addrs)?;
        let handle = proc.add_handle(Handle::new(pmt, Rights::INSPECT));
        out.write(handle)?;
        Ok(())
    }
/// Pin pages and grant devices access to them.
Pin pages and grant devices access to them.
Pin pages and grant devices access to them .
pub fn sys_bti_pin(
        &self,
        bti: HandleValue,
        options: u32,
        vmo: HandleValue,
        offset: usize,
        size: usize,
        mut addrs: UserOutPtr<DevVAddr>,
        addrs_count: usize,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        let options = BtiOptions::from_bits_truncate(options);
        info!(
            "bti.pin: bti={:#x}, options={:?}, vmo={:#x}, offset={:#x}, size={:#x}, addrs={:#x?}, addrs_count={:#x}",
            bti, options, vmo, offset, size, addrs, addrs_count
        );
        let proc = self.thread.proc();
        let bti = proc.get_object_with_rights::<BusTransactionInitiator>(bti, Rights::MAP)?;
        if !page_aligned(offset) || !page_aligned(size) {
            return Err(ZxError::INVALID_ARGS);
        }
        let vmo = proc.get_object_with_rights::<VmObject>(vmo, options.to_vmo_rights())?;
        let compress_results = options.contains(BtiOptions::COMPRESS);
        let contiguous = options.contains(BtiOptions::CONTIGUOUS);
        if contiguous && (compress_results || !vmo.is_contiguous()) {
            return Err(ZxError::INVALID_ARGS);
        }
        let pmt = bti.pin(vmo, offset, size, options.to_iommu_perms())?;
        let encoded_addrs = pmt.encode_addrs(compress_results, contiguous)?;
        if encoded_addrs.len() != addrs_count {
            warn!(
                "bti.pin addrs_count = {}, but encoded_addrs.len = {}",
                addrs_count,
                encoded_addrs.len()
            );
            return Err(ZxError::INVALID_ARGS);
        }
        addrs.write_array(&encoded_addrs)?;
        let handle = proc.add_handle(Handle::new(pmt, Rights::INSPECT));
        out.write(handle)?;
        Ok(())
    }
pub fn sys_bti_pin ( & self , bti : HandleValue , options : u32 , vmo : HandleValue , offset : usize , size : usize , mut addrs : UserOutPtr < DevVAddr > , addrs_count : usize , mut out : UserOutPtr < HandleValue > , ) -> ZxResult { let options = BtiOptions :: from_bits_truncate ( options ) ; info ! ( " " bti options vmo offset size addrs addrs_count ) ; let proc = self . thread . proc ( ) ; let bti = proc . get_object_with_rights :: < BusTransactionInitiator > ( bti , Rights :: MAP ) ? ; if ! page_aligned ( offset ) || ! page_aligned ( size ) { return Err ( ZxError :: INVALID_ARGS ) ; } let vmo = proc . get_object_with_rights :: < VmObject > ( vmo , options . to_vmo_rights ( ) ) ? ; let compress_results = options . contains ( BtiOptions :: COMPRESS ) ; let contiguous = options . contains ( BtiOptions :: CONTIGUOUS ) ; if contiguous && ( compress_results || ! vmo . is_contiguous ( ) ) { return Err ( ZxError :: INVALID_ARGS ) ; } let pmt = bti . pin ( vmo , offset , size , options . to_iommu_perms ( ) ) ? ; let encoded_addrs = pmt . encode_addrs ( compress_results , contiguous ) ? ; if encoded_addrs . len ( ) != addrs_count { warn ! ( " " addrs_count encoded_addrs len ( ) ) ; return Err ( ZxError :: INVALID_ARGS ) ; } addrs . write_array ( & encoded_addrs ) ? ; let handle = proc . add_handle ( Handle :: new ( pmt , Rights :: INSPECT ) ) ; out . write ( handle ) ? ; Ok ( ( ) ) }
Pin pages and grant devices access to them.
Pin pages and grant devices access to them .
&self
bti
HandleValue
options
u32
vmo
HandleValue
offset
usize
size
usize
addrs
UserOutPtr<DevVAddr>
addrs_count
usize
out
UserOutPtr<HandleValue>
&self
bti
HandleValue
options
u32
vmo
HandleValue
offset
usize
size
usize
addrs
UserOutPtr<DevVAddr>
addrs_count
usize
out
UserOutPtr<HandleValue>