From 0761630e92fb6e1e60e021cc3b1f79515ac28c57 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 22 Aug 2007 13:51:45 +0200 Subject: [PATCH] --- yaml --- r: 64202 b: refs/heads/master c: c51b9621796c31810fb66509ea1faee4597d9c03 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/asm-s390/atomic.h | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 33289e82ed63..102949f9eab2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9c5f225f1a2c67c57ff5dfbe0589de20c5706a16 +refs/heads/master: c51b9621796c31810fb66509ea1faee4597d9c03 diff --git a/trunk/include/asm-s390/atomic.h b/trunk/include/asm-s390/atomic.h index ea486952f778..2d184655bc5d 100644 --- a/trunk/include/asm-s390/atomic.h +++ b/trunk/include/asm-s390/atomic.h @@ -67,8 +67,17 @@ typedef struct { #endif /* __GNUC__ */ -#define atomic_read(v) ((v)->counter) -#define atomic_set(v,i) (((v)->counter) = (i)) +static inline int atomic_read(const atomic_t *v) +{ + barrier(); + return v->counter; +} + +static inline void atomic_set(atomic_t *v, int i) +{ + v->counter = i; + barrier(); +} static __inline__ int atomic_add_return(int i, atomic_t * v) { @@ -182,8 +191,17 @@ typedef struct { #endif /* __GNUC__ */ -#define atomic64_read(v) ((v)->counter) -#define atomic64_set(v,i) (((v)->counter) = (i)) +static inline long long atomic64_read(const atomic64_t *v) +{ + barrier(); + return v->counter; +} + +static inline void atomic64_set(atomic64_t *v, long long i) +{ + v->counter = i; + barrier(); +} static __inline__ long long atomic64_add_return(long long i, atomic64_t * v) {