Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6942b7d authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

atomic: 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.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2957c035
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -110,7 +110,6 @@ static __inline__ long atomic64_##op##_return(long i, atomic64_t * v) \
ATOMIC_OPS(add)
ATOMIC_OPS(sub)

#define CONFIG_ARCH_HAS_ATOMIC_OR
#define atomic_andnot atomic_andnot
#define atomic64_andnot atomic64_andnot

+0 −1
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
ATOMIC_OPS(add, +=, add)
ATOMIC_OPS(sub, -=, sub)

#define CONFIG_ARCH_HAS_ATOMIC_OR
#define atomic_andnot atomic_andnot

ATOMIC_OP(and, &=, and)
+0 −1
Original line number Diff line number Diff line
@@ -194,7 +194,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
ATOMIC_OPS(add, +=, add)
ATOMIC_OPS(sub, -=, sub)

#define CONFIG_ARCH_HAS_ATOMIC_OR
#define atomic_andnot atomic_andnot

ATOMIC_OP(and, &=, and)
+0 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
ATOMIC_OPS(add, add)
ATOMIC_OPS(sub, sub)

#define CONFIG_ARCH_HAS_ATOMIC_OR
#define atomic_andnot atomic_andnot

ATOMIC_OP(and, and)
+0 −2
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@ static inline void atomic_##op(int i, atomic_t *v) \
	(void)__atomic_##op##_return(i, v);				\
}

#define CONFIG_ARCH_HAS_ATOMIC_OR

ATOMIC_OP(and, and)
ATOMIC_OP(or, or)
ATOMIC_OP(xor, eor)
Loading