[PATCH 3/4] x86_64 io_apic: Implment update_irq0_entry

From: Eric W. Biederman
Date: Mon Jan 08 2007 - 10:57:10 EST



To guess different irq routing strategies for irq 0 we
need the ability to update our data structures to reflect
our guess.

update_irq0_entry updates the mp routing table information
to reflect our current guess as to the routing of the timer
irq.

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
---
arch/x86_64/kernel/io_apic.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 5ad210f..1e68377 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -446,6 +446,37 @@ static int __init find_isa_irq_apic(int irq, int type)
return -1;
}

+static int update_irq0_entry(int apic, int pin)
+{
+ int irq = 0;
+ int idx;
+ int isa_bus;
+
+ /* Figure out the isa bus, by convention it is bus 0,
+ * but be prepared for someone being creative.
+ */
+ for (isa_bus = 0; isa_bus < MAX_MP_BUSSES; isa_bus++)
+ if (test_bit(isa_bus, mp_bus_not_pci))
+ break;
+ if (isa_bus >= MAX_MP_BUSSES)
+ isa_bus = 0;
+
+ idx = find_irq_entry(apic, pin, mp_INT);
+ if (idx == -1) {
+ idx = mp_irq_entries;
+ if (++mp_irq_entries >= MAX_IRQ_SOURCES)
+ panic("MAX # of irq sources exceeded!!!\n");
+ }
+ mp_irqs[idx].mpc_type = MP_INTSRC;
+ mp_irqs[idx].mpc_irqtype = mp_INT;
+ mp_irqs[idx].mpc_irqflag = 0; /* Use bus defaults */
+ mp_irqs[idx].mpc_srcbus = isa_bus;
+ mp_irqs[idx].mpc_srcbusirq = irq;
+ mp_irqs[idx].mpc_dstapic = mp_ioapics[apic].mpc_apicid;
+ mp_irqs[idx].mpc_dstirq = pin;
+ return idx;
+}
+
/*
* Find a specific PCI IRQ entry.
* Not an __init, possibly needed by modules
--
1.4.4.1.g278f

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/