summaryrefslogtreecommitdiff
path: root/src/atomic_ops
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-02-28 19:46:58 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-02-28 19:46:58 +0400
commit9cb2e7ebc4a80f449f2a99b7bf3dc754c9d697c9 (patch)
treeaafe8bde842e94fede0f49faf6e150916329afaf /src/atomic_ops
parent635253907f13acc5b0d22321ca8097b460271b40 (diff)
downloadlibatomic_ops-9cb2e7ebc4a80f449f2a99b7bf3dc754c9d697c9.tar.gz
Define nop_write as 'dmb st' for AArch64
* src/atomic_ops/sysdeps/gcc/aarch64.h (AO_nop_write): Define via asm (dmb st) statement unless AO_UNIPROCESSOR (because it seems there is no equivalent definition using compiler __atomic_thread_fence). * src/atomic_ops/sysdeps/gcc/generic.h (AO_nop_write): Do not define if already is.
Diffstat (limited to 'src/atomic_ops')
-rw-r--r--src/atomic_ops/sysdeps/gcc/aarch64.h11
-rw-r--r--src/atomic_ops/sysdeps/gcc/generic.h14
2 files changed, 17 insertions, 8 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/aarch64.h b/src/atomic_ops/sysdeps/gcc/aarch64.h
index 7ff0db8..7408e07 100644
--- a/src/atomic_ops/sysdeps/gcc/aarch64.h
+++ b/src/atomic_ops/sysdeps/gcc/aarch64.h
@@ -15,10 +15,17 @@
*
*/
-/* TODO: Remove this file, directly include headers from atomic_ops.h */
-
#include "../test_and_set_t_is_ao_t.h"
#include "../standard_ao_double_t.h"
+#ifndef AO_UNIPROCESSOR
+ AO_INLINE void
+ AO_nop_write(void)
+ {
+ __asm__ __volatile__("dmb st" : : : "memory");
+ }
+# define AO_HAVE_nop_write
+#endif
+
#include "generic.h"
diff --git a/src/atomic_ops/sysdeps/gcc/generic.h b/src/atomic_ops/sysdeps/gcc/generic.h
index f0927b0..3d5a752 100644
--- a/src/atomic_ops/sysdeps/gcc/generic.h
+++ b/src/atomic_ops/sysdeps/gcc/generic.h
@@ -39,12 +39,14 @@
}
# define AO_HAVE_nop_read
- AO_INLINE void
- AO_nop_write(void)
- {
- __atomic_thread_fence(__ATOMIC_RELEASE);
- }
-# define AO_HAVE_nop_write
+# ifndef AO_HAVE_nop_write
+ AO_INLINE void
+ AO_nop_write(void)
+ {
+ __atomic_thread_fence(__ATOMIC_RELEASE);
+ }
+# define AO_HAVE_nop_write
+# endif
AO_INLINE void
AO_nop_full(void)