lib/sw_services/xilplmi/src/xplmi_gic_interrupts.c
void XPlmi_GicIntrHandler(void *CallbackRef)
{
	u32 GicPIntrStatus;
	u32 GicPNIntrStatus;
	u32 GicPNIntrMask;
	u32 GicIndex;
	u32 GicPIndex;
	u32 GicOffset;
	u32 GicPMask;
	u32 GicMask;
	u32 PlmIntrId;

	(void)CallbackRef;

	GicPIntrStatus = XPlmi_In32(PMC_GLOBAL_GICP_PMC_IRQ_STATUS);
	XPlmi_Printf(DEBUG_DETAILED,
			"GicPIntrStatus: 0x%x\r\n", GicPIntrStatus);

	for (GicIndex = 0U; GicIndex < XPLMI_GICP_SOURCE_COUNT; GicIndex++) {
		GicMask = (u32)1U << GicIndex;
		if ((GicPIntrStatus & GicMask) == 0U) {
			continue;
		}
		GicOffset = GicIndex * XPLMI_GICPX_LEN;
		GicPNIntrStatus = XPlmi_In32(PMC_GLOBAL_GICP0_IRQ_STATUS +
			GicOffset);
		GicPNIntrMask = XPlmi_In32(PMC_GLOBAL_GICP0_IRQ_MASK +
			GicOffset);
		XPlmi_Printf(DEBUG_DETAILED, "GicP%u Intr Status: 0x%x\r\n",
			GicIndex, GicPNIntrStatus);

		for (GicPIndex = 0U; GicPIndex < XPLMI_NO_OF_BITS_IN_REG;
			GicPIndex++) {
			GicPMask = (u32)1U << GicPIndex;
			if ((GicPNIntrStatus & GicPMask) == 0U) {
				continue;
			}
			if ((GicPNIntrMask & GicPMask) != 0U) {
				continue;
			}
			PlmIntrId = ((GicIndex << XPLMI_GICP_INDEX_SHIFT) |
					(GicPIndex << XPLMI_GICPX_INDEX_SHIFT));
			XPlmi_GicAddTask(PlmIntrId);
			XPlmi_Out32((PMC_GLOBAL_GICP0_IRQ_DISABLE + GicOffset), GicPMask);
			XPlmi_Out32(PMC_GLOBAL_GICP0_IRQ_STATUS + GicOffset, GicPMask);
		}
		XPlmi_Out32(PMC_GLOBAL_GICP_PMC_IRQ_STATUS, GicMask);
	}

	return;
}
/*****************************************************************************/
/**
 * @brief	This is handler for GIC interrupts.
 *
 * @param	CallbackRef is presently the interrupt number that is received
 *
 * @return	None
 *
 *****************************************************************************/
@brief       This is handler for GIC interrupts.
@param       CallbackRef is presently the interrupt number that is received

@return      None
@brief This is handler for GIC interrupts . @param CallbackRef is presently the interrupt number that is received @return None
void XPlmi_GicIntrHandler(void *CallbackRef)
{
	u32 GicPIntrStatus;
	u32 GicPNIntrStatus;
	u32 GicPNIntrMask;
	u32 GicIndex;
	u32 GicPIndex;
	u32 GicOffset;
	u32 GicPMask;
	u32 GicMask;
	u32 PlmIntrId;
	(void)CallbackRef;
	GicPIntrStatus = XPlmi_In32(PMC_GLOBAL_GICP_PMC_IRQ_STATUS);
	XPlmi_Printf(DEBUG_DETAILED,
			"GicPIntrStatus: 0x%x\r\n", GicPIntrStatus);
	for (GicIndex = 0U; GicIndex < XPLMI_GICP_SOURCE_COUNT; GicIndex++) {
		GicMask = (u32)1U << GicIndex;
		if ((GicPIntrStatus & GicMask) == 0U) {
			continue;
		}
		GicOffset = GicIndex * XPLMI_GICPX_LEN;
		GicPNIntrStatus = XPlmi_In32(PMC_GLOBAL_GICP0_IRQ_STATUS +
			GicOffset);
		GicPNIntrMask = XPlmi_In32(PMC_GLOBAL_GICP0_IRQ_MASK +
			GicOffset);
		XPlmi_Printf(DEBUG_DETAILED, "GicP%u Intr Status: 0x%x\r\n",
			GicIndex, GicPNIntrStatus);
		for (GicPIndex = 0U; GicPIndex < XPLMI_NO_OF_BITS_IN_REG;
			GicPIndex++) {
			GicPMask = (u32)1U << GicPIndex;
			if ((GicPNIntrStatus & GicPMask) == 0U) {
				continue;
			}
			if ((GicPNIntrMask & GicPMask) != 0U) {
				continue;
			}
			PlmIntrId = ((GicIndex << XPLMI_GICP_INDEX_SHIFT) |
					(GicPIndex << XPLMI_GICPX_INDEX_SHIFT));
			XPlmi_GicAddTask(PlmIntrId);
			XPlmi_Out32((PMC_GLOBAL_GICP0_IRQ_DISABLE + GicOffset), GicPMask);
			XPlmi_Out32(PMC_GLOBAL_GICP0_IRQ_STATUS + GicOffset, GicPMask);
		}
		XPlmi_Out32(PMC_GLOBAL_GICP_PMC_IRQ_STATUS, GicMask);
	}
	return;
}
void XPlmi_GicIntrHandler ( void * CallbackRef ) { u32 GicPIntrStatus ; u32 GicPNIntrStatus ; u32 GicPNIntrMask ; u32 GicIndex ; u32 GicPIndex ; u32 GicOffset ; u32 GicPMask ; u32 GicMask ; u32 PlmIntrId ; ( void ) CallbackRef ; GicPIntrStatus = XPlmi_In32 ( PMC_GLOBAL_GICP_PMC_IRQ_STATUS ) ; XPlmi_Printf ( DEBUG_DETAILED , " \r \n " , GicPIntrStatus ) ; for ( GicIndex = 0U ; GicIndex < XPLMI_GICP_SOURCE_COUNT ; GicIndex ++ ) { GicMask = ( u32 ) 1U << GicIndex ; if ( ( GicPIntrStatus & GicMask ) == 0U ) { continue ; } GicOffset = GicIndex * XPLMI_GICPX_LEN ; GicPNIntrStatus = XPlmi_In32 ( PMC_GLOBAL_GICP0_IRQ_STATUS + GicOffset ) ; GicPNIntrMask = XPlmi_In32 ( PMC_GLOBAL_GICP0_IRQ_MASK + GicOffset ) ; XPlmi_Printf ( DEBUG_DETAILED , " \r \n " , GicIndex , GicPNIntrStatus ) ; for ( GicPIndex = 0U ; GicPIndex < XPLMI_NO_OF_BITS_IN_REG ; GicPIndex ++ ) { GicPMask = ( u32 ) 1U << GicPIndex ; if ( ( GicPNIntrStatus & GicPMask ) == 0U ) { continue ; } if ( ( GicPNIntrMask & GicPMask ) != 0U ) { continue ; } PlmIntrId = ( ( GicIndex << XPLMI_GICP_INDEX_SHIFT ) | ( GicPIndex << XPLMI_GICPX_INDEX_SHIFT ) ) ; XPlmi_GicAddTask ( PlmIntrId ) ; XPlmi_Out32 ( ( PMC_GLOBAL_GICP0_IRQ_DISABLE + GicOffset ) , GicPMask ) ; XPlmi_Out32 ( PMC_GLOBAL_GICP0_IRQ_STATUS + GicOffset , GicPMask ) ; } XPlmi_Out32 ( PMC_GLOBAL_GICP_PMC_IRQ_STATUS , GicMask ) ; } return ; }
@brief       This is handler for GIC interrupts.
@brief This is handler for GIC interrupts .