Paul Mundt | afbfb52 | 2006-12-04 18:17:28 +0900 | [diff] [blame] | 1 | #ifndef __ASM_SH_IRQFLAGS_H |
| 2 | #define __ASM_SH_IRQFLAGS_H |
| 3 | |
Paul Mundt | f64ee87 | 2007-11-09 13:34:36 +0900 | [diff] [blame^] | 4 | #ifdef CONFIG_SUPERH32 |
| 5 | #include "irqflags_32.h" |
| 6 | #else |
| 7 | #include "irqflags_64.h" |
Paul Mundt | afbfb52 | 2006-12-04 18:17:28 +0900 | [diff] [blame] | 8 | #endif |
Paul Mundt | afbfb52 | 2006-12-04 18:17:28 +0900 | [diff] [blame] | 9 | |
| 10 | #define raw_local_save_flags(flags) \ |
| 11 | do { (flags) = __raw_local_save_flags(); } while (0) |
| 12 | |
| 13 | static inline int raw_irqs_disabled_flags(unsigned long flags) |
| 14 | { |
| 15 | return (flags != 0); |
| 16 | } |
| 17 | |
| 18 | static inline int raw_irqs_disabled(void) |
| 19 | { |
| 20 | unsigned long flags = __raw_local_save_flags(); |
| 21 | |
| 22 | return raw_irqs_disabled_flags(flags); |
| 23 | } |
| 24 | |
Paul Mundt | afbfb52 | 2006-12-04 18:17:28 +0900 | [diff] [blame] | 25 | #define raw_local_irq_save(flags) \ |
| 26 | do { (flags) = __raw_local_irq_save(); } while (0) |
| 27 | |
| 28 | static inline void raw_local_irq_restore(unsigned long flags) |
| 29 | { |
| 30 | if ((flags & 0xf0) != 0xf0) |
| 31 | raw_local_irq_enable(); |
| 32 | } |
| 33 | |
| 34 | #endif /* __ASM_SH_IRQFLAGS_H */ |