From 708db7729b758dd015c66e465127d9ec2c8d0e5d Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Wed, 11 May 2011 05:33:33 -0700 Subject: [PATCH] --- yaml --- r: 252677 b: refs/heads/master c: 55c2945aa9d4d907ec5ca4f6a4e30ae908d8d30d h: refs/heads/master i: 252675: 09bf03d7b01c47a6fcc7c1b5d20b77448edcd3d1 v: v3 --- [refs] | 2 +- trunk/include/linux/atomic.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index cf85f07e44ae..5a821a975e17 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 29f742f88a32c9ab8cf6d9ba69e1ea918be5aa58 +refs/heads/master: 55c2945aa9d4d907ec5ca4f6a4e30ae908d8d30d diff --git a/trunk/include/linux/atomic.h b/trunk/include/linux/atomic.h index 96c038e43d66..ee456c79b0e6 100644 --- a/trunk/include/linux/atomic.h +++ b/trunk/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 */