mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-06 21:25:00 -05:00
Fix portSET_INTERRUPT_MASK_FROM_ISR definition for atomic operation (#940)
* Introduce portHAS_NESTED_INTERRUPTS to identify if port has nested interrupt or not. * Update atomic.h to use portHAS_NESTED_INTERRUPTS instead of portSET_INTERRUPT_MASK_FROM_ISR definition. --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Co-authored-by: ActoryOu <jay2002824@gmail.com>
This commit is contained in:
parent
75c4044b7e
commit
be880a1fc8
6 changed files with 44 additions and 12 deletions
|
|
@ -509,12 +509,36 @@
|
|||
|
||||
#endif /* configUSE_TIMERS */
|
||||
|
||||
#ifndef portHAS_NESTED_INTERRUPTS
|
||||
#if defined( portSET_INTERRUPT_MASK_FROM_ISR ) && defined( portCLEAR_INTERRUPT_MASK_FROM_ISR )
|
||||
#define portHAS_NESTED_INTERRUPTS 1
|
||||
#else
|
||||
#define portHAS_NESTED_INTERRUPTS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef portSET_INTERRUPT_MASK_FROM_ISR
|
||||
#define portSET_INTERRUPT_MASK_FROM_ISR() 0
|
||||
#if ( portHAS_NESTED_INTERRUPTS == 1 )
|
||||
#error portSET_INTERRUPT_MASK_FROM_ISR must be defined for ports that support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1)
|
||||
#else
|
||||
#define portSET_INTERRUPT_MASK_FROM_ISR() 0
|
||||
#endif
|
||||
#else
|
||||
#if ( portHAS_NESTED_INTERRUPTS == 0 )
|
||||
#error portSET_INTERRUPT_MASK_FROM_ISR must not be defined for ports that do not support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
|
||||
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
|
||||
#if ( portHAS_NESTED_INTERRUPTS == 1 )
|
||||
#error portCLEAR_INTERRUPT_MASK_FROM_ISR must be defined for ports that support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1)
|
||||
#else
|
||||
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
|
||||
#endif
|
||||
#else
|
||||
#if ( portHAS_NESTED_INTERRUPTS == 0 )
|
||||
#error portCLEAR_INTERRUPT_MASK_FROM_ISR must not be defined for ports that do not support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef portCLEAN_UP_TCB
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue