]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
powerpc/64: Improve inline asm in arch_local_irq_disable
authorNicholas Piggin <npiggin@gmail.com>
Wed, 20 Dec 2017 03:55:43 +0000 (09:25 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 19 Jan 2018 11:36:57 +0000 (22:36 +1100)
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@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/hw_irq.h

index 7c2717dfd89adfa9f2539db9687246eac4ffedd4..4210ddbf38b0814277ccd8ec3cc931757e953c7a 100644 (file)
@@ -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" (IRQS_DISABLED)
+               "lbz %0,%1(13); stb %2,%1(13)"
+               : "=&r" (flags)
+               : "i" (offsetof(struct paca_struct, soft_enabled)),
+                 "r" (IRQS_DISABLED)
                : "memory");
 
        return flags;