hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/x86/kernel/irqinit.c
....@@ -16,12 +16,14 @@
1616 #include <linux/acpi.h>
1717 #include <linux/io.h>
1818 #include <linux/delay.h>
19
+#include <linux/pgtable.h>
1920
2021 #include <linux/atomic.h>
2122 #include <asm/timer.h>
2223 #include <asm/hw_irq.h>
23
-#include <asm/pgtable.h>
2424 #include <asm/desc.h>
25
+#include <asm/io_apic.h>
26
+#include <asm/acpi.h>
2527 #include <asm/apic.h>
2628 #include <asm/setup.h>
2729 #include <asm/i8259.h>
....@@ -43,15 +45,6 @@
4345 *
4446 * (these are usually mapped into the 0x30-0xff vector range)
4547 */
46
-
47
-/*
48
- * IRQ2 is cascade interrupt to second interrupt controller
49
- */
50
-static struct irqaction irq2 = {
51
- .handler = no_action,
52
- .name = "cascade",
53
- .flags = IRQF_NO_THREAD,
54
-};
5548
5649 DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
5750 [0 ... NR_VECTORS - 1] = VECTOR_UNUSED,
....@@ -84,12 +77,14 @@
8477 * On cpu 0, Assign ISA_IRQ_VECTOR(irq) to IRQ 0..15.
8578 * If these IRQ's are handled by legacy interrupt-controllers like PIC,
8679 * then this configuration will likely be static after the boot. If
87
- * these IRQ's are handled by more mordern controllers like IO-APIC,
80
+ * these IRQs are handled by more modern controllers like IO-APIC,
8881 * then this vector space can be freed and re-used dynamically as the
8982 * irq's migrate etc.
9083 */
9184 for (i = 0; i < nr_legacy_irqs(); i++)
9285 per_cpu(vector_irq, 0)[ISA_IRQ_VECTOR(i)] = irq_to_desc(i);
86
+
87
+ BUG_ON(irq_init_percpu_irqstack(smp_processor_id()));
9388
9489 x86_init.irqs.intr_init();
9590 }
....@@ -102,8 +97,9 @@
10297 idt_setup_apic_and_irq_gates();
10398 lapic_assign_system_vectors();
10499
105
- if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs())
106
- setup_irq(2, &irq2);
107
-
108
- irq_ctx_init(smp_processor_id());
100
+ if (!acpi_ioapic && !of_ioapic && nr_legacy_irqs()) {
101
+ /* IRQ2 is cascade interrupt to second interrupt controller */
102
+ if (request_irq(2, no_action, IRQF_NO_THREAD, "cascade", NULL))
103
+ pr_err("%s: request_irq() failed\n", "cascade");
104
+ }
109105 }