summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/isr.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-03-07 20:47:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-03-07 20:47:53 +0000
commitf0ad529d28688214568532c0d30eb13654db1462 (patch)
tree0b254b2a26f754f598edf2b441c2ebd7576666ea /cpukit/score/include/rtems/score/isr.h
parentNew. (diff)
downloadrtems-f0ad529d28688214568532c0d30eb13654db1462.tar.bz2
2006-03-07 Joel Sherrill <joel@OARcorp.com>
PR 866/rtems * score/include/rtems/system.h, score/include/rtems/score/isr.h, score/inline/rtems/score/thread.inl, score/macros/rtems/score/thread.inl: Added memory barriers to enter and exit of dispatching and interrupt critical sections so GCC will not optimize and reorder code out of a critical section.
Diffstat (limited to 'cpukit/score/include/rtems/score/isr.h')
-rw-r--r--cpukit/score/include/rtems/score/isr.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h
index 320332dfd7..1359e91fd8 100644
--- a/cpukit/score/include/rtems/score/isr.h
+++ b/cpukit/score/include/rtems/score/isr.h
@@ -104,7 +104,10 @@ void _ISR_Handler_initialization ( void );
* the argument _level will contain the previous interrupt mask level.
*/
#define _ISR_Disable( _level ) \
- _CPU_ISR_Disable( _level )
+ do { \
+ _CPU_ISR_Disable( _level ); \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ } while (0)
/**
* This routine enables interrupts to the previous interrupt mask
@@ -112,7 +115,10 @@ void _ISR_Handler_initialization ( void );
* enable interrupts so they can be processed again.
*/
#define _ISR_Enable( _level ) \
- _CPU_ISR_Enable( _level )
+ do { \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ _CPU_ISR_Enable( _level ); \
+ } while (0)
/**
* This routine temporarily enables interrupts to the previous
@@ -127,7 +133,11 @@ void _ISR_Handler_initialization ( void );
* properly protects itself.
*/
#define _ISR_Flash( _level ) \
- _CPU_ISR_Flash( _level )
+ do { \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ _CPU_ISR_Flash( _level ); \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ } while (0)
/**
* This routine installs new_handler as the interrupt service routine