From: Mathieu Desnoyers Date: Tue, 29 Sep 2015 15:56:28 +0000 (-0400) Subject: Fix: only define membarrier system call on Linux X-Git-Tag: v0.9.0~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=84f4ccb4bcf32c0336a0c7a3a4ba76d90d6dea1b;p=userspace-rcu.git Fix: only define membarrier system call on Linux Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/arch/aarch64.h b/urcu/arch/aarch64.h index a68813d..d6a1337 100644 --- a/urcu/arch/aarch64.h +++ b/urcu/arch/aarch64.h @@ -34,11 +34,11 @@ extern "C" { #include /* - * Define the membarrier system call number if not yet available in the - * system headers. aarch64 implements asm-generic/unistd.h system call + * On Linux, define the membarrier system call number if not yet available in + * the system headers. aarch64 implements asm-generic/unistd.h system call * numbers. */ -#ifndef __NR_membarrier +#if (defined(__linux__) && !defined(__NR_membarrier)) #define __NR_membarrier 283 #endif diff --git a/urcu/arch/arm.h b/urcu/arch/arm.h index d7affaa..5cbca7d 100644 --- a/urcu/arch/arm.h +++ b/urcu/arch/arm.h @@ -40,10 +40,10 @@ extern "C" { #include /* - * 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 389 #endif diff --git a/urcu/arch/ia64.h b/urcu/arch/ia64.h index 12834f3..bca007c 100644 --- a/urcu/arch/ia64.h +++ b/urcu/arch/ia64.h @@ -34,10 +34,10 @@ extern "C" { #include /* - * 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 1344 #endif diff --git a/urcu/arch/ppc.h b/urcu/arch/ppc.h index 7e2b621..791529e 100644 --- a/urcu/arch/ppc.h +++ b/urcu/arch/ppc.h @@ -109,10 +109,10 @@ static inline caa_cycles_t caa_get_cycles(void) #endif /* - * 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 365 #endif diff --git a/urcu/arch/s390.h b/urcu/arch/s390.h index e71f99e..67461b4 100644 --- a/urcu/arch/s390.h +++ b/urcu/arch/s390.h @@ -55,10 +55,10 @@ static inline caa_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 diff --git a/urcu/arch/tile.h b/urcu/arch/tile.h index 94dad40..eae1161 100644 --- a/urcu/arch/tile.h +++ b/urcu/arch/tile.h @@ -34,11 +34,11 @@ extern "C" { #include /* - * Define the membarrier system call number if not yet available in the - * system headers. tile implements asm-generic/unistd.h system call + * On Linux, define the membarrier system call number if not yet available in + * the system headers. tile implements asm-generic/unistd.h system call * numbers. */ -#ifndef __NR_membarrier +#if (defined(__linux__) && !defined(__NR_membarrier)) #define __NR_membarrier 283 #endif diff --git a/urcu/arch/x86.h b/urcu/arch/x86.h index b4d3694..aac8ca1 100644 --- a/urcu/arch/x86.h +++ b/urcu/arch/x86.h @@ -91,15 +91,13 @@ static inline caa_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. */ +#if (defined(__linux__) && !defined(__NR_membarrier)) #if (CAA_BITS_PER_LONG == 32) -#ifndef __NR_membarrier #define __NR_membarrier 375 -#endif #else -#ifndef __NR_membarrier #define __NR_membarrier 324 #endif #endif