summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/cmpxchg.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-02-15 22:06:08 +0100
committerSteve French <sfrench@us.ibm.com>2008-02-15 22:06:08 +0100
commit0a3abcf75bf391fec4e32356ab5ddb8f5d2e6b41 (patch)
treeb80b1d344ec24cad28b057ef803cebac9434be01 /include/asm-mips/cmpxchg.h
parent[CIFS] factoring out common code in get_inode_info functions (diff)
parentLinux 2.6.25-rc2 (diff)
downloadlinux-0a3abcf75bf391fec4e32356ab5ddb8f5d2e6b41.tar.xz
linux-0a3abcf75bf391fec4e32356ab5ddb8f5d2e6b41.zip
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/asm-mips/cmpxchg.h')
-rw-r--r--include/asm-mips/cmpxchg.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h
index a5ec0e5dc5b8..4a812c3ceb90 100644
--- a/include/asm-mips/cmpxchg.h
+++ b/include/asm-mips/cmpxchg.h
@@ -104,4 +104,21 @@ extern void __cmpxchg_called_with_bad_pointer(void);
#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb())
#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, )
+#define cmpxchg64(ptr, o, n) \
+ ({ \
+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
+ cmpxchg((ptr), (o), (n)); \
+ })
+
+#ifdef CONFIG_64BIT
+#define cmpxchg64_local(ptr, o, n) \
+ ({ \
+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
+ cmpxchg_local((ptr), (o), (n)); \
+ })
+#else
+#include <asm-generic/cmpxchg-local.h>
+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+#endif
+
#endif /* __ASM_CMPXCHG_H */