diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2018-11-29 19:57:21 -0800 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2018-12-10 10:14:30 +0800 |
commit | c641010452a7f651cf77dc0d0f252ef25f1badf0 (patch) | |
tree | 79377329cab2f77012b459c010af6a47af171951 /arch/x86 | |
parent | da4cfa6b442809fc99a6b75255a99eee51a4e13b (diff) |
x86: Wrap calls to 8259 with CONFIG_I8259_PIC
mask_irq(), unmask_irq() and specific_eoi() are provided by the
i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/interrupts.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index 297067df71..39f8deaed1 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -64,7 +64,8 @@ void irq_install_handler(int irq, interrupt_handler_t *handler, void *arg) irq_handlers[irq].arg = arg; irq_handlers[irq].count = 0; - unmask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + unmask_irq(irq); if (status) enable_interrupts(); @@ -83,7 +84,8 @@ void irq_free_handler(int irq) status = disable_interrupts(); - mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq); irq_handlers[irq].handler = NULL; irq_handlers[irq].arg = NULL; @@ -104,14 +106,16 @@ void do_irq(int hw_irq) } if (irq_handlers[irq].handler) { - mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq); irq_handlers[irq].handler(irq_handlers[irq].arg); irq_handlers[irq].count++; - unmask_irq(irq); - specific_eoi(irq); - + if (CONFIG_IS_ENABLED(I8259_PIC)) { + unmask_irq(irq); + specific_eoi(irq); + } } else { if ((irq & 7) != 7) { spurious_irq_cnt++; |