| #ifndef _ASM_SCORE_CMPXCHG_H |
| #define _ASM_SCORE_CMPXCHG_H |
| #include <linux/irqflags.h> |
| struct __xchg_dummy { unsigned long a[100]; }; |
| #define __xg(x) ((struct __xchg_dummy *)(x)) |
| unsigned long __xchg(volatile unsigned long *m, unsigned long val) |
| local_irq_restore(flags); |
| ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \ |
| static inline unsigned long __cmpxchg(volatile unsigned long *m, |
| unsigned long old, unsigned long new) |
| local_irq_restore(flags); |
| #define cmpxchg(ptr, o, n) \ |
| ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \ |
| #define __HAVE_ARCH_CMPXCHG 1 |
| #include <asm-generic/cmpxchg-local.h> |
| #endif /* _ASM_SCORE_CMPXCHG_H */ |