\r
void vPortEnterCritical( void )\r
{\r
- portDISABLE_INTERRUPTS();\r
+ if( ulCriticalNesting == 0UL )\r
+ {\r
+ do\r
+ {\r
+ portDISABLE_INTERRUPTS();\r
+ if( MCF_INTC0_INTFRCH == 0UL )\r
+ {\r
+ break;\r
+ }\r
+\r
+ portENABLE_INTERRUPTS();\r
+\r
+ } while( 1 );\r
+ }\r
ulCriticalNesting++;\r
}\r
/*-----------------------------------------------------------*/\r
{\r
unsigned portLONG ulSavedInterruptMask;\r
\r
- /* -32 as we are using the high word of the 64bit mask. */\r
- MCF_INTC0_INTFRCH &= ~( 1UL << ( configYIELD_INTERRUPT_VECTOR - 32UL ) );\r
-\r
ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
+ /* -32 as we are using the high word of the 64bit mask. */\r
+ /* Note this will clear all forced interrupts - this is done for speed. */\r
+ MCF_INTC0_INTFRCH = 0;\r
vTaskSwitchContext();\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );\r
}\r