1 #ifndef __ASM_SH_ATOMIC_IRQ_H
2 #define __ASM_SH_ATOMIC_IRQ_H
5 * To get proper branch prediction for the main line, we must branch
6 * forward to code at the end of this object's .text section, then
7 * branch back to restart the operation.
9 static inline void atomic_add(int i, atomic_t *v)
13 local_irq_save(flags);
15 local_irq_restore(flags);
18 static inline void atomic_sub(int i, atomic_t *v)
22 local_irq_save(flags);
24 local_irq_restore(flags);
27 static inline int atomic_add_return(int i, atomic_t *v)
29 unsigned long temp, flags;
31 local_irq_save(flags);
35 local_irq_restore(flags);
40 static inline int atomic_sub_return(int i, atomic_t *v)
42 unsigned long temp, flags;
44 local_irq_save(flags);
48 local_irq_restore(flags);
53 static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
57 local_irq_save(flags);
59 local_irq_restore(flags);
62 static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
66 local_irq_save(flags);
68 local_irq_restore(flags);
71 #endif /* __ASM_SH_ATOMIC_IRQ_H */