\r
/* Library includes. */\r
#include "xtime_l.h"\r
+#include "xintc.h"\r
+#include "xintc_i.h"\r
\r
/* Standard includes. */\r
#include <string.h>\r
{\r
extern void *pxCurrentTCB;\r
\r
- XExc_Init();\r
- XExc_mDisableExceptions( XEXC_NON_CRITICAL ) ; \r
-\r
prvSetupTimerInterrupt();\r
\r
XExc_RegisterHandler( XEXC_ID_SYSTEM_CALL, ( XExceptionHandler ) vPortYield, ( void * ) 0 );\r
}\r
/*-----------------------------------------------------------*/\r
\r
+void vPortISRHandler( void *DeviceId )\r
+{\r
+Xuint32 IntrStatus;\r
+Xuint32 IntrMask = 1;\r
+int IntrNumber;\r
+//extern XIntc xInterruptController;\r
+XIntc_Config *CfgPtr;// = xInterruptController.CfgPtr;\r
+ \r
+ /* Get the configuration data using the device ID */\r
+ //CfgPtr = &XIntc_ConfigTable[(Xuint32)DeviceId];\r
+ CfgPtr = &XIntc_ConfigTable[(Xuint32)XPAR_OPB_INTC_0_DEVICE_ID];\r
+ \r
+ /* Get the interrupts that are waiting to be serviced */\r
+ IntrStatus = XIntc_mGetIntrStatus(CfgPtr->BaseAddress);\r
+ \r
+ /* Service each interrupt that is active and enabled by checking each\r
+ * bit in the register from LSB to MSB which corresponds to an interrupt\r
+ * intput signal\r
+ */\r
+ for (IntrNumber = 0; IntrNumber < XPAR_INTC_MAX_NUM_INTR_INPUTS;\r
+ IntrNumber++)\r
+ {\r
+ if (IntrStatus & 1)\r
+ {\r
+ XIntc_VectorTableEntry *TablePtr;\r
+ \r
+ /* The interrupt is active and enabled, call the interrupt\r
+ * handler that was setup with the specified parameter\r
+ */\r
+ TablePtr = &(CfgPtr->HandlerTable[IntrNumber]);\r
+ TablePtr->Handler(TablePtr->CallBackRef);\r
+\r
+ /* Clear the interrupt. */ \r
+ XIntc_mAckIntr(CfgPtr->BaseAddress, IntrMask);\r
+ break;\r
+ }\r
+ \r
+ /* Move to the next interrupt to check */\r
+ IntrMask <<= 1;\r
+ IntrStatus >>= 1;\r
+ \r
+ /* If there are no other bits set indicating that all interrupts\r
+ * have been serviced, then exit the loop\r
+ */\r
+ if (IntrStatus == 0)\r
+ {\r
+ break;\r
+ }\r
+ }\r
+}\r
.extern pxCurrentTCB\r
.extern vTaskSwitchContext\r
.extern vTaskIncrementTick\r
+ .extern vPortISRHandler\r
\r
.global vPortStartFirstTask\r
.global vPortYield\r
.global vPortTickISR\r
+ .global vPortISRWrapper\r
\r
.set portCONTEXT_SIZE, 156\r
.set portR0_OFFSET, 152\r
portEXIT_SWITCHING_ISR\r
blr\r
\r
+vPortISRWrapper:\r
\r
+ portENTER_SWITCHING_ISR\r
+ bl vPortISRHandler\r
+ portEXIT_SWITCHING_ISR\r
+ blr\r