Commit 56d1defe authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner

atomic: Prepare generic atomic implementation for logic ops

Clean up the #ifdef guards a bit to prepare for architectures to
supply their own logic ops.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent cbfe8fa6
...@@ -98,14 +98,22 @@ ATOMIC_OP_RETURN(add, +) ...@@ -98,14 +98,22 @@ ATOMIC_OP_RETURN(add, +)
ATOMIC_OP_RETURN(sub, -) ATOMIC_OP_RETURN(sub, -)
#endif #endif
#ifndef atomic_clear_mask #ifndef atomic_and
ATOMIC_OP(and, &) ATOMIC_OP(and, &)
#endif
#ifndef atomic_clear_mask
#define atomic_clear_mask(i, v) atomic_and(~(i), (v)) #define atomic_clear_mask(i, v) atomic_and(~(i), (v))
#endif #endif
#ifndef atomic_set_mask #ifndef atomic_or
#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
#define CONFIG_ARCH_HAS_ATOMIC_OR #define CONFIG_ARCH_HAS_ATOMIC_OR
#endif
ATOMIC_OP(or, |) ATOMIC_OP(or, |)
#endif
#ifndef atomic_set_mask
#define atomic_set_mask(i, v) atomic_or((i), (v)) #define atomic_set_mask(i, v) atomic_or((i), (v))
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment