projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d51e989
)
frv: add atomic64_add_unless()
author
Sudip Mukherjee
<
[email protected]
>
Tue, 24 Jan 2017 23:18:21 +0000
(15:18 -0800)
committer
Linus Torvalds
<
[email protected]
>
Wed, 25 Jan 2017 00:26:14 +0000
(16:26 -0800)
The build of frv allmodconfig was failing with the error:
lib/atomic64_test.c:209:9: error:
implicit declaration of function 'atomic64_add_unless'
All the atomic64 operations were defined in frv, but
atomic64_add_unless() was not done.
Implement atomic64_add_unless() as done in other arches.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Sudip Mukherjee <
[email protected]
>
Cc: David Howells <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
arch/frv/include/asm/atomic.h
patch
|
blob
|
history
diff --git
a/arch/frv/include/asm/atomic.h
b/arch/frv/include/asm/atomic.h
index 1c2a5e264fc71cfd52f2acb0b24ddb1aff792be7..994ed3d5ca0805bfb33a2c6da2dac9864c5d2a1a 100644
(file)
--- a/
arch/frv/include/asm/atomic.h
+++ b/
arch/frv/include/asm/atomic.h
@@
-161,6
+161,22
@@
static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
return c;
}
+static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u)
+{
+ long long c, old;
+
+ c = atomic64_read(v);
+ for (;;) {
+ if (unlikely(c == u))
+ break;
+ old = atomic64_cmpxchg(v, c, c + i);
+ if (likely(old == c))
+ break;
+ c = old;
+ }
+ return c != u;
+}
+
#define ATOMIC_OP(op) \
static inline int atomic_fetch_##op(int i, atomic_t *v) \
{ \