From: Hauke Mehrtens Date: Fri, 21 Feb 2014 17:59:25 +0000 (+0100) Subject: backports: add atomic64_set() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6a56ae7768b14eda33c7efbc42a56b5019ac41c6;p=openwrt%2Fstaging%2Fblogic.git backports: add atomic64_set() atomic64_set() is now used by mac80211 and it is not available on some old arm kernels. Signed-off-by: Hauke Mehrtens --- diff --git a/backport/compat/compat_atomic.c b/backport/compat/compat_atomic.c index f91ae757f42f..5ced5a490ed0 100644 --- a/backport/compat/compat_atomic.c +++ b/backport/compat/compat_atomic.c @@ -17,6 +17,16 @@ long long atomic64_read(const atomic64_t *v) } EXPORT_SYMBOL_GPL(atomic64_read); +void atomic64_set(atomic64_t *v, long long i) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + v->counter = i; + spin_unlock_irqrestore(&lock, flags); +} +EXPORT_SYMBOL_GPL(atomic64_set); + long long atomic64_add_return(long long a, atomic64_t *v) { unsigned long flags;