summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/cmpxchg.h
diff options
context:
space:
mode:
authorJonas Bonn <jonas@southpole.se>2013-02-28 06:37:05 +0100
committerJonas Bonn <jonas@southpole.se>2013-03-13 06:11:05 +0100
commit00c30e0681bf5563c8670c0ab419886f56626430 (patch)
tree994d47deeb1771f3018317d7bad45dfbf7ba9d19 /include/asm-generic/cmpxchg.h
parentd4cb776f33c7343e805dc3d6dd71a80eff9f66f1 (diff)
downloadlinux-00c30e0681bf5563c8670c0ab419886f56626430.tar.bz2
asm-generic: move cmpxchg*_local defs to cmpxchg.h
asm/cmpxchg.h can be included on its own and needs to be self-consistent. The definitions for the cmpxchg*_local macros, as such, need to be part of this file. This fixes a build issue on OpenRISC since the system.h smashing patch 96f951edb1f1bdbbc99b0cd458f9808bb83d58ae that introdued the direct inclusion asm/cmpxchg.h into linux/llist.h. CC: David Howells <dhowells@redhat.com> Signed-off-by: Jonas Bonn <jonas@southpole.se> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic/cmpxchg.h')
-rw-r--r--include/asm-generic/cmpxchg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h
index 14883026015d..811fb1e9b061 100644
--- a/include/asm-generic/cmpxchg.h
+++ b/include/asm-generic/cmpxchg.h
@@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
*/
#include <asm-generic/cmpxchg-local.h>
+#ifndef cmpxchg_local
+#define cmpxchg_local(ptr, o, n) \
+ ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
+ (unsigned long)(n), sizeof(*(ptr))))
+#endif
+
+#ifndef cmpxchg64_local
+#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))