]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/Renesas/RX200/portmacro.h
Update RX ports to only include additional check on the existing IPL (so it is not...
[freertos] / FreeRTOS / Source / portable / Renesas / RX200 / portmacro.h
index 721334a4866b3263d659f8da217e16f8c2699a89..b6030cca76fbb46990cc2ab581edc8c6e16efb32 100644 (file)
@@ -118,10 +118,6 @@ portSTACK_TYPE and portBASE_TYPE. */
 #define portTICK_RATE_MS                               ( ( portTickType ) 1000 / configTICK_RATE_HZ )          \r
 #define portNOP()                                              nop()\r
 \r
-#ifdef configASSERT\r
-       #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( get_ipl() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
-#endif\r
-\r
 #pragma inline_asm vPortYield\r
 static void vPortYield( void )\r
 {\r
@@ -140,17 +136,22 @@ static void vPortYield( void )
 #define portYIELD()    vPortYield()\r
 #define portYIELD_FROM_ISR( x )        if( x != pdFALSE ) portYIELD()\r
 \r
-/*\r
- * These macros should be called directly, but through the taskENTER_CRITICAL()\r
- * and taskEXIT_CRITICAL() macros.  If the RTOS is being used correctly then\r
- * the check to ensure the IPL is not being lowered will not be needed.  It is\r
- * included to ensure assert()s triggered by using an incorrect interrupt\r
- * priority do not result in the assert() handler inadvertently lowering the\r
- * priority mask, and in so doing allowing the offending interrupt to continue\r
- * triggering until stack space is exhausted.\r
- */\r
-#define portENABLE_INTERRUPTS()        set_ipl( 0 )\r
-#define portDISABLE_INTERRUPTS()       if( get_ipl() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) set_ipl( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+/* These macros should not be called directly, but through the \r
+taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros.  An extra check is \r
+performed if configASSERT() is defined to ensure an assertion handler does not \r
+inadvertently attempt to lower the IPL when the call to assert was triggered \r
+because the IPL value was found to be above    configMAX_SYSCALL_INTERRUPT_PRIORITY \r
+when an ISR safe FreeRTOS API function was executed.  ISR safe FreeRTOS API \r
+functions are those that end in FromISR.  FreeRTOS maintains a separate \r
+interrupt API to ensure API function and interrupt entry is as fast and as \r
+simple as possible. */\r
+#define portENABLE_INTERRUPTS()        set_ipl( ( long ) 0 )\r
+#ifdef configASSERT\r
+       #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( get_ipl() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+       #define portDISABLE_INTERRUPTS()        if( get_ipl() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#else\r
+       #define portDISABLE_INTERRUPTS()        set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#endif\r
 \r
 /* Critical nesting counts are stored in the TCB. */\r
 #define portCRITICAL_NESTING_IN_TCB ( 1 )\r