diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2021-03-22 16:02:55 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2021-04-12 13:46:42 +0300 |
commit | c8a91c285d8c3449b32021b28bcb7fb5662403a8 (patch) | |
tree | 4ead77c1500e2f59dc3f0216f4cd9232645d5f7a /arch/s390/include/asm/atomic_ops.h | |
parent | 6000b5f4032e9be5413dcfcdd9e39eb1c9cc2453 (diff) | |
download | linux-c8a91c285d8c3449b32021b28bcb7fb5662403a8.tar.xz |
s390/atomic: move remaining inline assemblies to atomic_ops.h
Move all remaining inline assemblies from atomic.h to
atomic_ops.h. That way all atomic inline assemblies are
contained within only a single header file.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/atomic_ops.h')
-rw-r--r-- | arch/s390/include/asm/atomic_ops.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/s390/include/asm/atomic_ops.h b/arch/s390/include/asm/atomic_ops.h index 61467b9eecc7..82ed50885558 100644 --- a/arch/s390/include/asm/atomic_ops.h +++ b/arch/s390/include/asm/atomic_ops.h @@ -8,6 +8,40 @@ #ifndef __ARCH_S390_ATOMIC_OPS__ #define __ARCH_S390_ATOMIC_OPS__ +static inline int __atomic_read(const atomic_t *v) +{ + int c; + + asm volatile( + " l %0,%1\n" + : "=d" (c) : "Q" (v->counter)); + return c; +} + +static inline void __atomic_set(atomic_t *v, int i) +{ + asm volatile( + " st %1,%0\n" + : "=Q" (v->counter) : "d" (i)); +} + +static inline s64 __atomic64_read(const atomic64_t *v) +{ + s64 c; + + asm volatile( + " lg %0,%1\n" + : "=d" (c) : "Q" (v->counter)); + return c; +} + +static inline void __atomic64_set(atomic64_t *v, s64 i) +{ + asm volatile( + " stg %1,%0\n" + : "=Q" (v->counter) : "d" (i)); +} + #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES #define __ATOMIC_OP(op_name, op_type, op_string, op_barrier) \ |