diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-08-12 11:44:30 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-08-12 11:44:30 +0200 |
commit | f52609fdabb1c726f8b9fdf64df3161781aa186e (patch) | |
tree | 3b7d4a47505eddb097bab848a8ffdc4bbbf79bb7 /arch/x86/include/asm/atomic64_32.h | |
parent | locking/static_keys: Make verify_keys() static (diff) | |
parent | atomic: Add simple atomic_t tests (diff) | |
download | linux-f52609fdabb1c726f8b9fdf64df3161781aa186e.tar.xz linux-f52609fdabb1c726f8b9fdf64df3161781aa186e.zip |
Merge branch 'locking/arch-atomic' into locking/core, because it's ready for upstream
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/atomic64_32.h')
-rw-r--r-- | arch/x86/include/asm/atomic64_32.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h index b154de75c90c..a11c30b77fb5 100644 --- a/arch/x86/include/asm/atomic64_32.h +++ b/arch/x86/include/asm/atomic64_32.h @@ -313,4 +313,18 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v) #undef alternative_atomic64 #undef __alternative_atomic64 +#define ATOMIC64_OP(op, c_op) \ +static inline void atomic64_##op(long long i, atomic64_t *v) \ +{ \ + long long old, c = 0; \ + while ((old = atomic64_cmpxchg(v, c, c c_op i)) != c) \ + c = old; \ +} + +ATOMIC64_OP(and, &) +ATOMIC64_OP(or, |) +ATOMIC64_OP(xor, ^) + +#undef ATOMIC64_OP + #endif /* _ASM_X86_ATOMIC64_32_H */ |