From ff9dbdc048f8341c5f1bc6a6982b669b49a40983 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Wed, 29 Oct 2014 19:14:14 +0100 Subject: Fix SPARC atomic_write_barrier. --- ChangeLog | 9 +++++++++ sysdeps/sparc/sparc32/bits/atomic.h | 4 ++-- sysdeps/sparc/sparc32/sparcv9/bits/atomic.h | 2 +- sysdeps/sparc/sparc64/bits/atomic.h | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef67160e1b..41bfbe77fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-10-31 Torvald Riegel + + * sysdeps/sparc/sparc32/bits/atomic.h (atomic_write_barrier): Use + correct barrier instruction. + * sysdeps/sparc/sparc32/sparcv9/bits/atomic.h (atomic_write_barrier): + Likewise. + * sysdeps/sparc/sparc64/bits/atomic.h (atomic_write_barrier): + Likewise. + 2014-10-30 Roland McGrath * include/ctype.h: Include first thing rather than diff --git a/sysdeps/sparc/sparc32/bits/atomic.h b/sysdeps/sparc/sparc32/bits/atomic.h index 39c2b37655..251e65662d 100644 --- a/sysdeps/sparc/sparc32/bits/atomic.h +++ b/sysdeps/sparc/sparc32/bits/atomic.h @@ -343,8 +343,8 @@ extern uint64_t _dl_hwcap __attribute__((weak)); #define atomic_write_barrier() \ do { \ if (__atomic_is_v9) \ - /* membar #StoreLoad | #StoreStore */ \ - __asm __volatile (".word 0x8143e00a" : : : "memory"); \ + /* membar #LoadStore | #StoreStore */ \ + __asm __volatile (".word 0x8143e00c" : : : "memory"); \ else \ __asm __volatile ("" : : : "memory"); \ } while (0) diff --git a/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h b/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h index 4835019202..310e6365e9 100644 --- a/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h +++ b/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h @@ -96,4 +96,4 @@ typedef uintmax_t uatomic_max_t; #define atomic_read_barrier() \ __asm __volatile ("membar #LoadLoad | #LoadStore" : : : "memory") #define atomic_write_barrier() \ - __asm __volatile ("membar #StoreLoad | #StoreStore" : : : "memory") + __asm __volatile ("membar #LoadStore | #StoreStore" : : : "memory") diff --git a/sysdeps/sparc/sparc64/bits/atomic.h b/sysdeps/sparc/sparc64/bits/atomic.h index ad9dae1d0f..d348ed20ae 100644 --- a/sysdeps/sparc/sparc64/bits/atomic.h +++ b/sysdeps/sparc/sparc64/bits/atomic.h @@ -117,4 +117,4 @@ typedef uintmax_t uatomic_max_t; #define atomic_read_barrier() \ __asm __volatile ("membar #LoadLoad | #LoadStore" : : : "memory") #define atomic_write_barrier() \ - __asm __volatile ("membar #StoreLoad | #StoreStore" : : : "memory") + __asm __volatile ("membar #LoadStore | #StoreStore" : : : "memory") -- cgit 1.4.1