#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )\r
#define portNOP() __asm volatile( "NOP" )\r
\r
-#ifdef configASSERT\r
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
-#endif\r
-\r
/* Save clobbered register, set ITU SWINR (at address 0x872E0), read the value\r
back to ensure it is set before continuing, then restore the clobbered\r
register. */\r
\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() __asm volatile ( "MVTIPL #0" );\r
-#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(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() __asm volatile ( "MVTIPL #0" )\r
+#ifdef configASSERT\r
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+ #define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )\r
+#else\r
+ #define portDISABLE_INTERRUPTS() __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )\r
+#endif\r
\r
/* Critical nesting counts are stored in the TCB. */\r
#define portCRITICAL_NESTING_IN_TCB ( 1 )\r
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) \r
#define portNOP() __asm volatile( "NOP" )\r
\r
-#ifdef configASSERT\r
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
-#endif\r
-\r
-\r
/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;"\r
where portITU_SWINTR is the location of the software interrupt register\r
(0x000872E0). Don't rely on the assembler to select a register, so instead \r
\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() __asm volatile ( "MVTIPL #0" );\r
-#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(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() __asm volatile ( "MVTIPL #0" )\r
+#ifdef configASSERT\r
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+ #define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )\r
+#else\r
+ #define portDISABLE_INTERRUPTS() __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )\r
+#endif\r
\r
/* Critical nesting counts are stored in the TCB. */\r
#define portCRITICAL_NESTING_IN_TCB ( 1 )\r
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )\r
#define portNOP() __no_operation()\r
\r
-#ifdef configASSERT\r
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
-#endif\r
-\r
#define portYIELD() \\r
__asm volatile \\r
( \\r
\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
+/* 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_interrupt_level( ( unsigned char ) 0 )\r
-#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#ifdef configASSERT\r
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+ #define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#else\r
+ #define portDISABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#endif\r
\r
/* Critical nesting counts are stored in the TCB. */\r
#define portCRITICAL_NESTING_IN_TCB ( 1 )\r
#define portEXIT_CRITICAL() vTaskExitCritical()\r
\r
/* As this port allows interrupt nesting... */\r
-unsigned long ulPortGetIPL( void );\r
-void vPortSetIPL( unsigned long ulNewIPL );\r
#define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS()\r
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) )\r
\r
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )\r
#define portNOP() __no_operation()\r
\r
-#ifdef configASSERT\r
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
-#endif\r
-\r
/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;"\r
where portITU_SWINTR is the location of the software interrupt register\r
(0x000872E0). Don't rely on the assembler to select a register, so instead\r
\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
+/* 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_interrupt_level( ( unsigned char ) 0 )\r
-#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#ifdef configASSERT\r
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+ #define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#else\r
+ #define portDISABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#endif\r
\r
/* Critical nesting counts are stored in the TCB. */\r
#define portCRITICAL_NESTING_IN_TCB ( 1 )\r
#define portEXIT_CRITICAL() vTaskExitCritical()\r
\r
/* As this port allows interrupt nesting... */\r
-unsigned long ulPortGetIPL( void );\r
-void vPortSetIPL( unsigned long ulNewIPL );\r
#define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS()\r
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) )\r
\r
safe FreeRTOS API function was executed. ISR safe FreeRTOS API functions are\r
those that end in FromISR. FreeRTOS maintains a separate interrupt API to\r
ensure API function and interrupt entry is as fast and as simple as possible. */\r
-\r
#ifdef configASSERT\r
#define portDISABLE_INTERRUPTS() \\r
{ \\r
_CP0_SET_STATUS( ( ulStatus | ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ) ) ); \\r
} \\r
}\r
-#else\r
+#else /* configASSERT */\r
#define portDISABLE_INTERRUPTS() \\r
{ \\r
unsigned long ulStatus; \\r
#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
#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
#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
#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
#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
#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