diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-28 15:56:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-28 15:56:32 -0400 |
commit | 1ba4b8cb94e59b17fd0142a509eb583695c36db6 (patch) | |
tree | e42d1967025670401758d32964a5fa048f59f10a /include/linux | |
parent | c4a227d89f758e582fd167bb15245f2704de99ef (diff) | |
parent | cc3ce5176d83cd8ae1134f86e208ea758d6cb78e (diff) |
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.h | 13 |
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) | |||
34 | } | 34 | } |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifndef CONFIG_ARCH_HAS_ATOMIC_OR | ||
38 | static 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 */ |