diff options
Diffstat (limited to 'arch/sparc/include/asm/irqflags_32.h')
-rw-r--r-- | arch/sparc/include/asm/irqflags_32.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h index 0fca9d97d44f..d4d0711de0f9 100644 --- a/arch/sparc/include/asm/irqflags_32.h +++ b/arch/sparc/include/asm/irqflags_32.h | |||
@@ -5,33 +5,40 @@ | |||
5 | * | 5 | * |
6 | * This file gets included from lowlevel asm headers too, to provide | 6 | * This file gets included from lowlevel asm headers too, to provide |
7 | * wrapped versions of the local_irq_*() APIs, based on the | 7 | * wrapped versions of the local_irq_*() APIs, based on the |
8 | * raw_local_irq_*() functions from the lowlevel headers. | 8 | * arch_local_irq_*() functions from the lowlevel headers. |
9 | */ | 9 | */ |
10 | #ifndef _ASM_IRQFLAGS_H | 10 | #ifndef _ASM_IRQFLAGS_H |
11 | #define _ASM_IRQFLAGS_H | 11 | #define _ASM_IRQFLAGS_H |
12 | 12 | ||
13 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
14 | 14 | ||
15 | extern void raw_local_irq_restore(unsigned long); | 15 | #include <linux/types.h> |
16 | extern unsigned long __raw_local_irq_save(void); | ||
17 | extern void raw_local_irq_enable(void); | ||
18 | 16 | ||
19 | static inline unsigned long getipl(void) | 17 | extern void arch_local_irq_restore(unsigned long); |
18 | extern unsigned long arch_local_irq_save(void); | ||
19 | extern void arch_local_irq_enable(void); | ||
20 | |||
21 | static inline unsigned long arch_local_save_flags(void) | ||
20 | { | 22 | { |
21 | unsigned long retval; | 23 | unsigned long flags; |
24 | |||
25 | asm volatile("rd %%psr, %0" : "=r" (flags)); | ||
26 | return flags; | ||
27 | } | ||
22 | 28 | ||
23 | __asm__ __volatile__("rd %%psr, %0" : "=r" (retval)); | 29 | static inline void arch_local_irq_disable(void) |
24 | return retval; | 30 | { |
31 | arch_local_irq_save(); | ||
25 | } | 32 | } |
26 | 33 | ||
27 | #define raw_local_save_flags(flags) ((flags) = getipl()) | 34 | static inline bool arch_irqs_disabled_flags(unsigned long flags) |
28 | #define raw_local_irq_save(flags) ((flags) = __raw_local_irq_save()) | 35 | { |
29 | #define raw_local_irq_disable() ((void) __raw_local_irq_save()) | 36 | return (flags & PSR_PIL) != 0; |
30 | #define raw_irqs_disabled() ((getipl() & PSR_PIL) != 0) | 37 | } |
31 | 38 | ||
32 | static inline int raw_irqs_disabled_flags(unsigned long flags) | 39 | static inline bool arch_irqs_disabled(void) |
33 | { | 40 | { |
34 | return ((flags & PSR_PIL) != 0); | 41 | return arch_irqs_disabled_flags(arch_local_save_flags()); |
35 | } | 42 | } |
36 | 43 | ||
37 | #endif /* (__ASSEMBLY__) */ | 44 | #endif /* (__ASSEMBLY__) */ |