Commit c641010452a7f651cf77dc0d0f252ef25f1badf0
1 parent
da4cfa6b44
Exists in
smarc_8mq_lf_v2020.04
and in
12 other branches
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>
Showing 1 changed file with 10 additions and 6 deletions Side-by-side Diff
arch/x86/lib/interrupts.c
... | ... | @@ -64,7 +64,8 @@ |
64 | 64 | irq_handlers[irq].arg = arg; |
65 | 65 | irq_handlers[irq].count = 0; |
66 | 66 | |
67 | - unmask_irq(irq); | |
67 | + if (CONFIG_IS_ENABLED(I8259_PIC)) | |
68 | + unmask_irq(irq); | |
68 | 69 | |
69 | 70 | if (status) |
70 | 71 | enable_interrupts(); |
... | ... | @@ -83,7 +84,8 @@ |
83 | 84 | |
84 | 85 | status = disable_interrupts(); |
85 | 86 | |
86 | - mask_irq(irq); | |
87 | + if (CONFIG_IS_ENABLED(I8259_PIC)) | |
88 | + mask_irq(irq); | |
87 | 89 | |
88 | 90 | irq_handlers[irq].handler = NULL; |
89 | 91 | irq_handlers[irq].arg = NULL; |
90 | 92 | |
... | ... | @@ -104,14 +106,16 @@ |
104 | 106 | } |
105 | 107 | |
106 | 108 | if (irq_handlers[irq].handler) { |
107 | - mask_irq(irq); | |
109 | + if (CONFIG_IS_ENABLED(I8259_PIC)) | |
110 | + mask_irq(irq); | |
108 | 111 | |
109 | 112 | irq_handlers[irq].handler(irq_handlers[irq].arg); |
110 | 113 | irq_handlers[irq].count++; |
111 | 114 | |
112 | - unmask_irq(irq); | |
113 | - specific_eoi(irq); | |
114 | - | |
115 | + if (CONFIG_IS_ENABLED(I8259_PIC)) { | |
116 | + unmask_irq(irq); | |
117 | + specific_eoi(irq); | |
118 | + } | |
115 | 119 | } else { |
116 | 120 | if ((irq & 7) != 7) { |
117 | 121 | spurious_irq_cnt++; |