spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / arch / parisc / include / asm / irqflags.h
blob34f9cb9b4754841441cf6ee2c111df0b96c98fa8
1 #ifndef __PARISC_IRQFLAGS_H
2 #define __PARISC_IRQFLAGS_H
4 #include <linux/types.h>
5 #include <asm/psw.h>
7 static inline unsigned long arch_local_save_flags(void)
9 unsigned long flags;
10 asm volatile("ssm 0, %0" : "=r" (flags) : : "memory");
11 return flags;
14 static inline void arch_local_irq_disable(void)
16 asm volatile("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory");
19 static inline void arch_local_irq_enable(void)
21 asm volatile("ssm %0,%%r0\n" : : "i" (PSW_I) : "memory");
24 static inline unsigned long arch_local_irq_save(void)
26 unsigned long flags;
27 asm volatile("rsm %1,%0" : "=r" (flags) : "i" (PSW_I) : "memory");
28 return flags;
31 static inline void arch_local_irq_restore(unsigned long flags)
33 asm volatile("mtsm %0" : : "r" (flags) : "memory");
36 static inline bool arch_irqs_disabled_flags(unsigned long flags)
38 return (flags & PSW_I) == 0;
41 static inline bool arch_irqs_disabled(void)
43 return arch_irqs_disabled_flags(arch_local_save_flags());
46 #endif /* __PARISC_IRQFLAGS_H */