aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/interrupt.h
diff options
context:
space:
mode:
authorNicholas Piggin <[email protected]>2021-01-30 23:08:39 +1000
committerMichael Ellerman <[email protected]>2021-02-09 00:02:12 +1100
commite6f8a6c86ce7b2108c03c1cc014fdae278573df1 (patch)
tree919bb1ecde29bc1dadd7bf8578f81242e20cb8dc /arch/powerpc/include/asm/interrupt.h
parent3a96570ffceb15c6ed9cc6f990f172dcdc8ac279 (diff)
powerpc: add interrupt_cond_local_irq_enable helper
Simple helper for synchronous interrupt handlers (i.e., process-context) to enable interrupts if it was taken in an interrupts-enabled context. Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/powerpc/include/asm/interrupt.h')
-rw-r--r--arch/powerpc/include/asm/interrupt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 4ffbd3d75324..488bdd5bd922 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -3,6 +3,7 @@
#define _ASM_POWERPC_INTERRUPT_H
#include <linux/context_tracking.h>
+#include <linux/hardirq.h>
#include <asm/ftrace.h>
struct interrupt_state {
@@ -298,4 +299,10 @@ DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException);
void replay_system_reset(void);
void replay_soft_interrupts(void);
+static inline void interrupt_cond_local_irq_enable(struct pt_regs *regs)
+{
+ if (!arch_irq_disabled_regs(regs))
+ local_irq_enable();
+}
+
#endif /* _ASM_POWERPC_INTERRUPT_H */