diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-29 12:44:43 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-29 12:44:43 +0200 |
commit | 3c0c01ab742ddfaf6b6f2d64b890e77cda4b7727 (patch) | |
tree | d0f196c53d209f44190fd8a6481823b7770866e6 /arch/arm/include/asm/irqflags.h | |
parent | Merge branches 'fixes', 'mcpm', 'misc' and 'mmci' into for-next (diff) | |
parent | ARM: 7775/1: mm: Remove do_sect_fault from LPAE code (diff) | |
download | linux-3c0c01ab742ddfaf6b6f2d64b890e77cda4b7727.tar.xz linux-3c0c01ab742ddfaf6b6f2d64b890e77cda4b7727.zip |
Merge branch 'devel-stable' into for-next
Conflicts:
arch/arm/Makefile
arch/arm/include/asm/glue-proc.h
Diffstat (limited to 'arch/arm/include/asm/irqflags.h')
-rw-r--r-- | arch/arm/include/asm/irqflags.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/arm/include/asm/irqflags.h b/arch/arm/include/asm/irqflags.h index 1e6cca55c750..3b763d6652a0 100644 --- a/arch/arm/include/asm/irqflags.h +++ b/arch/arm/include/asm/irqflags.h @@ -8,6 +8,16 @@ /* * CPU interrupt mask handling. */ +#ifdef CONFIG_CPU_V7M +#define IRQMASK_REG_NAME_R "primask" +#define IRQMASK_REG_NAME_W "primask" +#define IRQMASK_I_BIT 1 +#else +#define IRQMASK_REG_NAME_R "cpsr" +#define IRQMASK_REG_NAME_W "cpsr_c" +#define IRQMASK_I_BIT PSR_I_BIT +#endif + #if __LINUX_ARM_ARCH__ >= 6 static inline unsigned long arch_local_irq_save(void) @@ -15,7 +25,7 @@ static inline unsigned long arch_local_irq_save(void) unsigned long flags; asm volatile( - " mrs %0, cpsr @ arch_local_irq_save\n" + " mrs %0, " IRQMASK_REG_NAME_R " @ arch_local_irq_save\n" " cpsid i" : "=r" (flags) : : "memory", "cc"); return flags; @@ -129,7 +139,7 @@ static inline unsigned long arch_local_save_flags(void) { unsigned long flags; asm volatile( - " mrs %0, cpsr @ local_save_flags" + " mrs %0, " IRQMASK_REG_NAME_R " @ local_save_flags" : "=r" (flags) : : "memory", "cc"); return flags; } @@ -140,7 +150,7 @@ static inline unsigned long arch_local_save_flags(void) static inline void arch_local_irq_restore(unsigned long flags) { asm volatile( - " msr cpsr_c, %0 @ local_irq_restore" + " msr " IRQMASK_REG_NAME_W ", %0 @ local_irq_restore" : : "r" (flags) : "memory", "cc"); @@ -148,8 +158,8 @@ static inline void arch_local_irq_restore(unsigned long flags) static inline int arch_irqs_disabled_flags(unsigned long flags) { - return flags & PSR_I_BIT; + return flags & IRQMASK_I_BIT; } -#endif -#endif +#endif /* ifdef __KERNEL__ */ +#endif /* ifndef __ASM_ARM_IRQFLAGS_H */ |