Update RX ports to only include additional check on the existing IPL (so it is not lowered) if configASSERT() is defined.

pull/1/head
Richard Barry 12 years ago
parent 4b964814de
commit e5d9640863

@ -115,10 +115,6 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portNOP() __asm volatile( "NOP" ) #define portNOP() __asm volatile( "NOP" )
#ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#endif
/* Save clobbered register, set ITU SWINR (at address 0x872E0), read the value /* Save clobbered register, set ITU SWINR (at address 0x872E0), read the value
back to ensure it is set before continuing, then restore the clobbered back to ensure it is set before continuing, then restore the clobbered
register. */ register. */
@ -133,17 +129,22 @@ register. */
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) { portYIELD(); } #define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) { portYIELD(); }
/* /* These macros should not be called directly, but through the
* These macros should be called directly, but through the taskENTER_CRITICAL() taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros. An extra check is
* and taskEXIT_CRITICAL() macros. If the RTOS is being used correctly then performed if configASSERT() is defined to ensure an assertion handler does not
* the check to ensure the IPL is not being lowered will not be needed. It is inadvertently attempt to lower the IPL when the call to assert was triggered
* included to ensure assert()s triggered by using an incorrect interrupt because the IPL value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY
* priority do not result in the assert() handler inadvertently lowering the when an ISR safe FreeRTOS API function was executed. ISR safe FreeRTOS API
* priority mask, and in so doing allowing the offending interrupt to continue functions are those that end in FromISR. FreeRTOS maintains a separate
* triggering until stack space is exhausted. interrupt API to ensure API function and interrupt entry is as fast and as
*/ simple as possible. */
#define portENABLE_INTERRUPTS() __asm volatile ( "MVTIPL #0" ); #define portENABLE_INTERRUPTS() __asm volatile ( "MVTIPL #0" )
#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) ) #ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )
#else
#define portDISABLE_INTERRUPTS() __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )
#endif
/* Critical nesting counts are stored in the TCB. */ /* Critical nesting counts are stored in the TCB. */
#define portCRITICAL_NESTING_IN_TCB ( 1 ) #define portCRITICAL_NESTING_IN_TCB ( 1 )

@ -115,11 +115,6 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portNOP() __asm volatile( "NOP" ) #define portNOP() __asm volatile( "NOP" )
#ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#endif
/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;" /* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;"
where portITU_SWINTR is the location of the software interrupt register where portITU_SWINTR is the location of the software interrupt register
(0x000872E0). Don't rely on the assembler to select a register, so instead (0x000872E0). Don't rely on the assembler to select a register, so instead
@ -136,17 +131,22 @@ save and restore clobbered registers manually. */
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) portYIELD() #define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) portYIELD()
/* /* These macros should not be called directly, but through the
* These macros should be called directly, but through the taskENTER_CRITICAL() taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros. An extra check is
* and taskEXIT_CRITICAL() macros. If the RTOS is being used correctly then performed if configASSERT() is defined to ensure an assertion handler does not
* the check to ensure the IPL is not being lowered will not be needed. It is inadvertently attempt to lower the IPL when the call to assert was triggered
* included to ensure assert()s triggered by using an incorrect interrupt because the IPL value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY
* priority do not result in the assert() handler inadvertently lowering the when an ISR safe FreeRTOS API function was executed. ISR safe FreeRTOS API
* priority mask, and in so doing allowing the offending interrupt to continue functions are those that end in FromISR. FreeRTOS maintains a separate
* triggering until stack space is exhausted. interrupt API to ensure API function and interrupt entry is as fast and as
*/ simple as possible. */
#define portENABLE_INTERRUPTS() __asm volatile ( "MVTIPL #0" ); #define portENABLE_INTERRUPTS() __asm volatile ( "MVTIPL #0" )
#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) ) #ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( ulPortGetIPL() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#define portDISABLE_INTERRUPTS() if( ulPortGetIPL() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )
#else
#define portDISABLE_INTERRUPTS() __asm volatile ( "MVTIPL %0" ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY) )
#endif
/* Critical nesting counts are stored in the TCB. */ /* Critical nesting counts are stored in the TCB. */
#define portCRITICAL_NESTING_IN_TCB ( 1 ) #define portCRITICAL_NESTING_IN_TCB ( 1 )

@ -120,10 +120,6 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portNOP() __no_operation() #define portNOP() __no_operation()
#ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#endif
#define portYIELD() \ #define portYIELD() \
__asm volatile \ __asm volatile \
( \ ( \
@ -135,17 +131,22 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portYIELD_FROM_ISR( x ) if( ( x ) != pdFALSE ) { portYIELD(); } #define portYIELD_FROM_ISR( x ) if( ( x ) != pdFALSE ) { portYIELD(); }
/* /* These macros should not be called directly, but through the
* These macros should be called directly, but through the taskENTER_CRITICAL() taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros. An extra check is
* and taskEXIT_CRITICAL() macros. If the RTOS is being used correctly then performed if configASSERT() is defined to ensure an assertion handler does not
* the check to ensure the IPL is not being lowered will not be needed. It is inadvertently attempt to lower the IPL when the call to assert was triggered
* included to ensure assert()s triggered by using an incorrect interrupt because the IPL value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY
* priority do not result in the assert() handler inadvertently lowering the when an ISR safe FreeRTOS API function was executed. ISR safe FreeRTOS API
* priority mask, and in so doing allowing the offending interrupt to continue functions are those that end in FromISR. FreeRTOS maintains a separate
* triggering until stack space is exhausted. interrupt API to ensure API function and interrupt entry is as fast and as
*/ simple as possible. */
#define portENABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) 0 ) #define portENABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) 0 )
#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY ) #ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
#else
#define portDISABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
#endif
/* Critical nesting counts are stored in the TCB. */ /* Critical nesting counts are stored in the TCB. */
#define portCRITICAL_NESTING_IN_TCB ( 1 ) #define portCRITICAL_NESTING_IN_TCB ( 1 )
@ -157,8 +158,6 @@ extern void vTaskExitCritical( void );
#define portEXIT_CRITICAL() vTaskExitCritical() #define portEXIT_CRITICAL() vTaskExitCritical()
/* As this port allows interrupt nesting... */ /* As this port allows interrupt nesting... */
unsigned long ulPortGetIPL( void );
void vPortSetIPL( unsigned long ulNewIPL );
#define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS() #define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) ) #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) )

@ -117,10 +117,6 @@ portSTACK_TYPE and portBASE_TYPE. */
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portNOP() __no_operation() #define portNOP() __no_operation()
#ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#endif
/* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;" /* Yield equivalent to "*portITU_SWINTR = 0x01; ( void ) *portITU_SWINTR;"
where portITU_SWINTR is the location of the software interrupt register where portITU_SWINTR is the location of the software interrupt register
(0x000872E0). Don't rely on the assembler to select a register, so instead (0x000872E0). Don't rely on the assembler to select a register, so instead
@ -137,17 +133,22 @@ save and restore clobbered registers manually. */
#define portYIELD_FROM_ISR( x ) if( ( x ) != pdFALSE ) portYIELD() #define portYIELD_FROM_ISR( x ) if( ( x ) != pdFALSE ) portYIELD()
/* /* These macros should not be called directly, but through the
* These macros should be called directly, but through the taskENTER_CRITICAL() taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros. An extra check is
* and taskEXIT_CRITICAL() macros. If the RTOS is being used correctly then performed if configASSERT() is defined to ensure an assertion handler does not
* the check to ensure the IPL is not being lowered will not be needed. It is inadvertently attempt to lower the IPL when the call to assert was triggered
* included to ensure assert()s triggered by using an incorrect interrupt because the IPL value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY
* priority do not result in the assert() handler inadvertently lowering the when an ISR safe FreeRTOS API function was executed. ISR safe FreeRTOS API
* priority mask, and in so doing allowing the offending interrupt to continue functions are those that end in FromISR. FreeRTOS maintains a separate
* triggering until stack space is exhausted. interrupt API to ensure API function and interrupt entry is as fast and as
*/ simple as possible. */
#define portENABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) 0 ) #define portENABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) 0 )
#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY ) #ifdef configASSERT
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
#define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
#else
#define portDISABLE_INTERRUPTS() __set_interrupt_level( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
#endif
/* Critical nesting counts are stored in the TCB. */ /* Critical nesting counts are stored in the TCB. */
#define portCRITICAL_NESTING_IN_TCB ( 1 ) #define portCRITICAL_NESTING_IN_TCB ( 1 )
@ -159,8 +160,6 @@ extern void vTaskExitCritical( void );
#define portEXIT_CRITICAL() vTaskExitCritical() #define portEXIT_CRITICAL() vTaskExitCritical()
/* As this port allows interrupt nesting... */ /* As this port allows interrupt nesting... */
unsigned long ulPortGetIPL( void );
void vPortSetIPL( unsigned long ulNewIPL );
#define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS() #define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) ) #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( unsigned char ) ( uxSavedInterruptStatus ) )

@ -129,7 +129,6 @@ value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY when an ISR
safe FreeRTOS API function was executed. ISR safe FreeRTOS API functions are safe FreeRTOS API function was executed. ISR safe FreeRTOS API functions are
those that end in FromISR. FreeRTOS maintains a separate interrupt API to those that end in FromISR. FreeRTOS maintains a separate interrupt API to
ensure API function and interrupt entry is as fast and as simple as possible. */ ensure API function and interrupt entry is as fast and as simple as possible. */
#ifdef configASSERT #ifdef configASSERT
#define portDISABLE_INTERRUPTS() \ #define portDISABLE_INTERRUPTS() \
{ \ { \
@ -145,7 +144,7 @@ ensure API function and interrupt entry is as fast and as simple as possible. */
_CP0_SET_STATUS( ( ulStatus | ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ) ) ); \ _CP0_SET_STATUS( ( ulStatus | ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ) ) ); \
} \ } \
} }
#else #else /* configASSERT */
#define portDISABLE_INTERRUPTS() \ #define portDISABLE_INTERRUPTS() \
{ \ { \
unsigned long ulStatus; \ unsigned long ulStatus; \

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

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

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

Loading…
Cancel
Save