diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-04-17 18:54:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-06-16 04:48:32 -0400 |
commit | 28aa2bda2211f4327d83b44a4f917b4a061b1c56 (patch) | |
tree | e47ab8a7c49f19bd42722dcc2b8cf083e08cf270 /include/asm-generic/atomic64.h | |
parent | e12133324b7daaa176bb687c1eb59e1a6b203da4 (diff) |
locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
Now that all the architectures have implemented support for these new
atomic primitives add on the generic infrastructure to expose and use
it.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/asm-generic/atomic64.h')
-rw-r--r-- | include/asm-generic/atomic64.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/asm-generic/atomic64.h b/include/asm-generic/atomic64.h index d48e78ccad3d..dad68bf46c77 100644 --- a/include/asm-generic/atomic64.h +++ b/include/asm-generic/atomic64.h | |||
@@ -27,16 +27,23 @@ extern void atomic64_##op(long long a, atomic64_t *v); | |||
27 | #define ATOMIC64_OP_RETURN(op) \ | 27 | #define ATOMIC64_OP_RETURN(op) \ |
28 | extern long long atomic64_##op##_return(long long a, atomic64_t *v); | 28 | extern long long atomic64_##op##_return(long long a, atomic64_t *v); |
29 | 29 | ||
30 | #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) | 30 | #define ATOMIC64_FETCH_OP(op) \ |
31 | extern long long atomic64_fetch_##op(long long a, atomic64_t *v); | ||
32 | |||
33 | #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op) | ||
31 | 34 | ||
32 | ATOMIC64_OPS(add) | 35 | ATOMIC64_OPS(add) |
33 | ATOMIC64_OPS(sub) | 36 | ATOMIC64_OPS(sub) |
34 | 37 | ||
35 | ATOMIC64_OP(and) | 38 | #undef ATOMIC64_OPS |
36 | ATOMIC64_OP(or) | 39 | #define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_FETCH_OP(op) |
37 | ATOMIC64_OP(xor) | 40 | |
41 | ATOMIC64_OPS(and) | ||
42 | ATOMIC64_OPS(or) | ||
43 | ATOMIC64_OPS(xor) | ||
38 | 44 | ||
39 | #undef ATOMIC64_OPS | 45 | #undef ATOMIC64_OPS |
46 | #undef ATOMIC64_FETCH_OP | ||
40 | #undef ATOMIC64_OP_RETURN | 47 | #undef ATOMIC64_OP_RETURN |
41 | #undef ATOMIC64_OP | 48 | #undef ATOMIC64_OP |
42 | 49 | ||