[S390] atomic: use inline asm

Use inline assemblies for atomic_read/set(). This way there shouldn't
be any questions or subtle volatile semantics left.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Heiko Carstens and committed by Martin Schwidefsky 7657e41a a8c8d7c6

+18 -4
+18 -4
arch/s390/include/asm/atomic.h
··· 36 36 37 37 static inline int atomic_read(const atomic_t *v) 38 38 { 39 - return ACCESS_ONCE(v->counter); 39 + int c; 40 + 41 + asm volatile( 42 + " l %0,%1\n" 43 + : "=d" (c) : "Q" (v->counter)); 44 + return c; 40 45 } 41 46 42 47 static inline void atomic_set(atomic_t *v, int i) 43 48 { 44 - v->counter = i; 49 + asm volatile( 50 + " st %1,%0\n" 51 + : "=Q" (v->counter) : "d" (i)); 45 52 } 46 53 47 54 static inline int atomic_add_return(int i, atomic_t *v) ··· 133 126 134 127 static inline long long atomic64_read(const atomic64_t *v) 135 128 { 136 - return ACCESS_ONCE(v->counter); 129 + long long c; 130 + 131 + asm volatile( 132 + " lg %0,%1\n" 133 + : "=d" (c) : "Q" (v->counter)); 134 + return c; 137 135 } 138 136 139 137 static inline void atomic64_set(atomic64_t *v, long long i) 140 138 { 141 - v->counter = i; 139 + asm volatile( 140 + " stg %1,%0\n" 141 + : "=Q" (v->counter) : "d" (i)); 142 142 } 143 143 144 144 static inline long long atomic64_add_return(long long i, atomic64_t *v)