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