From: Mathieu Desnoyers Date: Thu, 24 Sep 2009 00:10:51 +0000 (-0400) Subject: rcu torture and api.h: remove duplicated atomic primitives X-Git-Tag: v0.1~35 X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=6ee91d83a7a5b33160158f57f94dd75e6d0a67ed rcu torture and api.h: remove duplicated atomic primitives Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/api_gcc.h b/tests/api_gcc.h index 963f842..721af0a 100644 --- a/tests/api_gcc.h +++ b/tests/api_gcc.h @@ -75,6 +75,7 @@ #define LOCK_PREFIX "lock ; " +#if 0 /* duplicate with arch_atomic.h */ /* * Atomic data structure, initialization, and access. */ @@ -251,6 +252,8 @@ cmpxchg(volatile long *ptr, long oldval, long newval) #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() +#endif //0 /* duplicate with arch_atomic.h */ + /* * api_pthreads.h: API mapping to pthreads environment. * diff --git a/tests/api_ppc.h b/tests/api_ppc.h index 1d9c47e..8359d04 100644 --- a/tests/api_ppc.h +++ b/tests/api_ppc.h @@ -77,6 +77,8 @@ #define ____cacheline_internodealigned_in_smp \ __attribute__((__aligned__(1 << 7))) +#if 0 /* duplicate with arch_atomic.h */ + /* * Atomic data structure, initialization, and access. */ @@ -102,7 +104,6 @@ typedef struct { volatile int counter; } atomic_t; # define ISYNC_ON_SMP #endif - /* * Atomic exchange * @@ -617,6 +618,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) #define smp_mb__before_atomic_inc() smp_mb() #define smp_mb__after_atomic_inc() smp_mb() +#endif //0 /* duplicate with arch_atomic.h */ + /* * api_pthreads.h: API mapping to pthreads environment. * diff --git a/tests/api_x86.h b/tests/api_x86.h index d64eb8d..9ca5500 100644 --- a/tests/api_x86.h +++ b/tests/api_x86.h @@ -77,6 +77,8 @@ #define LOCK_PREFIX "lock ; " +#if 0 /* duplicate with arch_atomic.h */ + /* * Atomic data structure, initialization, and access. */ @@ -310,6 +312,8 @@ __asm__ __volatile__(LOCK_PREFIX "orl %0,%1" \ #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() +#endif //0 + /* * api_pthreads.h: API mapping to pthreads environment. * diff --git a/tests/rcutorture.h b/tests/rcutorture.h index 00b0b31..7d4948e 100644 --- a/tests/rcutorture.h +++ b/tests/rcutorture.h @@ -70,7 +70,7 @@ DEFINE_PER_THREAD(long long, n_updates_pt); long long n_reads = 0LL; long n_updates = 0L; -atomic_t nthreadsrunning; +int nthreadsrunning; char argsbuf[64]; #define GOFLAG_INIT 0 diff --git a/tests/urcutorture.c b/tests/urcutorture.c index 70abc68..a0aa5dd 100644 --- a/tests/urcutorture.c +++ b/tests/urcutorture.c @@ -3,6 +3,7 @@ #include #include #include +#include "../arch_atomic.h" #include "api.h" #define _LGPL_SOURCE #include "../urcu.h"