From 6a56ae7768b14eda33c7efbc42a56b5019ac41c6 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 21 Feb 2014 18:59:25 +0100 Subject: [PATCH] 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 --- backport/compat/compat_atomic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.30.2