[PATCH v10 03/17] powerpc/64: Improve inline asm in arch_local_irq_disable
Madhavan Srinivasan
maddy at linux.vnet.ibm.com
Wed Dec 20 14:55:43 AEDT 2017
From: Nicholas Piggin <npiggin at gmail.com>
arch_local_irq_disable is implemented strangely, with a temporary
output register being set to the desired soft_enabled value via an
immediate input, which is then used to store to memory. This is not
required, the immediate can be specified directly as a register input.
For simple cases at least, assembly is unchanged except register
mapping.
Reviewed-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
Signed-off-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 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 463b595ca971..d1e76298e393 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -63,13 +63,13 @@ static inline unsigned long arch_local_save_flags(void)
static inline unsigned long arch_local_irq_disable(void)
{
- unsigned long flags, zero;
+ unsigned long flags;
asm volatile(
- "li %1,%3; lbz %0,%2(13); stb %1,%2(13)"
- : "=r" (flags), "=&r" (zero)
- : "i" (offsetof(struct paca_struct, soft_enabled)),\
- "i" (IRQ_DISABLED)
+ "lbz %0,%1(13); stb %2,%1(13)"
+ : "=&r" (flags)
+ : "i" (offsetof(struct paca_struct, soft_enabled)),
+ "r" (IRQ_DISABLED)
: "memory");
return flags;
--
2.7.4
More information about the Linuxppc-dev
mailing list