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

	/*
	 * Check the parameters and driver status
	 */
	Xil_AssertNonvoid(InstancePtr != NULL);
	if ( InstancePtr == NULL ) {
		return XST_FAILURE;
	}

	if ( InstancePtr->IsReady != XIL_COMPONENT_IS_READY ) {
		return XST_FAILURE;
	}

	if (Id > 31) {
		CfgPtr = XIntc_LookupConfig(Id/32);
		if (CfgPtr == NULL) {
			return XST_FAILURE;
		}
		/* Check if interrupt id belongs to software interrupts */
		if ( (Id%32) < CfgPtr->NumberofIntrs ) {
			return XST_FAILURE;
		}

		Mask = XIntc_BitPosMask[Id%32];
		XIntc_Out32(CfgPtr->BaseAddress + XIN_ISR_OFFSET, Mask);

	} else {
		Mask = XIntc_BitPosMask[Id];
		XIntc_Out32(InstancePtr->BaseAddress + XIN_ISR_OFFSET, Mask);
	}

	/* indicate the interrupt was successfully triggered */
	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* Allows software to trigger software interrupt.
* This function will only be successful when the interrupt controller has been
* configured with software interrupt in HW design
*
* @param	InstancePtr is a pointer to the XIntc instance to be worked on.
* @param	Id is the interrupt ID to be triggered
*
* @return
* 		- XST_SUCCESS if successful
*		- XST_FAILURE if the instance pointer is invalid
*					  if interrupt id does not belongs to software interrupt
*
* @note		HW design must have software interrupts and interrupt id passed
*			should be of software interrupt type. Interrupt id's for software
*			interrupts for specific HW design can be found in xparameters.h file.
*
******************************************************************************/
Allows software to trigger software interrupt.
This function will only be successful when the interrupt controller has been
configured with software interrupt in HW design
Allows software to trigger software interrupt . This function will only be successful when the interrupt controller has been configured with software interrupt in HW design
int XIntc_TriggerSwIntr(XIntc * InstancePtr, u8 Id)
{
	u32 Mask;
	XIntc_Config *CfgPtr;
	Xil_AssertNonvoid(InstancePtr != NULL);
	if ( InstancePtr == NULL ) {
		return XST_FAILURE;
	}
	if ( InstancePtr->IsReady != XIL_COMPONENT_IS_READY ) {
		return XST_FAILURE;
	}
	if (Id > 31) {
		CfgPtr = XIntc_LookupConfig(Id/32);
		if (CfgPtr == NULL) {
			return XST_FAILURE;
		}
		if ( (Id%32) < CfgPtr->NumberofIntrs ) {
			return XST_FAILURE;
		}
		Mask = XIntc_BitPosMask[Id%32];
		XIntc_Out32(CfgPtr->BaseAddress + XIN_ISR_OFFSET, Mask);
	} else {
		Mask = XIntc_BitPosMask[Id];
		XIntc_Out32(InstancePtr->BaseAddress + XIN_ISR_OFFSET, Mask);
	}
	return XST_SUCCESS;
}
int XIntc_TriggerSwIntr ( XIntc * InstancePtr , u8 Id ) { u32 Mask ; XIntc_Config * CfgPtr ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; if ( InstancePtr == NULL ) { return XST_FAILURE ; } if ( InstancePtr -> IsReady != XIL_COMPONENT_IS_READY ) { return XST_FAILURE ; } if ( Id > 31 ) { CfgPtr = XIntc_LookupConfig ( Id / 32 ) ; if ( CfgPtr == NULL ) { return XST_FAILURE ; } if ( ( Id % 32 ) < CfgPtr -> NumberofIntrs ) { return XST_FAILURE ; } Mask = XIntc_BitPosMask [ Id % 32 ] ; XIntc_Out32 ( CfgPtr -> BaseAddress + XIN_ISR_OFFSET , Mask ) ; } else { Mask = XIntc_BitPosMask [ Id ] ; XIntc_Out32 ( InstancePtr -> BaseAddress + XIN_ISR_OFFSET , Mask ) ; } return XST_SUCCESS ; }
Allows software to trigger software interrupt.
Allows software to trigger software interrupt .
/*
	 * Check the parameters and driver status
	 */ /* Check if interrupt id belongs to software interrupts */ /* indicate the interrupt was successfully triggered */