Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / s390 / include / asm / irqflags.h
blob38fdf451febb475cae7ce93229596d78b75a01f1
1 /*
2 * Copyright IBM Corp. 2006,2010
3 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
4 */
6 #ifndef __ASM_IRQFLAGS_H
7 #define __ASM_IRQFLAGS_H
9 #include <linux/types.h>
11 /* store then OR system mask. */
12 #define __arch_local_irq_stosm(__or) \
13 ({ \
14 unsigned long __mask; \
15 asm volatile( \
16 " stosm %0,%1" \
17 : "=Q" (__mask) : "i" (__or) : "memory"); \
18 __mask; \
21 /* store then AND system mask. */
22 #define __arch_local_irq_stnsm(__and) \
23 ({ \
24 unsigned long __mask; \
25 asm volatile( \
26 " stnsm %0,%1" \
27 : "=Q" (__mask) : "i" (__and) : "memory"); \
28 __mask; \
31 /* set system mask. */
32 static inline notrace void __arch_local_irq_ssm(unsigned long flags)
34 asm volatile("ssm %0" : : "Q" (flags) : "memory");
37 static inline notrace unsigned long arch_local_save_flags(void)
39 return __arch_local_irq_stosm(0x00);
42 static inline notrace unsigned long arch_local_irq_save(void)
44 return __arch_local_irq_stnsm(0xfc);
47 static inline notrace void arch_local_irq_disable(void)
49 arch_local_irq_save();
52 static inline notrace void arch_local_irq_enable(void)
54 __arch_local_irq_stosm(0x03);
57 static inline notrace void arch_local_irq_restore(unsigned long flags)
59 __arch_local_irq_ssm(flags);
62 static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
64 return !(flags & (3UL << (BITS_PER_LONG - 8)));
67 static inline notrace bool arch_irqs_disabled(void)
69 return arch_irqs_disabled_flags(arch_local_save_flags());
72 #endif /* __ASM_IRQFLAGS_H */