aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-04-23 13:51:36 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-07-27 08:06:22 -0400
commit27782f2752aca65a241f10fb2d4508c71bb2656b (patch)
treecf8564efcf6f86a0a448a22fae9e983735bb56e7
parent5b4a2f0f91fd4a635f380f847254d23121972e7b (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.h9
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) \
137ATOMIC_OPS(add, +=, addu) 137ATOMIC_OPS(add, +=, addu)
138ATOMIC_OPS(sub, -=, subu) 138ATOMIC_OPS(sub, -=, subu)
139 139
140#define CONFIG_ARCH_HAS_ATOMIC_OR
141
142ATOMIC_OP(and, &=, and)
143ATOMIC_OP(or, |=, or)
144ATOMIC_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
417ATOMIC64_OPS(add, +=, daddu) 423ATOMIC64_OPS(add, +=, daddu)
418ATOMIC64_OPS(sub, -=, dsubu) 424ATOMIC64_OPS(sub, -=, dsubu)
425ATOMIC64_OP(and, &=, and)
426ATOMIC64_OP(or, |=, or)
427ATOMIC64_OP(xor, ^=, xor)
419 428
420#undef ATOMIC64_OPS 429#undef ATOMIC64_OPS
421#undef ATOMIC64_OP_RETURN 430#undef ATOMIC64_OP_RETURN