XilinxProcessorIPLib/drivers/aiengine/src/lib/ext/xaieio.c
int XAieIO_IntrRegisterIsr(int Offset, int (*Handler) (void *Data), void *Data)
{
	int ret;

	XAieIO_Init();

	/* Only one interrupt is supported at the moment */
	if (Offset == 0 || IOInst.isr.handler) {
		XAieIO_Finish();
		return XAIELIB_FAILURE;
	}

	/*
	 * Register the handler with global instance. This limits that only one
	 * handler can be registered.
	 */
	IOInst.isr.handler = Handler;
	IOInst.isr.data = Data;
	ret = metal_irq_register((int)IOInst.device->irq_info,
			XAieIO_IntrHandler, Handler);
	if (ret) {
		XAieIO_Finish();
		return XAIELIB_FAILURE;
	}

	metal_irq_enable((int)IOInst.device->irq_info);

	return XAIELIB_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function registers the interrupt handler for given irq offset.
*
* @param	Offset: The value should one of 1 - 3. Current it's not used.
* @param	Handler: the callback to be called upon interrupt.
* @param	Data: the data to be used with the handler.
*
* @return	XAIELIB_SUCCESS for success, XAIELIB_FAILURE otherwise.
*
* @note		The driver doesn't support all 4 interrupts yet, so the offset
* is not used. The handler is registerd as global one, so it isn't allowed to
* register more than one handlers.
*
*******************************************************************************/
This function registers the interrupt handler for given irq offset.
This function registers the interrupt handler for given irq offset .
int XAieIO_IntrRegisterIsr(int Offset, int (*Handler) (void *Data), void *Data)
{
	int ret;
	XAieIO_Init();
	if (Offset == 0 || IOInst.isr.handler) {
		XAieIO_Finish();
		return XAIELIB_FAILURE;
	}
	IOInst.isr.handler = Handler;
	IOInst.isr.data = Data;
	ret = metal_irq_register((int)IOInst.device->irq_info,
			XAieIO_IntrHandler, Handler);
	if (ret) {
		XAieIO_Finish();
		return XAIELIB_FAILURE;
	}
	metal_irq_enable((int)IOInst.device->irq_info);
	return XAIELIB_SUCCESS;
}
int XAieIO_IntrRegisterIsr ( int Offset , int ( * Handler ) ( void * Data ) , void * Data ) { int ret ; XAieIO_Init ( ) ; if ( Offset == 0 || IOInst . isr . handler ) { XAieIO_Finish ( ) ; return XAIELIB_FAILURE ; } IOInst . isr . handler = Handler ; IOInst . isr . data = Data ; ret = metal_irq_register ( ( int ) IOInst . device -> irq_info , XAieIO_IntrHandler , Handler ) ; if ( ret ) { XAieIO_Finish ( ) ; return XAIELIB_FAILURE ; } metal_irq_enable ( ( int ) IOInst . device -> irq_info ) ; return XAIELIB_SUCCESS ; }
This function registers the interrupt handler for given irq offset.
This function registers the interrupt handler for given irq offset .
/* Only one interrupt is supported at the moment */ /*
	 * Register the handler with global instance. This limits that only one
	 * handler can be registered.
	 */