summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/include/rtems/system.h')
-rw-r--r--cpukit/score/include/rtems/system.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h
index 59d5b293af..9558155daf 100644
--- a/cpukit/score/include/rtems/system.h
+++ b/cpukit/score/include/rtems/system.h
@@ -135,6 +135,17 @@ extern "C" {
# define RTEMS_INLINE_ROUTINE
#endif
+/**
+ * The following macro is a compiler specific way to ensure that memory
+ * writes are not reordered around certian points. This specifically can
+ * impact interrupt disable and thread dispatching critical sections.
+ */
+#ifdef __GNUC__
+ #define RTEMS_COMPILER_MEMORY_BARRIER() asm volatile("" ::: "memory")
+#else
+ #define RTEMS_COMPILER_MEMORY_BARRIER()
+#endif
+
#ifdef RTEMS_POSIX_API
/** The following is used by the POSIX implementation to catch bad paths. */
int POSIX_MP_NOT_IMPLEMENTED( void );