summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-07-19 18:34:10 -0400
committerRich Felker <dalias@aerifal.cx>2014-07-19 18:34:10 -0400
commit522a0de2101abd12b19a4d2ba5c09abbb7c5fc79 (patch)
treeec69aac4b41ddc9033a0708fc22ac2bfdd720e7c
parent884cc0c7e253601b96902120ed689f34d12f8aa0 (diff)
downloadmusl-522a0de2101abd12b19a4d2ba5c09abbb7c5fc79.tar.gz
musl-522a0de2101abd12b19a4d2ba5c09abbb7c5fc79.tar.bz2
musl-522a0de2101abd12b19a4d2ba5c09abbb7c5fc79.tar.xz
musl-522a0de2101abd12b19a4d2ba5c09abbb7c5fc79.zip
fix missing barriers in powerpc atomic store
-rw-r--r--arch/powerpc/atomic.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/atomic.h b/arch/powerpc/atomic.h
index c4ad40cd..a082c09b 100644
--- a/arch/powerpc/atomic.h
+++ b/arch/powerpc/atomic.h
@@ -77,7 +77,11 @@ static inline void a_dec(volatile int *x)
static inline void a_store(volatile int *p, int x)
{
- *p=x;
+ __asm__ __volatile__ ("\n"
+ " sync\n"
+ " stw %1, %0\n"
+ " isync\n"
+ : "=m"(*p) : "r"(x) : "memory" );
}
static inline void a_spin()