1 #ifndef _H8300_IRQFLAGS_H
2 #define _H8300_IRQFLAGS_H
4 #ifdef CONFIG_CPU_H8300H
5 typedef unsigned char h8300flags
;
7 static inline h8300flags
arch_local_save_flags(void)
11 __asm__
volatile ("stc ccr,%w0" : "=r" (flags
));
15 static inline void arch_local_irq_disable(void)
17 __asm__
volatile ("orc #0xc0,ccr");
20 static inline void arch_local_irq_enable(void)
22 __asm__
volatile ("andc #0x3f,ccr");
25 static inline h8300flags
arch_local_irq_save(void)
29 __asm__
volatile ("stc ccr,%w0\n\t"
30 "orc #0xc0,ccr" : "=r" (flags
));
34 static inline void arch_local_irq_restore(h8300flags flags
)
36 __asm__
volatile ("ldc %w0,ccr" : : "r" (flags
) : "cc");
39 static inline int arch_irqs_disabled_flags(unsigned long flags
)
41 return (flags
& 0xc0) == 0xc0;
45 typedef unsigned short h8300flags
;
47 static inline h8300flags
arch_local_save_flags(void)
51 __asm__
volatile ("stc ccr,%w0\n\tstc exr,%x0" : "=r" (flags
));
55 static inline void arch_local_irq_disable(void)
57 __asm__
volatile ("orc #0x80,ccr\n\t");
60 static inline void arch_local_irq_enable(void)
62 __asm__
volatile ("andc #0x7f,ccr\n\t"
63 "andc #0xf0,exr\n\t");
66 static inline h8300flags
arch_local_irq_save(void)
70 __asm__
volatile ("stc ccr,%w0\n\t"
77 static inline void arch_local_irq_restore(h8300flags flags
)
79 __asm__
volatile ("ldc %w0,ccr\n\t"
81 : : "r" (flags
) : "cc");
84 static inline int arch_irqs_disabled_flags(h8300flags flags
)
86 return (flags
& 0x0080) == 0x0080;
91 static inline int arch_irqs_disabled(void)
93 return arch_irqs_disabled_flags(arch_local_save_flags());
96 #endif /* _H8300_IRQFLAGS_H */