From: Pierre-Marc Fournier Date: Fri, 3 Apr 2009 19:04:09 +0000 (-0400) Subject: kernelcompat: remove local ops as they are now in libkcompat X-Git-Tag: v1.9.1~1014 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=16a93583f647cb6e5da1ed395462200aaf07bb2d;p=lttng-ust.git kernelcompat: remove local ops as they are now in libkcompat --- diff --git a/share/kernelcompat.h b/share/kernelcompat.h index f141bc54..41746d9f 100644 --- a/share/kernelcompat.h +++ b/share/kernelcompat.h @@ -93,7 +93,7 @@ static inline long IS_ERR(const void *ptr) /* MEMORY BARRIERS */ -#define smp_mb__after_atomic_inc() do {} while(0) +//#define smp_mb__after_atomic_inc() do {} while(0) ///* RCU */ // @@ -105,78 +105,78 @@ static inline long IS_ERR(const void *ptr) /* ATOMICITY */ -#include - -static inline int atomic_dec_and_test(atomic_t *p) -{ - (p->counter)--; - return !p->counter; -} - -static inline void atomic_set(atomic_t *p, int v) -{ - p->counter=v; -} - -static inline void atomic_inc(atomic_t *p) -{ - p->counter++; -} - -static int atomic_read(atomic_t *p) -{ - return p->counter; -} - -#define atomic_long_t atomic_t -#define atomic_long_set atomic_set -#define atomic_long_read atomic_read +//#include +// +//static inline int atomic_dec_and_test(atomic_t *p) +//{ +// (p->counter)--; +// return !p->counter; +//} +// +//static inline void atomic_set(atomic_t *p, int v) +//{ +// p->counter=v; +//} +// +//static inline void atomic_inc(atomic_t *p) +//{ +// p->counter++; +//} +// +//static int atomic_read(atomic_t *p) +//{ +// return p->counter; +//} +// +//#define atomic_long_t atomic_t +//#define atomic_long_set atomic_set +//#define atomic_long_read atomic_read //#define __xg(x) ((volatile long *)(x)) -#define cmpxchg(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ +//#define cmpxchg(ptr, o, n) \ +// ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ (unsigned long)(n), sizeof(*(ptr)))) //#define local_cmpxchg cmpxchg -#define local_cmpxchg(l, o, n) (cmpxchg(&((l)->a.counter), (o), (n))) +//#define local_cmpxchg(l, o, n) (cmpxchg(&((l)->a.counter), (o), (n))) -#define atomic_long_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) +//#define atomic_long_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) /* LOCAL OPS */ //typedef int local_t; -typedef struct -{ - atomic_long_t a; -} local_t; - - -static inline void local_inc(local_t *l) -{ - (l->a.counter)++; -} - -static inline void local_set(local_t *l, int v) -{ - l->a.counter = v; -} - -static inline void local_add(int v, local_t *l) -{ - l->a.counter += v; -} - -static int local_add_return(int v, local_t *l) -{ - return l->a.counter += v; -} - -static inline int local_read(local_t *l) -{ - return l->a.counter; -} +//typedef struct +//{ +// atomic_long_t a; +//} local_t; +// +// +//static inline void local_inc(local_t *l) +//{ +// (l->a.counter)++; +//} +// +//static inline void local_set(local_t *l, int v) +//{ +// l->a.counter = v; +//} +// +//static inline void local_add(int v, local_t *l) +//{ +// l->a.counter += v; +//} +// +//static int local_add_return(int v, local_t *l) +//{ +// return l->a.counter += v; +//} +// +//static inline int local_read(local_t *l) +//{ +// return l->a.counter; +//} /* ATTRIBUTES */