add uatomic_generic.h, use it for common definitions
[urcu.git] / urcu / arch_s390.h
index 6c69a46cf36a33a3954780201a87297414127716..4ad3ee8edd39e8c9f7752ebc0d82db4e90722280 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ARCH_S390_H
-#define _ARCH_S390_H
+#ifndef _URCU_ARCH_S390_H
+#define _URCU_ARCH_S390_H
 
 /*
  * Trivial definitions for the S390 architecture based on information from the
  * IN THE SOFTWARE.
  */
 
-#include <compiler.h>
-#include <arch_uatomic.h>
+#include <urcu/compiler.h>
+#include <urcu/config.h>
 
-#define CONFIG_HAVE_MEM_COHERENCY
-/* Assume SMP machine, given we don't have this information */
-#define CONFIG_SMP 1
+#ifdef __cplusplus
+extern "C" {
+#endif 
+
+#define CACHE_LINE_SIZE        128
+
+#ifndef __SIZEOF_LONG__
+#ifdef __s390x__
+#define __SIZEOF_LONG__ 8
+#else
+#define __SIZEOF_LONG__ 4
+#endif
+#endif
 
 #ifndef BITS_PER_LONG
 #define BITS_PER_LONG  (__SIZEOF_LONG__ * 8)
 #endif
 
 #define mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
-#define rmb()   __asm__ __volatile__("bcr 15,0" : : : "memory");
-#define wmb()   __asm__ __volatile__("bcr 15,0" : : : "memory");
-#define mc()   barrier()
-#define rmc()  barrier()
-#define wmc()  barrier()
-
-#define smp_mb()       mb()
-#define smp_rmb()      rmb()
-#define smp_wmb()      wmb()
-#define smp_mc()       mc()
-#define smp_rmc()      rmc()
-#define smp_wmc()      wmc()
-
-/* Nop everywhere except on alpha. */
-#define smp_read_barrier_depends()
-
-static inline void cpu_relax(void)
-{
-       barrier();
-}
-
-static inline void sync_core()
-{
-       __asm__ __volatile__("bcr 15,0" : : : "memory");
-}
 
 typedef unsigned long long cycles_t;
 
@@ -77,4 +62,10 @@ static inline cycles_t get_cycles (void)
        return cycles;
 }
 
-#endif /* _ARCH_S390_H */
+#ifdef __cplusplus 
+}
+#endif
+
+#include <urcu/arch_generic.h>
+
+#endif /* _URCU_ARCH_S390_H */
This page took 0.02496 seconds and 4 git commands to generate.