pub fn sys_interrupt_create(
        &self,
        resource: HandleValue,
        src_num: usize,
        options: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "interrupt.create: handle={:?} src_num={:?} options={:?}",
            resource, src_num, options
        );
        let proc = self.thread.proc();
        let options = InterruptOptions::from_bits_truncate(options);
        let interrupt = if options.contains(InterruptOptions::VIRTUAL) {
            if options != InterruptOptions::VIRTUAL {
                return Err(ZxError::INVALID_ARGS);
            }
            Interrupt::new_virtual()
        } else {
            let resource = proc.get_object::<Resource>(resource)?;
            resource.validate_ranged_resource(ResourceKind::IRQ, src_num, 1)?;
            Interrupt::new_physical(src_num, options)?
        };
        let handle = proc.add_handle(Handle::new(interrupt, Rights::DEFAULT_INTERRUPT));
        out.write(handle)?;
        Ok(())
    }
/// Creates an interrupt object which represents a physical or virtual interrupt.
Creates an interrupt object which represents a physical or virtual interrupt.
Creates an interrupt object which represents a physical or virtual interrupt .
pub fn sys_interrupt_create(
        &self,
        resource: HandleValue,
        src_num: usize,
        options: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "interrupt.create: handle={:?} src_num={:?} options={:?}",
            resource, src_num, options
        );
        let proc = self.thread.proc();
        let options = InterruptOptions::from_bits_truncate(options);
        let interrupt = if options.contains(InterruptOptions::VIRTUAL) {
            if options != InterruptOptions::VIRTUAL {
                return Err(ZxError::INVALID_ARGS);
            }
            Interrupt::new_virtual()
        } else {
            let resource = proc.get_object::<Resource>(resource)?;
            resource.validate_ranged_resource(ResourceKind::IRQ, src_num, 1)?;
            Interrupt::new_physical(src_num, options)?
        };
        let handle = proc.add_handle(Handle::new(interrupt, Rights::DEFAULT_INTERRUPT));
        out.write(handle)?;
        Ok(())
    }
pub fn sys_interrupt_create ( & self , resource : HandleValue , src_num : usize , options : u32 , mut out : UserOutPtr < HandleValue > , ) -> ZxResult { info ! ( " " resource src_num options ) ; let proc = self . thread . proc ( ) ; let options = InterruptOptions :: from_bits_truncate ( options ) ; let interrupt = if options . contains ( InterruptOptions :: VIRTUAL ) { if options != InterruptOptions :: VIRTUAL { return Err ( ZxError :: INVALID_ARGS ) ; } Interrupt :: new_virtual ( ) } else { let resource = proc . get_object :: < Resource > ( resource ) ? ; resource . validate_ranged_resource ( ResourceKind :: IRQ , src_num , 1 ) ? ; Interrupt :: new_physical ( src_num , options ) ? } ; let handle = proc . add_handle ( Handle :: new ( interrupt , Rights :: DEFAULT_INTERRUPT ) ) ; out . write ( handle ) ? ; Ok ( ( ) ) }
Creates an interrupt object which represents a physical or virtual interrupt.
Creates an interrupt object which represents a physical or virtual interrupt .
&self
resource
HandleValue
src_num
usize
options
u32
out
UserOutPtr<HandleValue>
&self
resource
HandleValue
src_num
usize
options
u32
out
UserOutPtr<HandleValue>