razed11 wrote on Thursday, October 01, 2015:
In portZynq7000.c there is a routine to configure the RTOS timer and install its handler. It declares a static instance of XScuGIC so it is only available to this function.
In the 7.0.2 port (used by our current product) the instance of XScuGIC was declared static at file scope and routines were provided as an interface so that the application could install other interrupts using this same instance.
Why the change? Is it OK for the application create another instance and call XScuGic_CfgInitialize() and add interrupts separately?
Thanks.
From 8.2.2 port:
void FreeRTOS_SetupTickInterrupt( void )
{
static XScuGic xInterruptController; /* Interrupt controller instance */
BaseType_t xStatus;
extern void FreeRTOS_Tick_Handler( void );
XScuTimer_Config *pxTimerConfig;
XScuGic_Config *pxGICConfig;
const uint8_t ucRisingEdge = 3;
/* This function is called with the IRQ interrupt disabled, and the IRQ
interrupt should be left disabled. It is enabled automatically when the
scheduler is started. */
/* Ensure XScuGic_CfgInitialize() has been called. In this demo it has
already been called from prvSetupHardware() in main(). */
pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID );
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
From 7.0.2 port:
void setupIRQhandler(int int_no, void *fce, void *param) {
int Status;
clearIRQhandler(int_no);
Status = XScuGic_Connect(&InterruptController, int_no,
(Xil_ExceptionHandler) fce, param);
if (Status != XST_SUCCESS) {
return;
}
XScuGic_ClearPending(InterruptController.Config->DistBaseAddress, int_no);
XScuGic_Enable(&InterruptController, int_no);
}