lib/sw_services/xilisf/examples/xilisf_ospipsv_stm_intr_example.c
static int OspiSetupIntrSystem(XScuGic *IntcInstancePtr,
			       XOspiPsv *OspiInstancePtr, u16 OspiIntrId)
{
	int Status = XST_FAILURE;

	XScuGic_Config *IntcConfig; /* Instance of the interrupt controller */

	Xil_ExceptionInit();

	/*
	 * Initialize the interrupt controller driver so that it is ready to
	 * use.
	 */
	IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
	if (NULL == IntcConfig) {
		return XST_FAILURE;
	}

	Status = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
					IntcConfig->CpuBaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Connect the interrupt controller interrupt handler to the hardware
	 * interrupt handling logic in the processor.
	 */
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				(Xil_ExceptionHandler)XScuGic_InterruptHandler,
				IntcInstancePtr);

	/*
	 * Connect the device driver handler that will be called when an
	 * interrupt for the device occurs, the handler defined above performs
	 * the specific interrupt processing for the device.
	 */
	Status = XScuGic_Connect(IntcInstancePtr, OspiIntrId,
				(Xil_ExceptionHandler)XOspiPsv_IntrHandler,
				(void *)OspiInstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}

	/*
	 * Enable the interrupt for the OSPI device.
	 */
	XScuGic_Enable(IntcInstancePtr, OspiIntrId);

	/*
	 * Enable interrupts in the Processor.
	 */
	Xil_ExceptionEnable();

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function setups the interrupt system for an OSPIPSV device.
*
* @param	IntcInstancePtr is a pointer to the instance of the Intc device.
* @param	OspiInstancePtr is a pointer to the instance of the OSPIPSV device.
* @param	OspiIntrId is the interrupt Id for an OSPIPSV device.
*
* @return	XST_SUCCESS if successful, otherwise XST_FAILURE.
*
* @note		None.
*
******************************************************************************/
This function setups the interrupt system for an OSPIPSV device.
This function setups the interrupt system for an OSPIPSV device .
static int OspiSetupIntrSystem(XScuGic *IntcInstancePtr,
			       XOspiPsv *OspiInstancePtr, u16 OspiIntrId)
{
	int Status = XST_FAILURE;
	XScuGic_Config *IntcConfig; 
	Xil_ExceptionInit();
	IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
	if (NULL == IntcConfig) {
		return XST_FAILURE;
	}
	Status = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
					IntcConfig->CpuBaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				(Xil_ExceptionHandler)XScuGic_InterruptHandler,
				IntcInstancePtr);
	Status = XScuGic_Connect(IntcInstancePtr, OspiIntrId,
				(Xil_ExceptionHandler)XOspiPsv_IntrHandler,
				(void *)OspiInstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}
	XScuGic_Enable(IntcInstancePtr, OspiIntrId);
	Xil_ExceptionEnable();
	return XST_SUCCESS;
}
static int OspiSetupIntrSystem ( XScuGic * IntcInstancePtr , XOspiPsv * OspiInstancePtr , u16 OspiIntrId ) { int Status = XST_FAILURE ; XScuGic_Config * IntcConfig ; Xil_ExceptionInit ( ) ; IntcConfig = XScuGic_LookupConfig ( INTC_DEVICE_ID ) ; if ( NULL == IntcConfig ) { return XST_FAILURE ; } Status = XScuGic_CfgInitialize ( IntcInstancePtr , IntcConfig , IntcConfig -> CpuBaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Xil_ExceptionRegisterHandler ( XIL_EXCEPTION_ID_INT , ( Xil_ExceptionHandler ) XScuGic_InterruptHandler , IntcInstancePtr ) ; Status = XScuGic_Connect ( IntcInstancePtr , OspiIntrId , ( Xil_ExceptionHandler ) XOspiPsv_IntrHandler , ( void * ) OspiInstancePtr ) ; if ( Status != XST_SUCCESS ) { return Status ; } XScuGic_Enable ( IntcInstancePtr , OspiIntrId ) ; Xil_ExceptionEnable ( ) ; return XST_SUCCESS ; }
This function setups the interrupt system for an OSPIPSV device.
This function setups the interrupt system for an OSPIPSV device .
/* Instance of the interrupt controller */ /*
	 * Initialize the interrupt controller driver so that it is ready to
	 * use.
	 */ /*
	 * Connect the interrupt controller interrupt handler to the hardware
	 * interrupt handling logic in the processor.
	 */ /*
	 * Connect the device driver handler that will be called when an
	 * interrupt for the device occurs, the handler defined above performs
	 * the specific interrupt processing for the device.
	 */ /*
	 * Enable the interrupt for the OSPI device.
	 */ /*
	 * Enable interrupts in the Processor.
	 */