Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / h8300 / include / asm / irqflags.h
blob9617cd57aebdcf1d10ce724763aeba92a3493b92
1 #ifndef _H8300_IRQFLAGS_H
2 #define _H8300_IRQFLAGS_H
4 static inline unsigned long arch_local_save_flags(void)
6 unsigned long flags;
7 asm volatile ("stc ccr,%w0" : "=r" (flags));
8 return 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();
25 return flags;
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 */