sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * xocl_user_event() - Interrupt service routine for MB interrupts
 *
 * Called by xocl_xdma_user_isr() which is our stub for user ISR registered with libxdma
 * Kernel doc says eventfd_signal() does not sleep so it should be okay to call this in ISR
 * TODO: Add support for locking so xdev->user_msix_table[irq] is not deleted/changed by
 * xocl_user_intr_ioctl() while we are using it.
 */
Interrupt service routine for MB interrupts
Called by xocl_xdma_user_isr() which is our stub for user ISR registered with libxdma
Kernel doc says eventfd_signal() does not sleep so it should be okay to call this in ISR
TODO: Add support for locking so xdev->user_msix_table[irq] is not deleted/changed by
xocl_user_intr_ioctl() while we are using it.
Interrupt service routine for MB interrupts Called by xocl_xdma_user_isr () which is our stub for user ISR registered with libxdma Kernel doc says eventfd_signal () does not sleep so it should be okay to call this in ISR TODO : Add support for locking so xdev - > user_msix_table [ irq ] is not deleted / changed by xocl_user_intr_ioctl () while we are using it .
int
xocl_user_event(int irq, struct drm_xocl_dev *xdev)
{
	SCHED_DEBUGF("xocl_user_event %d\n",irq);
	if (irq>=XOCL_CSR_INTR0 && irq<=XOCL_CSR_INTR3 && is_ert(xdev) && !xdev->exec.polling_mode) {
		if (irq==0)
			atomic_set(&xdev->exec.sr0,1);
		else if (irq==1)
			atomic_set(&xdev->exec.sr1,1);
		else if (irq==2)
			atomic_set(&xdev->exec.sr2,1);
		else if (irq==3)
			atomic_set(&xdev->exec.sr3,1);
		atomic_set(&global_scheduler0.intc,1);
		wake_up_interruptible(&global_scheduler0.wait_queue);
		return 0;
	}
	if (!xdev->exec.user_msix_table[irq])
		return -EFAULT;
	if (eventfd_signal(xdev->exec.user_msix_table[irq], 1) == 1)
		return 0;
	return -EFAULT;
}
int xocl_user_event ( int irq , struct drm_xocl_dev * xdev ) { SCHED_DEBUGF ( " \n " , irq ) ; if ( irq >= XOCL_CSR_INTR0 && irq <= XOCL_CSR_INTR3 && is_ert ( xdev ) && ! xdev -> exec . polling_mode ) { if ( irq == 0 ) atomic_set ( & xdev -> exec . sr0 , 1 ) ; else if ( irq == 1 ) atomic_set ( & xdev -> exec . sr1 , 1 ) ; else if ( irq == 2 ) atomic_set ( & xdev -> exec . sr2 , 1 ) ; else if ( irq == 3 ) atomic_set ( & xdev -> exec . sr3 , 1 ) ; atomic_set ( & global_scheduler0 . intc , 1 ) ; wake_up_interruptible ( & global_scheduler0 . wait_queue ) ; return 0 ; } if ( ! xdev -> exec . user_msix_table [ irq ] ) return - EFAULT ; if ( eventfd_signal ( xdev -> exec . user_msix_table [ irq ] , 1 ) == 1 ) return 0 ; return - EFAULT ; }
xocl_user_event() - Interrupt service routine for MB interrupts
 Called by xocl_xdma_user_isr() which is our stub for user ISR registered with libxdma
 Kernel doc says eventfd_signal() does not sleep so it should be okay to call this in ISR
 TODO: Add support for locking so xdev->user_msix_table[irq] is not deleted/changed by
 xocl_user_intr_ioctl() while we are using it.
xocl_user_event () - Interrupt service routine for MB interrupts Called by xocl_xdma_user_isr () which is our stub for user ISR registered with libxdma Kernel doc says eventfd_signal () does not sleep so it should be okay to call this in ISR TODO : Add support for locking so xdev - > user_msix_table [ irq ] is not deleted / changed by xocl_user_intr_ioctl () while we are using it .
/* wake up all scheduler ... currently one only */