aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/atomic.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index 96c038e43d6..ee456c79b0e 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -34,4 +34,17 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
34} 34}
35#endif 35#endif
36 36
37#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
38static inline void atomic_or(int i, atomic_t *v)
39{
40 int old;
41 int new;
42
43 do {
44 old = atomic_read(v);
45 new = old | i;
46 } while (atomic_cmpxchg(v, old, new) != old);
47}
48#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */
49
37#endif /* _LINUX_ATOMIC_H */ 50#endif /* _LINUX_ATOMIC_H */