]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/sh/include/asm/atomic-irq.h
61d107523f0649245c138701e4e1f56b2f000d98
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)
42 #undef ATOMIC_OP_RETURN
45 static inline void atomic_clear_mask(unsigned int mask
, atomic_t
*v
)
49 raw_local_irq_save(flags
);
51 raw_local_irq_restore(flags
);
54 static inline void atomic_set_mask(unsigned int mask
, atomic_t
*v
)
58 raw_local_irq_save(flags
);
60 raw_local_irq_restore(flags
);
63 #endif /* __ASM_SH_ATOMIC_IRQ_H */