diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-04-23 13:51:36 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-07-27 08:06:22 -0400 |
commit | 27782f2752aca65a241f10fb2d4508c71bb2656b (patch) | |
tree | cf8564efcf6f86a0a448a22fae9e983735bb56e7 | |
parent | 5b4a2f0f91fd4a635f380f847254d23121972e7b (diff) |
mips: Provide atomic_{or,xor,and}
Implement atomic logic ops -- atomic_{or,xor,and}.
These will replace the atomic_{set,clear}_mask functions that are
available on some archs.
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/mips/include/asm/atomic.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 26d436336f2e..0430ba6ab762 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -137,6 +137,12 @@ static __inline__ int atomic_##op##_return(int i, atomic_t * v) \ | |||
137 | ATOMIC_OPS(add, +=, addu) | 137 | ATOMIC_OPS(add, +=, addu) |
138 | ATOMIC_OPS(sub, -=, subu) | 138 | ATOMIC_OPS(sub, -=, subu) |
139 | 139 | ||
140 | #define CONFIG_ARCH_HAS_ATOMIC_OR | ||
141 | |||
142 | ATOMIC_OP(and, &=, and) | ||
143 | ATOMIC_OP(or, |=, or) | ||
144 | ATOMIC_OP(xor, ^=, xor) | ||
145 | |||
140 | #undef ATOMIC_OPS | 146 | #undef ATOMIC_OPS |
141 | #undef ATOMIC_OP_RETURN | 147 | #undef ATOMIC_OP_RETURN |
142 | #undef ATOMIC_OP | 148 | #undef ATOMIC_OP |
@@ -416,6 +422,9 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \ | |||
416 | 422 | ||
417 | ATOMIC64_OPS(add, +=, daddu) | 423 | ATOMIC64_OPS(add, +=, daddu) |
418 | ATOMIC64_OPS(sub, -=, dsubu) | 424 | ATOMIC64_OPS(sub, -=, dsubu) |
425 | ATOMIC64_OP(and, &=, and) | ||
426 | ATOMIC64_OP(or, |=, or) | ||
427 | ATOMIC64_OP(xor, ^=, xor) | ||
419 | 428 | ||
420 | #undef ATOMIC64_OPS | 429 | #undef ATOMIC64_OPS |
421 | #undef ATOMIC64_OP_RETURN | 430 | #undef ATOMIC64_OP_RETURN |