1 #ifndef __ASM_SH_BITOPS_IRQ_H
2 #define __ASM_SH_BITOPS_IRQ_H
4 static inline void set_bit(int nr
, volatile void *addr
)
7 volatile unsigned int *a
= addr
;
11 mask
= 1 << (nr
& 0x1f);
12 local_irq_save(flags
);
14 local_irq_restore(flags
);
17 static inline void clear_bit(int nr
, volatile void *addr
)
20 volatile unsigned int *a
= addr
;
24 mask
= 1 << (nr
& 0x1f);
25 local_irq_save(flags
);
27 local_irq_restore(flags
);
30 static inline void change_bit(int nr
, volatile void *addr
)
33 volatile unsigned int *a
= addr
;
37 mask
= 1 << (nr
& 0x1f);
38 local_irq_save(flags
);
40 local_irq_restore(flags
);
43 static inline int test_and_set_bit(int nr
, volatile void *addr
)
46 volatile unsigned int *a
= addr
;
50 mask
= 1 << (nr
& 0x1f);
51 local_irq_save(flags
);
52 retval
= (mask
& *a
) != 0;
54 local_irq_restore(flags
);
59 static inline int test_and_clear_bit(int nr
, volatile void *addr
)
62 volatile unsigned int *a
= addr
;
66 mask
= 1 << (nr
& 0x1f);
67 local_irq_save(flags
);
68 retval
= (mask
& *a
) != 0;
70 local_irq_restore(flags
);
75 static inline int test_and_change_bit(int nr
, volatile void *addr
)
78 volatile unsigned int *a
= addr
;
82 mask
= 1 << (nr
& 0x1f);
83 local_irq_save(flags
);
84 retval
= (mask
& *a
) != 0;
86 local_irq_restore(flags
);
91 #endif /* __ASM_SH_BITOPS_IRQ_H */