summaryrefslogtreecommitdiffstats
path: root/kernel/irq/handle.c
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@sifive.com>2018-03-07 18:57:27 -0500
committerThomas Gleixner <tglx@linutronix.de>2018-03-14 16:46:29 -0400
commitcaacdbf4aa567ab5e8de1a4070195c5d3e8f1340 (patch)
tree00581368a1141b284bd779da0b779c33984a5542 /kernel/irq/handle.c
parentb0d8bef8ed805ca92eb91e86acf3ce89cbebc8ce (diff)
genirq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
The arm multi irq handler registration mechanism has been copied into a handful of architectures, including arm64 and openrisc. RISC-V needs the same mechanism. Instead of adding yet another copy for RISC-V copy the arm implementation into the core code depending on a new Kconfig symbol: CONFIG_GENERIC_MULTI_IRQ_HANDLER. Subsequent patches will convert the various architectures. Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: jonas@southpole.se Cc: catalin.marinas@arm.com Cc: Will Deacon <will.deacon@arm.com> Cc: linux@armlinux.org.uk Cc: stefan.kristiansson@saunalahti.fi Cc: openrisc@lists.librecores.org Cc: shorne@gmail.com Cc: linux-riscv@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lkml.kernel.org/r/20180307235731.22627-2-palmer@sifive.com
Diffstat (limited to 'kernel/irq/handle.c')
-rw-r--r--kernel/irq/handle.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 79f987b942b8..3570c715c3e7 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -20,6 +20,10 @@
20 20
21#include "internals.h" 21#include "internals.h"
22 22
23#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
24void (*handle_arch_irq)(struct pt_regs *) __ro_after_init;
25#endif
26
23/** 27/**
24 * handle_bad_irq - handle spurious and unhandled irqs 28 * handle_bad_irq - handle spurious and unhandled irqs
25 * @desc: description of the interrupt 29 * @desc: description of the interrupt
@@ -207,3 +211,14 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)
207 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); 211 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
208 return ret; 212 return ret;
209} 213}
214
215#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
216int __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
217{
218 if (handle_arch_irq)
219 return -EBUSY;
220
221 handle_arch_irq = handle_irq;
222 return 0;
223}
224#endif