1 #ifndef __ASM_SH_ATOMIC_IRQ_H
2 #define __ASM_SH_ATOMIC_IRQ_H
4 #include <linux/irqflags.h>
7 * To get proper branch prediction for the main line, we must branch
8 * forward to code at the end of this object's .text section, then
9 * branch back to restart the operation.
11 static inline void atomic_add(int i, atomic_t *v)
15 raw_local_irq_save(flags);
17 raw_local_irq_restore(flags);
20 static inline void atomic_sub(int i, atomic_t *v)
24 raw_local_irq_save(flags);
26 raw_local_irq_restore(flags);
29 static inline int atomic_add_return(int i, atomic_t *v)
31 unsigned long temp, flags;
33 raw_local_irq_save(flags);
37 raw_local_irq_restore(flags);
42 static inline int atomic_sub_return(int i, atomic_t *v)
44 unsigned long temp, flags;
46 raw_local_irq_save(flags);
50 raw_local_irq_restore(flags);
55 static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
59 raw_local_irq_save(flags);
61 raw_local_irq_restore(flags);
64 static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
68 raw_local_irq_save(flags);
70 raw_local_irq_restore(flags);
73 #endif /* __ASM_SH_ATOMIC_IRQ_H */