summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-28 12:56:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-28 12:56:32 -0700
commit1ba4b8cb94e59b17fd0142a509eb583695c36db6 (patch)
treee42d1967025670401758d32964a5fa048f59f10a /include/linux
parentc4a227d89f758e582fd167bb15245f2704de99ef (diff)
parentcc3ce5176d83cd8ae1134f86e208ea758d6cb78e (diff)
downloadlinux-1ba4b8cb94e59b17fd0142a509eb583695c36db6.tar.gz
linux-1ba4b8cb94e59b17fd0142a509eb583695c36db6.tar.bz2
linux-1ba4b8cb94e59b17fd0142a509eb583695c36db6.zip
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rcu: Start RCU kthreads in TASK_INTERRUPTIBLE state rcu: Remove waitqueue usage for cpu, node, and boost kthreads rcu: Avoid acquiring rcu_node locks in timer functions atomic: Add atomic_or() Documentation: Add statistics about nested locks rcu: Decrease memory-barrier usage based on semi-formal proof rcu: Make rcu_enter_nohz() pay attention to nesting rcu: Don't do reschedule unless in irq rcu: Remove old memory barriers from rcu_process_callbacks() rcu: Add memory barriers rcu: Fix unpaired rcu_irq_enter() from locking selftests
Diffstat (limited to 'include/linux')
-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 96c038e43d66..ee456c79b0e6 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)
}
#endif
+#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
+static inline void atomic_or(int i, atomic_t *v)
+{
+ int old;
+ int new;
+
+ do {
+ old = atomic_read(v);
+ new = old | i;
+ } while (atomic_cmpxchg(v, old, new) != old);
+}
+#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */
+
#endif /* _LINUX_ATOMIC_H */