Browse Source

fix missing barriers in powerpc atomic store

Rich Felker 10 years ago
parent
commit
522a0de210
1 changed files with 5 additions and 1 deletions
  1. 5 1
      arch/powerpc/atomic.h

+ 5 - 1
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()