pub fn sys_iommu_create(
        &self,
        resource: HandleValue,
        type_: u32,
        desc: UserInPtr<u8>,
        desc_size: usize,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "iommu.create: resource={:#x}, type={:#x}, desc={:#x?} desc_size={:#x} out={:#x?}",
            resource, type_, desc, desc_size, out
        );
        let proc = self.thread.proc();
        proc.get_object::<Resource>(resource)?
            .validate(ResourceKind::ROOT)?;
        if desc_size > IOMMU_MAX_DESC_LEN {
            return Err(ZxError::INVALID_ARGS);
        }
        if desc_size != IOMMU_DESC_SIZE {
            return Err(ZxError::INVALID_ARGS);
        }
        if type_ != IOMMU_TYPE_DUMMY {
            unimplemented!("IOMMU {} is not implemented", type_);
        }
        let _copied_desc = desc.read_array(desc_size)?;
        let iommu = Iommu::create();
        let handle = proc.add_handle(Handle::new(iommu, Rights::DEFAULT_CHANNEL));
        info!("iommu handle value {:#x}", handle);
        out.write(handle)?;
        Ok(())
    }
/// Create a new object in the kernel representing an IOMMU device.
Create a new object in the kernel representing an IOMMU device.
Create a new object in the kernel representing an IOMMU device .
pub fn sys_iommu_create(
        &self,
        resource: HandleValue,
        type_: u32,
        desc: UserInPtr<u8>,
        desc_size: usize,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "iommu.create: resource={:#x}, type={:#x}, desc={:#x?} desc_size={:#x} out={:#x?}",
            resource, type_, desc, desc_size, out
        );
        let proc = self.thread.proc();
        proc.get_object::<Resource>(resource)?
            .validate(ResourceKind::ROOT)?;
        if desc_size > IOMMU_MAX_DESC_LEN {
            return Err(ZxError::INVALID_ARGS);
        }
        if desc_size != IOMMU_DESC_SIZE {
            return Err(ZxError::INVALID_ARGS);
        }
        if type_ != IOMMU_TYPE_DUMMY {
            unimplemented!("IOMMU {} is not implemented", type_);
        }
        let _copied_desc = desc.read_array(desc_size)?;
        let iommu = Iommu::create();
        let handle = proc.add_handle(Handle::new(iommu, Rights::DEFAULT_CHANNEL));
        info!("iommu handle value {:#x}", handle);
        out.write(handle)?;
        Ok(())
    }
pub fn sys_iommu_create ( & self , resource : HandleValue , type_ : u32 , desc : UserInPtr < u8 > , desc_size : usize , mut out : UserOutPtr < HandleValue > , ) -> ZxResult { info ! ( " " resource type_ desc desc_size out ) ; let proc = self . thread . proc ( ) ; proc . get_object :: < Resource > ( resource ) ? . validate ( ResourceKind :: ROOT ) ? ; if desc_size > IOMMU_MAX_DESC_LEN { return Err ( ZxError :: INVALID_ARGS ) ; } if desc_size != IOMMU_DESC_SIZE { return Err ( ZxError :: INVALID_ARGS ) ; } if type_ != IOMMU_TYPE_DUMMY { unimplemented ! ( " " type_ ) ; } let _copied_desc = desc . read_array ( desc_size ) ? ; let iommu = Iommu :: create ( ) ; let handle = proc . add_handle ( Handle :: new ( iommu , Rights :: DEFAULT_CHANNEL ) ) ; info ! ( " " handle ) ; out . write ( handle ) ? ; Ok ( ( ) ) }
Create a new object in the kernel representing an IOMMU device.
Create a new object in the kernel representing an IOMMU device .
&self
resource
HandleValue
type_
u32
desc
UserInPtr<u8>
desc_size
usize
out
UserOutPtr<HandleValue>
&self
resource
HandleValue
type_
u32
desc
UserInPtr<u8>
desc_size
usize
out
UserOutPtr<HandleValue>