summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/hw_irq.h
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>2017-12-20 09:25:47 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-19 22:36:59 +1100
commita67c543aacb247a74e9d48fd9fde6d8369cea10b (patch)
treecbd5aaa0986a4372c725c943f5ddc449883d59f0 /arch/powerpc/include/asm/hw_irq.h
parente0b5687bed13ddbf99985d77910b9adfd429bf12 (diff)
powerpc/64: Implement and use soft_enabled_set_return API
Add a new wrapper function, soft_enabled_set_return(), added to do the paca->soft_enabled updates requiring a set-return. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/hw_irq.h')
-rw-r--r--arch/powerpc/include/asm/hw_irq.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index f9791884af08..c1764fabf181 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -76,6 +76,20 @@ 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;
+
+ asm volatile(
+ "lbz %0,%1(13); stb %2,%1(13)"
+ : "=&r" (flags)
+ : "i" (offsetof(struct paca_struct, soft_enabled)),
+ "r" (enable)
+ : "memory");
+
+ return flags;
+}
+
static inline unsigned long arch_local_save_flags(void)
{
return soft_enabled_return();
@@ -95,16 +109,7 @@ static inline void arch_local_irq_enable(void)
static inline unsigned long arch_local_irq_save(void)
{
- unsigned long flags;
-
- asm volatile(
- "lbz %0,%1(13); stb %2,%1(13)"
- : "=&r" (flags)
- : "i" (offsetof(struct paca_struct, soft_enabled)),
- "r" (IRQS_DISABLED)
- : "memory");
-
- return flags;
+ return soft_enabled_set_return(IRQS_DISABLED);
}
static inline bool arch_irqs_disabled_flags(unsigned long flags)