ARM: 8390/1: irqflags: Get arch_irqs_disabled from asm-generic

Commit cb1293e2f5 ("ARM: 8375/1: disable some options on ARMv7-M")
causes the build to on ARMv7-M machines:

  CC      arch/arm/kernel/asm-offsets.s
In file included from include/linux/sem.h:5:0,
                 from include/linux/sched.h:35,
                 from arch/arm/kernel/asm-offsets.c:14:
include/linux/rcupdate.h: In function 'rcu_read_lock_sched_held':
include/linux/rcupdate.h:539:2: error: implicit declaration of function
'arch_irqs_disabled' [-Werror=implicit-function-declaration]
  return preempt_count() != 0 || irqs_disabled();

asm-generic/irqflags.h provides an implementation of arch_irqs_disabled().
Lets grab an implementation from there!

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Daniel Thompson 2015-06-10 12:25:15 +01:00 committed by Russell King
parent 90543ec829
commit 6fb18ac936
1 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#if __LINUX_ARM_ARCH__ >= 6 #if __LINUX_ARM_ARCH__ >= 6
#define arch_local_irq_save arch_local_irq_save
static inline unsigned long arch_local_irq_save(void) static inline unsigned long arch_local_irq_save(void)
{ {
unsigned long flags; unsigned long flags;
@ -31,6 +32,7 @@ static inline unsigned long arch_local_irq_save(void)
return flags; return flags;
} }
#define arch_local_irq_enable arch_local_irq_enable
static inline void arch_local_irq_enable(void) static inline void arch_local_irq_enable(void)
{ {
asm volatile( asm volatile(
@ -40,6 +42,7 @@ static inline void arch_local_irq_enable(void)
: "memory", "cc"); : "memory", "cc");
} }
#define arch_local_irq_disable arch_local_irq_disable
static inline void arch_local_irq_disable(void) static inline void arch_local_irq_disable(void)
{ {
asm volatile( asm volatile(
@ -56,6 +59,7 @@ static inline void arch_local_irq_disable(void)
/* /*
* Save the current interrupt enable state & disable IRQs * Save the current interrupt enable state & disable IRQs
*/ */
#define arch_local_irq_save arch_local_irq_save
static inline unsigned long arch_local_irq_save(void) static inline unsigned long arch_local_irq_save(void)
{ {
unsigned long flags, temp; unsigned long flags, temp;
@ -73,6 +77,7 @@ static inline unsigned long arch_local_irq_save(void)
/* /*
* Enable IRQs * Enable IRQs
*/ */
#define arch_local_irq_enable arch_local_irq_enable
static inline void arch_local_irq_enable(void) static inline void arch_local_irq_enable(void)
{ {
unsigned long temp; unsigned long temp;
@ -88,6 +93,7 @@ static inline void arch_local_irq_enable(void)
/* /*
* Disable IRQs * Disable IRQs
*/ */
#define arch_local_irq_disable arch_local_irq_disable
static inline void arch_local_irq_disable(void) static inline void arch_local_irq_disable(void)
{ {
unsigned long temp; unsigned long temp;
@ -135,6 +141,7 @@ static inline void arch_local_irq_disable(void)
/* /*
* Save the current interrupt enable state. * Save the current interrupt enable state.
*/ */
#define arch_local_save_flags arch_local_save_flags
static inline unsigned long arch_local_save_flags(void) static inline unsigned long arch_local_save_flags(void)
{ {
unsigned long flags; unsigned long flags;
@ -147,6 +154,7 @@ static inline unsigned long arch_local_save_flags(void)
/* /*
* restore saved IRQ & FIQ state * restore saved IRQ & FIQ state
*/ */
#define arch_local_irq_restore arch_local_irq_restore
static inline void arch_local_irq_restore(unsigned long flags) static inline void arch_local_irq_restore(unsigned long flags)
{ {
asm volatile( asm volatile(
@ -156,10 +164,13 @@ static inline void arch_local_irq_restore(unsigned long flags)
: "memory", "cc"); : "memory", "cc");
} }
#define arch_irqs_disabled_flags arch_irqs_disabled_flags
static inline int arch_irqs_disabled_flags(unsigned long flags) static inline int arch_irqs_disabled_flags(unsigned long flags)
{ {
return flags & IRQMASK_I_BIT; return flags & IRQMASK_I_BIT;
} }
#include <asm-generic/irqflags.h>
#endif /* ifdef __KERNEL__ */ #endif /* ifdef __KERNEL__ */
#endif /* ifndef __ASM_ARM_IRQFLAGS_H */ #endif /* ifndef __ASM_ARM_IRQFLAGS_H */