|
@@ -35,7 +35,7 @@
|
|
|
* strex/ldrex monitor on some implementations. The reason we can use it for
|
|
|
* atomic_set() is the clrex or dummy strex done on every exception return.
|
|
|
*/
|
|
|
-#define atomic_read(v) (*(volatile int *)&(v)->counter)
|
|
|
+#define atomic_read(v) ACCESS_ONCE((v)->counter)
|
|
|
#define atomic_set(v,i) (((v)->counter) = (i))
|
|
|
|
|
|
/*
|
|
@@ -139,7 +139,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
|
|
|
*/
|
|
|
#define ATOMIC64_INIT(i) { (i) }
|
|
|
|
|
|
-#define atomic64_read(v) (*(volatile long *)&(v)->counter)
|
|
|
+#define atomic64_read(v) ACCESS_ONCE((v)->counter)
|
|
|
#define atomic64_set(v,i) (((v)->counter) = (i))
|
|
|
|
|
|
#define ATOMIC64_OP(op, asm_op) \
|