···7070 if something tries to do an invalid cmpxchg(). */7171extern void __cmpxchg_called_with_bad_pointer(void);72727373-#define __HAVE_ARCH_CMPXCHG 17474-7573static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,7674 unsigned long new, int size)7775{
-1
arch/hexagon/include/asm/cmpxchg.h
···6464 * looks just like atomic_cmpxchg on our arch currently with a bunch of6565 * variable casting.6666 */6767-#define __HAVE_ARCH_CMPXCHG 168676968#define cmpxchg(ptr, old, new) \7069({ \
-2
arch/ia64/include/uapi/asm/cmpxchg.h
···6161 * indicated by comparing RETURN with OLD.6262 */63636464-#define __HAVE_ARCH_CMPXCHG 16565-6664/*6765 * This function doesn't exist, so you'll get a linker error6866 * if something tries to do an invalid cmpxchg().
-2
arch/m32r/include/asm/cmpxchg.h
···107107 ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \108108 sizeof(*(ptr))))109109110110-#define __HAVE_ARCH_CMPXCHG 1111111-112110static inline unsigned long113111__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)114112{
-1
arch/m68k/include/asm/cmpxchg.h
···9090 * indicated by comparing RETURN with OLD.9191 */9292#ifdef CONFIG_RMW_INSNS9393-#define __HAVE_ARCH_CMPXCHG 194939594static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,9695 unsigned long new, int size)
···4646#define xchg(ptr, x) \4747 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))48484949-#define __HAVE_ARCH_CMPXCHG 15050-5149/* bug catcher for when unsupported size is used - won't link */5250extern void __cmpxchg_called_with_bad_pointer(void);5351
-1
arch/powerpc/include/asm/cmpxchg.h
···144144 * Compare and exchange - if *p == old, set it to new,145145 * and return the old value of *p.146146 */147147-#define __HAVE_ARCH_CMPXCHG 1148147149148static __always_inline unsigned long150149__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
···4646 * if something tries to do an invalid cmpxchg(). */4747extern void __cmpxchg_called_with_bad_pointer(void);48484949-#define __HAVE_ARCH_CMPXCHG 15050-5149static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,5250 unsigned long new, int size)5351{
-1
arch/sparc/include/asm/cmpxchg_32.h
···3434 *3535 * Cribbed from <asm-parisc/atomic.h>3636 */3737-#define __HAVE_ARCH_CMPXCHG 138373938/* bug catcher for when unsupported size is used - won't link */4039void __cmpxchg_called_with_bad_pointer(void);
-2
arch/sparc/include/asm/cmpxchg_64.h
···65656666#include <asm-generic/cmpxchg-local.h>67676868-#define __HAVE_ARCH_CMPXCHG 16969-7068static inline unsigned long7169__cmpxchg_u32(volatile int *m, int old, int new)7270{
-3
arch/tile/include/asm/atomic_64.h
···105105106106#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)107107108108-/* Define this to indicate that cmpxchg is an efficient operation. */109109-#define __HAVE_ARCH_CMPXCHG110110-111108#endif /* !__ASSEMBLY__ */112109113110#endif /* _ASM_TILE_ATOMIC_64_H */
-2
arch/x86/include/asm/cmpxchg.h
···44#include <linux/compiler.h>55#include <asm/alternative.h> /* Provides LOCK_PREFIX */6677-#define __HAVE_ARCH_CMPXCHG 188-97/*108 * Non-existant functions to indicate usage errors at link time119 * (or compile-time if the compiler implements __compiletime_error().