kvm tools, setup: Create private directory
[linux-2.6/next.git] / arch / s390 / include / asm / irqflags.h
blob865d6d891ace56f0b45d7d50aeca02f7daf46a23
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 void __arch_local_irq_ssm(unsigned long flags)
34 asm volatile("ssm %0" : : "Q" (flags) : "memory");
37 static inline unsigned long arch_local_save_flags(void)
39 return __arch_local_irq_stosm(0x00);
42 static inline unsigned long arch_local_irq_save(void)
44 return __arch_local_irq_stnsm(0xfc);
47 static inline void arch_local_irq_disable(void)
49 arch_local_irq_save();
52 static inline void arch_local_irq_enable(void)
54 __arch_local_irq_stosm(0x03);
57 static inline void arch_local_irq_restore(unsigned long flags)
59 __arch_local_irq_ssm(flags);
62 static inline bool arch_irqs_disabled_flags(unsigned long flags)
64 return !(flags & (3UL << (BITS_PER_LONG - 8)));
67 static inline bool arch_irqs_disabled(void)
69 return arch_irqs_disabled_flags(arch_local_save_flags());
72 #endif /* __ASM_IRQFLAGS_H */