XilinxProcessorIPLib/drivers/intc/src/xintc_l.c
void XIntc_RegisterHandler(UINTPTR BaseAddress, int InterruptId,
			   XInterruptHandler Handler, void *CallBackRef)
{
	XIntc_Config *CfgPtr;

	CfgPtr = LookupConfigByBaseAddress(BaseAddress);

	if (CfgPtr != NULL) {

		if (InterruptId > 31) {
			CfgPtr = XIntc_LookupConfig(InterruptId/32);
			if (CfgPtr == NULL) {
				return;
			}
			CfgPtr->HandlerTable[InterruptId%32].Handler = Handler;
			CfgPtr->HandlerTable[InterruptId%32].CallBackRef =
								CallBackRef;
		}
		else {
			CfgPtr->HandlerTable[InterruptId].Handler = Handler;
			CfgPtr->HandlerTable[InterruptId].CallBackRef =
								CallBackRef;
		}
	}
}
/*****************************************************************************/
/**
*
* Register a handler function for a specific interrupt ID.  The vector table
* of the interrupt controller is updated, overwriting any previous handler.
* The handler function will be called when an interrupt occurs for the given
* interrupt ID.
*
* This function can also be used to remove a handler from the vector table
* by passing in the XIntc_DefaultHandler() as the handler and NULL as the
* callback reference.
* In Cascade mode Interrupt Id is used to set Handler for corresponding Slave
* Controller
*
* @param 	BaseAddress is the base address of the interrupt controller
*		whose vector table will be modified.
* @param 	InterruptId is the interrupt ID to be associated with the input
*		handler.
* @param 	Handler is the function pointer that will be added to
*		the vector table for the given interrupt ID.
* @param	CallBackRef is the argument that will be passed to the new
*		handler function when it is called. This is user-specific.
*
* @return	None.
*
* @note
*
* This function has no effect if the input base address is invalid.
* Following fields in XIntc_Config impacts interrupt handling,
* 		1. AckBeforeService: If 1, primary interrupt handler acks
* 							 interrupt before servicing it, else it would
* 							 ack interrupt after servicing it (after calling
*							 interrupt ID specific handler)
* 		2. Options:
* 			XIN_SVC_SGL_ISR_OPTION - primary interrupt handler services the
* 								 highest priority pending interrupt and return
* 			XIN_SVC_ALL_ISRS_OPTION - primary interrupt handler services all
* 								 of the pending interrupts and then return
*
******************************************************************************/
Register a handler function for a specific interrupt ID.  The vector table
of the interrupt controller is updated, overwriting any previous handler.
The handler function will be called when an interrupt occurs for the given
interrupt ID.

This function can also be used to remove a handler from the vector table
by passing in the XIntc_DefaultHandler() as the handler and NULL as the
callback reference.
In Cascade mode Interrupt Id is used to set Handler for corresponding Slave
Controller
Register a handler function for a specific interrupt ID . The vector table of the interrupt controller is updated overwriting any previous handler . The handler function will be called when an interrupt occurs for the given interrupt ID . This function can also be used to remove a handler from the vector table by passing in the XIntc_DefaultHandler () as the handler and NULL as the callback reference . In Cascade mode Interrupt Id is used to set Handler for corresponding Slave Controller
void XIntc_RegisterHandler(UINTPTR BaseAddress, int InterruptId,
			   XInterruptHandler Handler, void *CallBackRef)
{
	XIntc_Config *CfgPtr;
	CfgPtr = LookupConfigByBaseAddress(BaseAddress);
	if (CfgPtr != NULL) {
		if (InterruptId > 31) {
			CfgPtr = XIntc_LookupConfig(InterruptId/32);
			if (CfgPtr == NULL) {
				return;
			}
			CfgPtr->HandlerTable[InterruptId%32].Handler = Handler;
			CfgPtr->HandlerTable[InterruptId%32].CallBackRef =
								CallBackRef;
		}
		else {
			CfgPtr->HandlerTable[InterruptId].Handler = Handler;
			CfgPtr->HandlerTable[InterruptId].CallBackRef =
								CallBackRef;
		}
	}
}
void XIntc_RegisterHandler ( UINTPTR BaseAddress , int InterruptId , XInterruptHandler Handler , void * CallBackRef ) { XIntc_Config * CfgPtr ; CfgPtr = LookupConfigByBaseAddress ( BaseAddress ) ; if ( CfgPtr != NULL ) { if ( InterruptId > 31 ) { CfgPtr = XIntc_LookupConfig ( InterruptId / 32 ) ; if ( CfgPtr == NULL ) { return ; } CfgPtr -> HandlerTable [ InterruptId % 32 ] . Handler = Handler ; CfgPtr -> HandlerTable [ InterruptId % 32 ] . CallBackRef = CallBackRef ; } else { CfgPtr -> HandlerTable [ InterruptId ] . Handler = Handler ; CfgPtr -> HandlerTable [ InterruptId ] . CallBackRef = CallBackRef ; } } }
Register a handler function for a specific interrupt ID.
Register a handler function for a specific interrupt ID .