XilinxProcessorIPLib/drivers/intc/src/xintc.c
void XIntc_Disconnect(XIntc * InstancePtr, u8 Id)
{
	u32 CurrentIER;
	u32 Mask;
	XIntc_Config *CfgPtr;

	/*
	 * Assert the arguments
	 */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Id < XPAR_INTC_MAX_NUM_INTR_INPUTS);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	/*
	 * Disable the interrupt such that it won't occur while disconnecting
	 * the handler, only disable the specified interrupt id without
	 * modifying the other interrupt ids
	 */

	/* Disconnect Handlers for Slave controllers in Cascade Mode */
	if (Id > 31) {

		CfgPtr = XIntc_LookupConfig(Id/32);
		if (CfgPtr == NULL) {
			return;
		}

		CurrentIER = XIntc_In32(CfgPtr->BaseAddress + XIN_IER_OFFSET);

		/* Convert from integer id to bit mask */
		Mask = XIntc_BitPosMask[(Id%32)];

		XIntc_Out32(CfgPtr->BaseAddress + XIN_IER_OFFSET,
					(CurrentIER & ~Mask));
		/*
		 * Disconnect the handler and connect a stub, the callback
		 * reference must be set to this instance to allow unhandled
		 * interrupts to be tracked
		 */
		CfgPtr->HandlerTable[Id%32].Handler = StubHandler;
		CfgPtr->HandlerTable[Id%32].CallBackRef = InstancePtr;
	}
	/* Disconnect Handlers for Master/primary controller */
	else {
		CurrentIER = XIntc_In32(InstancePtr->BaseAddress +
							XIN_IER_OFFSET);

		/* Convert from integer id to bit mask */
		Mask = XIntc_BitPosMask[Id];

		XIntc_Out32(InstancePtr->BaseAddress + XIN_IER_OFFSET,
					(CurrentIER & ~Mask));
		InstancePtr->CfgPtr->HandlerTable[Id%32].Handler =
								StubHandler;
		InstancePtr->CfgPtr->HandlerTable[Id%32].CallBackRef =
								InstancePtr;
	}

}
/*****************************************************************************/
/**
*
* Updates the interrupt table with the Null Handler and NULL arguments at the
* location pointed at by the Id. This effectively disconnects that interrupt
* source from any handler. The interrupt is disabled also. In Cascade mode,
* disconnects handler from Slave controller handler table depending on the
* interrupt Id.
*
* @param	InstancePtr is a pointer to the XIntc instance to be worked on.
* @param	Id contains the ID of the interrupt source and should be in the
*		range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being
*		the highest priority interrupt.
*
* @return	None.
*
* @note		None.
*
****************************************************************************/
Updates the interrupt table with the Null Handler and NULL arguments at the
location pointed at by the Id. This effectively disconnects that interrupt
source from any handler. The interrupt is disabled also. In Cascade mode,
disconnects handler from Slave controller handler table depending on the
interrupt Id.
Updates the interrupt table with the Null Handler and NULL arguments at the location pointed at by the Id . This effectively disconnects that interrupt source from any handler . The interrupt is disabled also . In Cascade mode disconnects handler from Slave controller handler table depending on the interrupt Id .
void XIntc_Disconnect(XIntc * InstancePtr, u8 Id)
{
	u32 CurrentIER;
	u32 Mask;
	XIntc_Config *CfgPtr;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Id < XPAR_INTC_MAX_NUM_INTR_INPUTS);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	if (Id > 31) {
		CfgPtr = XIntc_LookupConfig(Id/32);
		if (CfgPtr == NULL) {
			return;
		}
		CurrentIER = XIntc_In32(CfgPtr->BaseAddress + XIN_IER_OFFSET);
		Mask = XIntc_BitPosMask[(Id%32)];
		XIntc_Out32(CfgPtr->BaseAddress + XIN_IER_OFFSET,
					(CurrentIER & ~Mask));
		CfgPtr->HandlerTable[Id%32].Handler = StubHandler;
		CfgPtr->HandlerTable[Id%32].CallBackRef = InstancePtr;
	}
	else {
		CurrentIER = XIntc_In32(InstancePtr->BaseAddress +
							XIN_IER_OFFSET);
		Mask = XIntc_BitPosMask[Id];
		XIntc_Out32(InstancePtr->BaseAddress + XIN_IER_OFFSET,
					(CurrentIER & ~Mask));
		InstancePtr->CfgPtr->HandlerTable[Id%32].Handler =
								StubHandler;
		InstancePtr->CfgPtr->HandlerTable[Id%32].CallBackRef =
								InstancePtr;
	}
}
void XIntc_Disconnect ( XIntc * InstancePtr , u8 Id ) { u32 CurrentIER ; u32 Mask ; XIntc_Config * CfgPtr ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( Id < XPAR_INTC_MAX_NUM_INTR_INPUTS ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; if ( Id > 31 ) { CfgPtr = XIntc_LookupConfig ( Id / 32 ) ; if ( CfgPtr == NULL ) { return ; } CurrentIER = XIntc_In32 ( CfgPtr -> BaseAddress + XIN_IER_OFFSET ) ; Mask = XIntc_BitPosMask [ ( Id % 32 ) ] ; XIntc_Out32 ( CfgPtr -> BaseAddress + XIN_IER_OFFSET , ( CurrentIER & ~ Mask ) ) ; CfgPtr -> HandlerTable [ Id % 32 ] . Handler = StubHandler ; CfgPtr -> HandlerTable [ Id % 32 ] . CallBackRef = InstancePtr ; } else { CurrentIER = XIntc_In32 ( InstancePtr -> BaseAddress + XIN_IER_OFFSET ) ; Mask = XIntc_BitPosMask [ Id ] ; XIntc_Out32 ( InstancePtr -> BaseAddress + XIN_IER_OFFSET , ( CurrentIER & ~ Mask ) ) ; InstancePtr -> CfgPtr -> HandlerTable [ Id % 32 ] . Handler = StubHandler ; InstancePtr -> CfgPtr -> HandlerTable [ Id % 32 ] . CallBackRef = InstancePtr ; } }
Updates the interrupt table with the Null Handler and NULL arguments at the
location pointed at by the Id.
Updates the interrupt table with the Null Handler and NULL arguments at the location pointed at by the Id .
/*
	 * Assert the arguments
	 */ /*
	 * Disable the interrupt such that it won't occur while disconnecting
	 * the handler, only disable the specified interrupt id without
	 * modifying the other interrupt ids
	 */ /* Disconnect Handlers for Slave controllers in Cascade Mode */ /* Convert from integer id to bit mask */ /*
		 * Disconnect the handler and connect a stub, the callback
		 * reference must be set to this instance to allow unhandled
		 * interrupts to be tracked
		 */ /* Disconnect Handlers for Master/primary controller */ /* Convert from integer id to bit mask */