1 #ifndef __ASM_SH_CMPXCHG_IRQ_H
2 #define __ASM_SH_CMPXCHG_IRQ_H
4 static inline unsigned long xchg_u32(volatile u32
*m
, unsigned long val
)
6 unsigned long flags
, retval
;
11 local_irq_restore(flags
);
15 static inline unsigned long xchg_u8(volatile u8
*m
, unsigned long val
)
17 unsigned long flags
, retval
;
19 local_irq_save(flags
);
22 local_irq_restore(flags
);
26 static inline unsigned long __cmpxchg_u32(volatile int *m
, unsigned long old
,
32 local_irq_save(flags
);
36 local_irq_restore(flags
); /* implies memory barrier */
40 #endif /* __ASM_SH_CMPXCHG_IRQ_H */