1 #ifndef __ASM_METAG_CMPXCHG_IRQ_H
2 #define __ASM_METAG_CMPXCHG_IRQ_H
4 #include <linux/irqflags.h>
6 static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
8 unsigned long flags, retval;
10 local_irq_save(flags);
13 local_irq_restore(flags);
17 static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
19 unsigned long flags, retval;
21 local_irq_save(flags);
24 local_irq_restore(flags);
28 static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
34 local_irq_save(flags);
38 local_irq_restore(flags); /* implies memory barrier */
42 #endif /* __ASM_METAG_CMPXCHG_IRQ_H */