linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation
@ 2013-09-26 15:13 Will Deacon
  2013-09-26 15:13 ` Will Deacon
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Will Deacon @ 2013-09-26 15:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: tony.luck, torvalds, linux-arch, Will Deacon, Arnd Bergmann

cmpxchg64_relaxed can be used to provide barrier-less semantics for a
64-bit cmpxchg operation in cases where the strong memory ordering is
not required.

This patch implements a dummy implementation for asm-generic, falling
back to the usual cmpxchg64 code.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 include/asm-generic/cmpxchg.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h
index 811fb1e..298b9d4 100644
--- a/include/asm-generic/cmpxchg.h
+++ b/include/asm-generic/cmpxchg.h
@@ -102,7 +102,8 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
 #endif
 
-#define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))
-#define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n))
+#define cmpxchg(ptr, o, n)		cmpxchg_local((ptr), (o), (n))
+#define cmpxchg64(ptr, o, n)		cmpxchg64_local((ptr), (o), (n))
+#define cmpxchg64_relaxed(ptr, o, n)	cmpxchg64((ptr), (o), (n))
 
 #endif /* __ASM_GENERIC_CMPXCHG_H */
-- 
1.8.2.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-09-26 15:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 15:13 [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation Will Deacon
2013-09-26 15:13 ` Will Deacon
2013-09-26 15:13 ` [RFC PATCH 2/4] x86: " Will Deacon
2013-09-26 15:13 ` [RFC PATCH 3/4] ia64: " Will Deacon
2013-09-26 15:13 ` [RFC PATCH 4/4] lib: lockref: use relaxed cmpxchg64 variant for lockless updates Will Deacon
2013-09-26 15:13   ` Will Deacon
2013-09-26 15:34 ` [RFC PATCH 1/4] asm-generic: cmpxchg: implement dummy cmpxchg64_relaxed operation Linus Torvalds
2013-09-26 15:34   ` Linus Torvalds
2013-09-26 15:53   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).