\r
extern void *pxCurrentTCB;\r
\r
-unsigned char ucIPLToRestore = 0;\r
-\r
/*-----------------------------------------------------------*/\r
\r
/* \r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vPortSetInterruptMask( void )\r
-{\r
-unsigned char ucPreviousIPL;\r
-\r
- /* Store the current IPL to ensure it is restored correctly later if it is\r
- not currently 0. This is a stack variable, so there should not be a race\r
- condition even if there is an interrupt or context switch before the new\r
- IPL value gets set. */\r
- ucPreviousIPL = get_ipl();\r
- \r
- /* Set the mask up to the max syscall priority. */\r
- set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
- \r
- /* Now the mask is set there will not be a context switch, so the previous\r
- and current IPL values can be compared. This ensures against the IPL being\r
- set back to zero too early when critical sections nest. */\r
- if( ucPreviousIPL < configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
- {\r
- ucIPLToRestore = ucPreviousIPL;\r
- }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
#pragma inline_asm prvStartFirstTask\r
static void prvStartFirstTask( void )\r
{\r
* These macros should be called directly, but through the taskENTER_CRITICAL()\r
* and taskEXIT_CRITICAL() macros.\r
*/\r
-extern unsigned char ucIPLToRestore;\r
-#define portENABLE_INTERRUPTS() set_ipl( ucIPLToRestore )\r
-#define portDISABLE_INTERRUPTS() vPortSetInterruptMask()\r
+#define portENABLE_INTERRUPTS() set_ipl( 0 )\r
+#define portDISABLE_INTERRUPTS() set_ipl( configKERNEL_INTERRUPT_PRIORITY )\r
+\r
+#define portSET_INTERRUPT_MASK_FROM_ISR() get_ipl(); set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( uxSavedInterruptStatus )\r
\r
/* Critical nesting counts are stored in the TCB. */\r
#define portCRITICAL_NESTING_IN_TCB ( 1 )\r