1 #ifndef _H8300_IRQFLAGS_H
2 #define _H8300_IRQFLAGS_H
4 static inline unsigned long arch_local_save_flags(void)
7 asm volatile ("stc ccr,%w0" : "=r" (flags
));
11 static inline void arch_local_irq_disable(void)
13 asm volatile ("orc #0x80,ccr" : : : "memory");
16 static inline void arch_local_irq_enable(void)
18 asm volatile ("andc #0x7f,ccr" : : : "memory");
21 static inline unsigned long arch_local_irq_save(void)
23 unsigned long flags
= arch_local_save_flags();
24 arch_local_irq_disable();
28 static inline void arch_local_irq_restore(unsigned long flags
)
30 asm volatile ("ldc %w0,ccr" : : "r" (flags
) : "memory");
33 static inline bool arch_irqs_disabled_flags(unsigned long flags
)
35 return (flags
& 0x80) == 0x80;
38 static inline bool arch_irqs_disabled(void)
40 return arch_irqs_disabled_flags(arch_local_save_flags());
43 #endif /* _H8300_IRQFLAGS_H */