X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Farch%2Fs390.h;h=67461b4d6ed1c3f6ac258b0e636a6939fd942871;hp=6dc09a3e76c9d48963a5ddc185f07bb84a4f3eae;hb=84f4ccb4bcf32c0336a0c7a3a4ba76d90d6dea1b;hpb=33f0d0b1c3c9ee55e49b6f7bed146e483e3fd935 diff --git a/urcu/arch/s390.h b/urcu/arch/s390.h index 6dc09a3..67461b4 100644 --- a/urcu/arch/s390.h +++ b/urcu/arch/s390.h @@ -31,20 +31,23 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { -#endif +#endif #define CAA_CACHE_LINE_SIZE 128 #define cmm_mb() __asm__ __volatile__("bcr 15,0" : : : "memory") -typedef unsigned long long cycles_t; +#define HAS_CAA_GET_CYCLES + +typedef uint64_t caa_cycles_t; -static inline cycles_t caa_get_cycles (void) +static inline caa_cycles_t caa_get_cycles (void) { - cycles_t cycles; + caa_cycles_t cycles; __asm__ __volatile__("stck %0" : "=m" (cycles) : : "cc", "memory" ); @@ -52,14 +55,14 @@ static inline cycles_t caa_get_cycles (void) } /* - * Define the membarrier system call number if not yet available in the - * system headers. + * On Linux, define the membarrier system call number if not yet available in + * the system headers. */ -#ifndef __NR_membarrier +#if (defined(__linux__) && !defined(__NR_membarrier)) #define __NR_membarrier 356 #endif -#ifdef __cplusplus +#ifdef __cplusplus } #endif