Blame view
include/asm-generic/irqflags.h
1.51 KB
b24413180
|
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
aafe4dbed
|
2 3 4 5 6 7 8 |
#ifndef __ASM_GENERIC_IRQFLAGS_H #define __ASM_GENERIC_IRQFLAGS_H /* * All architectures should implement at least the first two functions, * usually inline assembly will be the best way. */ |
df9ee2927
|
9 10 11 |
#ifndef ARCH_IRQ_DISABLED #define ARCH_IRQ_DISABLED 0 #define ARCH_IRQ_ENABLED 1 |
aafe4dbed
|
12 13 14 |
#endif /* read interrupt enabled status */ |
df9ee2927
|
15 16 |
#ifndef arch_local_save_flags unsigned long arch_local_save_flags(void); |
aafe4dbed
|
17 18 19 |
#endif /* set interrupt enabled status */ |
df9ee2927
|
20 21 |
#ifndef arch_local_irq_restore void arch_local_irq_restore(unsigned long flags); |
aafe4dbed
|
22 23 24 |
#endif /* get status and disable interrupts */ |
df9ee2927
|
25 26 |
#ifndef arch_local_irq_save static inline unsigned long arch_local_irq_save(void) |
aafe4dbed
|
27 28 |
{ unsigned long flags; |
df9ee2927
|
29 30 |
flags = arch_local_save_flags(); arch_local_irq_restore(ARCH_IRQ_DISABLED); |
aafe4dbed
|
31 32 33 34 35 |
return flags; } #endif /* test flags */ |
df9ee2927
|
36 37 |
#ifndef arch_irqs_disabled_flags static inline int arch_irqs_disabled_flags(unsigned long flags) |
aafe4dbed
|
38 |
{ |
df9ee2927
|
39 |
return flags == ARCH_IRQ_DISABLED; |
aafe4dbed
|
40 41 42 43 |
} #endif /* unconditionally enable interrupts */ |
df9ee2927
|
44 45 |
#ifndef arch_local_irq_enable static inline void arch_local_irq_enable(void) |
aafe4dbed
|
46 |
{ |
df9ee2927
|
47 |
arch_local_irq_restore(ARCH_IRQ_ENABLED); |
aafe4dbed
|
48 49 50 51 |
} #endif /* unconditionally disable interrupts */ |
df9ee2927
|
52 53 |
#ifndef arch_local_irq_disable static inline void arch_local_irq_disable(void) |
aafe4dbed
|
54 |
{ |
df9ee2927
|
55 |
arch_local_irq_restore(ARCH_IRQ_DISABLED); |
aafe4dbed
|
56 57 58 59 |
} #endif /* test hardware interrupt enable bit */ |
df9ee2927
|
60 61 |
#ifndef arch_irqs_disabled static inline int arch_irqs_disabled(void) |
aafe4dbed
|
62 |
{ |
df9ee2927
|
63 |
return arch_irqs_disabled_flags(arch_local_save_flags()); |
aafe4dbed
|
64 65 |
} #endif |
aafe4dbed
|
66 |
#endif /* __ASM_GENERIC_IRQFLAGS_H */ |