]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/cris/include/arch-v10/arch/irqflags.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / cris / include / arch-v10 / arch / irqflags.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_CRIS_ARCH_IRQFLAGS_H
3 #define __ASM_CRIS_ARCH_IRQFLAGS_H
4
5 #include <linux/types.h>
6
7 static inline unsigned long arch_local_save_flags(void)
8 {
9 unsigned long flags;
10 asm volatile("move $ccr,%0" : "=rm" (flags) : : "memory");
11 return flags;
12 }
13
14 static inline void arch_local_irq_disable(void)
15 {
16 asm volatile("di" : : : "memory");
17 }
18
19 static inline void arch_local_irq_enable(void)
20 {
21 asm volatile("ei" : : : "memory");
22 }
23
24 static inline unsigned long arch_local_irq_save(void)
25 {
26 unsigned long flags = arch_local_save_flags();
27 arch_local_irq_disable();
28 return flags;
29 }
30
31 static inline void arch_local_irq_restore(unsigned long flags)
32 {
33 asm volatile("move %0,$ccr" : : "rm" (flags) : "memory");
34 }
35
36 static inline bool arch_irqs_disabled_flags(unsigned long flags)
37 {
38 return !(flags & (1 << 5));
39 }
40
41 static inline bool arch_irqs_disabled(void)
42 {
43 return arch_irqs_disabled_flags(arch_local_save_flags());
44 }
45
46 #endif /* __ASM_CRIS_ARCH_IRQFLAGS_H */