fix FLT_ROUNDS to reflect the current rounding mode
[musl] / arch / powerpc / atomic.h
index c4ad40c..f706543 100644 (file)
@@ -43,12 +43,6 @@ static inline void *a_cas_p(volatile void *p, void *t, void *s)
        return (void *)a_cas(p, (int)t, (int)s);
 }
 
-static inline long a_cas_l(volatile void *p, long t, long s)
-{
-       return a_cas(p, t, s);
-}
-
-
 static inline int a_swap(volatile int *x, int v)
 {
        int old;
@@ -77,11 +71,18 @@ 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()
+#define a_spin a_barrier
+
+static inline void a_barrier()
 {
+       a_cas(&(int){0}, 0, 0);
 }
 
 static inline void a_crash()