Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Add cmpxchg64 and cmpxchg64_local to mips

Make sure that at least cmpxchg64_local is available on all architectures to use
for unsigned long long values.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mathieu Desnoyers and committed by
Linus Torvalds
3b96a56d a259b242

+17
+17
include/asm-mips/cmpxchg.h
··· 104 104 #define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb()) 105 105 #define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, ) 106 106 107 + #define cmpxchg64(ptr, o, n) \ 108 + ({ \ 109 + BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 110 + cmpxchg((ptr), (o), (n)); \ 111 + }) 112 + 113 + #ifdef CONFIG_64BIT 114 + #define cmpxchg64_local(ptr, o, n) \ 115 + ({ \ 116 + BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 117 + cmpxchg_local((ptr), (o), (n)); \ 118 + }) 119 + #else 120 + #include <asm-generic/cmpxchg-local.h> 121 + #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 122 + #endif 123 + 107 124 #endif /* __ASM_CMPXCHG_H */