X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Farch_s390.h;h=b400376a30089ffa936ad104dca88568cb3f901d;hb=36bc70a84250927ba68d5096a0a9740aec157f9b;hp=71717686c77f23589e8664981aa1126a4248896c;hpb=1ccf9cbe71d7392fb87e4b0046bd2eb94a75b541;p=urcu.git diff --git a/urcu/arch_s390.h b/urcu/arch_s390.h index 7171768..b400376 100644 --- a/urcu/arch_s390.h +++ b/urcu/arch_s390.h @@ -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 @@ -29,10 +29,23 @@ */ #include +#include + +#ifdef __cplusplus +extern "C" { +#endif #define CONFIG_HAVE_MEM_COHERENCY -/* Assume SMP machine, given we don't have this information */ -#define CONFIG_SMP 1 + +#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) @@ -45,12 +58,21 @@ #define rmc() barrier() #define wmc() barrier() +#ifdef CONFIG_URCU_SMP #define smp_mb() mb() #define smp_rmb() rmb() #define smp_wmb() wmb() #define smp_mc() mc() #define smp_rmc() rmc() #define smp_wmc() wmc() +#else +#define smp_mb() barrier() +#define smp_rmb() barrier() +#define smp_wmb() barrier() +#define smp_mc() barrier() +#define smp_rmc() barrier() +#define smp_wmc() barrier() +#endif /* Nop everywhere except on alpha. */ #define smp_read_barrier_depends() @@ -76,4 +98,8 @@ static inline cycles_t get_cycles (void) return cycles; } -#endif /* _ARCH_S390_H */ +#ifdef __cplusplus +} +#endif + +#endif /* _URCU_ARCH_S390_H */