uatomic: update atomic set/read, use STORE_SHARED/LOAD_SHARED
[urcu.git] / urcu / uatomic_arch_s390.h
index 917dbf2f471941457adcfff198f25c1f08747ce9..db05b15b996a36f61a0a9ed3fff96fddcbb977c4 100644 (file)
@@ -28,6 +28,9 @@
  * IN THE SOFTWARE.
  */
 
  * IN THE SOFTWARE.
  */
 
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+
 #ifndef __SIZEOF_LONG__
 #ifdef __s390x__
 #define __SIZEOF_LONG__ 8
 #ifndef __SIZEOF_LONG__
 #ifdef __s390x__
 #define __SIZEOF_LONG__ 8
 #define BITS_PER_LONG  (__SIZEOF_LONG__ * 8)
 #endif
 
 #define BITS_PER_LONG  (__SIZEOF_LONG__ * 8)
 #endif
 
-#define uatomic_set(addr, v)                           \
-do {                                                   \
-       ACCESS_ONCE(*(addr)) = (v);                     \
-} while (0)
-
-#define uatomic_read(addr)     ACCESS_ONCE(*(addr))
+#define uatomic_set(addr, v)   STORE_SHARED(*(addr), (v))
+#define uatomic_read(addr)     LOAD_SHARED(*(addr))
 
 static inline __attribute__((always_inline))
 unsigned int uatomic_exchange_32(volatile unsigned int *addr, unsigned int val)
 
 static inline __attribute__((always_inline))
 unsigned int uatomic_exchange_32(volatile unsigned int *addr, unsigned int val)
@@ -217,4 +216,6 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
                                               (unsigned long)(new),    \
                                               sizeof(*(addr)))
 
                                               (unsigned long)(new),    \
                                               sizeof(*(addr)))
 
+#define URCU_CAS_AVAIL()       1
+
 #endif /* _URCU_ARCH_ATOMIC_S390_H */
 #endif /* _URCU_ARCH_ATOMIC_S390_H */
This page took 0.023408 seconds and 4 git commands to generate.