aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2014-10-18 01:02:59 +0200
committerTorvald Riegel <triegel@redhat.com>2014-11-20 11:57:38 +0100
commit1ea339b69725cb2f30b5a84cb7ca96111c9a637b (patch)
tree130609da9190b04afb366f3a506d3415ea2f982f /sysdeps/x86_64
parentd960211ff52a6ab632eace2f905c4898f187df9e (diff)
downloadglibc-1ea339b69725cb2f30b5a84cb7ca96111c9a637b.tar
glibc-1ea339b69725cb2f30b5a84cb7ca96111c9a637b.tar.gz
glibc-1ea339b69725cb2f30b5a84cb7ca96111c9a637b.tar.bz2
glibc-1ea339b69725cb2f30b5a84cb7ca96111c9a637b.zip
Add arch-specific configuration for C11 atomics support.
This sets __HAVE_64B_ATOMICS if provided. It also sets USE_ATOMIC_COMPILER_BUILTINS to true if the existing atomic ops use the __atomic* builtins (aarch64, mips partially) or if this has been tested (x86_64); otherwise, this is set to false so that C11 atomics will be based on the existing atomic operations.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/bits/atomic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/x86_64/bits/atomic.h b/sysdeps/x86_64/bits/atomic.h
index 4d19ef0bb4..99dfb50295 100644
--- a/sysdeps/x86_64/bits/atomic.h
+++ b/sysdeps/x86_64/bits/atomic.h
@@ -55,6 +55,12 @@ typedef uintmax_t uatomic_max_t;
# endif
#endif
+#define __HAVE_64B_ATOMICS 1
+#if __GNUC_PREREQ (4, 7)
+#define USE_ATOMIC_COMPILER_BUILTINS 1
+#else
+#define USE_ATOMIC_COMPILER_BUILTINS 0
+#endif
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
__sync_val_compare_and_swap (mem, oldval, newval)