of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / h8300 / include / asm / irqflags.h
blob5e1e3242e47035c948cdfe89e99c57a423e659bf
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)
9 h8300flags flags;
11 __asm__ volatile ("stc ccr,%w0" : "=r" (flags));
12 return 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)
27 h8300flags flags;
29 __asm__ volatile ("stc ccr,%w0\n\t"
30 "orc #0xc0,ccr" : "=r" (flags));
31 return 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;
43 #endif
44 #ifdef CONFIG_CPU_H8S
45 typedef unsigned short h8300flags;
47 static inline h8300flags arch_local_save_flags(void)
49 h8300flags flags;
51 __asm__ volatile ("stc ccr,%w0\n\tstc exr,%x0" : "=r" (flags));
52 return 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)
68 h8300flags flags;
70 __asm__ volatile ("stc ccr,%w0\n\t"
71 "stc exr,%x0\n\t"
72 "orc #0x80,ccr\n\t"
73 : "=r" (flags));
74 return flags;
77 static inline void arch_local_irq_restore(h8300flags flags)
79 __asm__ volatile ("ldc %w0,ccr\n\t"
80 "ldc %x0,exr"
81 : : "r" (flags) : "cc");
84 static inline int arch_irqs_disabled_flags(h8300flags flags)
86 return (flags & 0x0080) == 0x0080;
89 #endif
91 static inline int arch_irqs_disabled(void)
93 return arch_irqs_disabled_flags(arch_local_save_flags());
96 #endif /* _H8300_IRQFLAGS_H */