1 #ifndef _ASM_SCORE_CMPXCHG_H
2 #define _ASM_SCORE_CMPXCHG_H
4 #include <linux/irqflags.h>
6 struct __xchg_dummy
{ unsigned long a
[100]; };
7 #define __xg(x) ((struct __xchg_dummy *)(x))
10 unsigned long __xchg(volatile unsigned long *m
, unsigned long val
)
15 local_irq_save(flags
);
18 local_irq_restore(flags
);
22 #define xchg(ptr, v) \
23 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
26 static inline unsigned long __cmpxchg(volatile unsigned long *m
,
27 unsigned long old
, unsigned long new)
32 local_irq_save(flags
);
36 local_irq_restore(flags
);
40 #define cmpxchg(ptr, o, n) \
41 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
45 #include <asm-generic/cmpxchg-local.h>
47 #endif /* _ASM_SCORE_CMPXCHG_H */