diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2013-03-30 22:34:10 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2013-05-09 04:07:11 -0400 |
commit | 031d0112d780d4a8fe8b0bfba4ae446e4ddc5c66 (patch) | |
tree | c4a9827bf68746982e8c9824ca73122f4caf0959 /arch/xtensa | |
parent | c92931b200156e304350e3e9f138e6abfb1f2913 (diff) |
xtensa: fix arch_irqs_disabled_flags implementation
IRQs are disabled when PS.EXCM is set or PS.INTLEVEL is equal to or
higher than LOCKLEVEL.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/include/asm/irqflags.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/xtensa/include/asm/irqflags.h b/arch/xtensa/include/asm/irqflags.h index f865b1c1eae4..ea36674c6ec5 100644 --- a/arch/xtensa/include/asm/irqflags.h +++ b/arch/xtensa/include/asm/irqflags.h | |||
@@ -47,7 +47,10 @@ static inline void arch_local_irq_restore(unsigned long flags) | |||
47 | 47 | ||
48 | static inline bool arch_irqs_disabled_flags(unsigned long flags) | 48 | static inline bool arch_irqs_disabled_flags(unsigned long flags) |
49 | { | 49 | { |
50 | return (flags & 0xf) != 0; | 50 | #if XCHAL_EXCM_LEVEL < LOCKLEVEL || (1 << PS_EXCM_BIT) < LOCKLEVEL |
51 | #error "XCHAL_EXCM_LEVEL and 1<<PS_EXCM_BIT must be no less than LOCKLEVEL" | ||
52 | #endif | ||
53 | return (flags & (PS_INTLEVEL_MASK | (1 << PS_EXCM_BIT))) >= LOCKLEVEL; | ||
51 | } | 54 | } |
52 | 55 | ||
53 | static inline bool arch_irqs_disabled(void) | 56 | static inline bool arch_irqs_disabled(void) |