summaryrefslogtreecommitdiffstats
path: root/cpukit/score/macros/rtems/score
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/macros/rtems/score
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/macros/rtems/score')
-rw-r--r--cpukit/score/macros/rtems/score/thread.inl18
1 files changed, 13 insertions, 5 deletions
diff --git a/cpukit/score/macros/rtems/score/thread.inl b/cpukit/score/macros/rtems/score/thread.inl
index b5b94799c8..3ace7af4e2 100644
--- a/cpukit/score/macros/rtems/score/thread.inl
+++ b/cpukit/score/macros/rtems/score/thread.inl
@@ -126,7 +126,10 @@
*/
#define _Thread_Disable_dispatch() \
- _Thread_Dispatch_disable_level += 1
+ do { \
+ _Thread_Dispatch_disable_level += 1; \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ } while (0)
/*PAGE
*
@@ -136,9 +139,11 @@
#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
#define _Thread_Enable_dispatch() \
- { if ( (--_Thread_Dispatch_disable_level) == 0 ) \
- _Thread_Dispatch(); \
- }
+ do { \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ if ( (--_Thread_Dispatch_disable_level) == 0 ) \
+ _Thread_Dispatch(); \
+ } while (0)
#endif
#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
@@ -152,7 +157,10 @@ void _Thread_Enable_dispatch( void );
*/
#define _Thread_Unnest_dispatch() \
- _Thread_Dispatch_disable_level -= 1
+ do { \
+ RTEMS_COMPILER_MEMORY_BARRIER(); \
+ _Thread_Dispatch_disable_level -= 1; \
+ } while (0)
/*PAGE
*