[PATCH v10 04/14] powerpc: implement arch_local_* using the soft_enabled_* wrappers.
Madhavan Srinivasan
maddy at linux.vnet.ibm.com
Mon Aug 21 03:58:21 AEST 2017
Reviewed-by: Nicholas Piggin <npiggin at gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
---
arch/powerpc/include/asm/hw_irq.h | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 3efb0b2ec053..f6064634d278 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -59,21 +59,7 @@ static inline notrace void soft_enabled_set(unsigned long enable)
: "memory");
}
-static inline notrace unsigned long soft_enabled_set_return(unsigned long enable)
-{
- unsigned long flags, zero;
-
- asm volatile(
- "mr %1,%3; lbz %0,%2(13); stb %1,%2(13)"
- : "=r" (flags), "=&r" (zero)
- : "i" (offsetof(struct paca_struct, soft_enabled)),\
- "r" (enable)
- : "memory");
-
- return flags;
-}
-
-static inline unsigned long arch_local_save_flags(void)
+static inline notrace unsigned long soft_enabled_return(void)
{
unsigned long flags;
@@ -85,20 +71,30 @@ static inline unsigned long arch_local_save_flags(void)
return flags;
}
-static inline unsigned long arch_local_irq_disable(void)
+static inline notrace unsigned long soft_enabled_set_return(unsigned long enable)
{
unsigned long flags, zero;
asm volatile(
- "li %1,%3; lbz %0,%2(13); stb %1,%2(13)"
+ "mr %1,%3; lbz %0,%2(13); stb %1,%2(13)"
: "=r" (flags), "=&r" (zero)
: "i" (offsetof(struct paca_struct, soft_enabled)),\
- "i" (IRQ_DISABLED)
+ "r" (enable)
: "memory");
return flags;
}
+static inline unsigned long arch_local_save_flags(void)
+{
+ return soft_enabled_return();
+}
+
+static inline unsigned long arch_local_irq_disable(void)
+{
+ return soft_enabled_set_return(IRQ_DISABLED);
+}
+
extern void arch_local_irq_restore(unsigned long);
static inline void arch_local_irq_enable(void)
--
2.7.4
More information about the Linuxppc-dev
mailing list