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.
12 #define ATOMIC_OP(op, c_op) \
13 static inline void atomic_##op(int i, atomic_t *v) \
15 unsigned long flags; \
17 raw_local_irq_save(flags); \
19 raw_local_irq_restore(flags); \
22 #define ATOMIC_OP_RETURN(op, c_op) \
23 static inline int atomic_##op##_return(int i, atomic_t *v) \
25 unsigned long temp, flags; \
27 raw_local_irq_save(flags); \
31 raw_local_irq_restore(flags); \
36 #define ATOMIC_OPS(op, c_op) ATOMIC_OP(op, c_op) ATOMIC_OP_RETURN(op, c_op)
45 #undef ATOMIC_OP_RETURN
48 #endif /* __ASM_SH_ATOMIC_IRQ_H */