diff options
Diffstat (limited to 'i386/i386at/ioapic.c')
-rw-r--r-- | i386/i386at/ioapic.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/i386/i386at/ioapic.c b/i386/i386at/ioapic.c index d0724f76..e38e4d6b 100644 --- a/i386/i386at/ioapic.c +++ b/i386/i386at/ioapic.c @@ -128,6 +128,8 @@ interrupt_handler_fn ivect[NINTR] = { /* 63 */ intnull, }; +struct irqinfo irqinfo[NINTR]; + void picdisable(void) { @@ -293,6 +295,7 @@ ioapic_toggle(int pin, int mask) void ioapic_irq_eoi(int pin) { + /* FIXME: multiple ioapics (not always zero) */ int apic = 0; union ioapic_route_entry_union oldentry, entry; @@ -302,6 +305,7 @@ ioapic_irq_eoi(int pin) spl_t s = simple_lock_irq(&ioapic_lock); if (!has_irq_specific_eoi) { + // XXX Linux conditions on trigger mode: if (irqinfo[pin].trigger) { /* Workaround for old IOAPICs with no specific EOI */ /* Mask the pin and change to edge triggered */ @@ -313,11 +317,10 @@ ioapic_irq_eoi(int pin) /* Restore level entry */ ioapic_write_entry(apic, pin, oldentry.both); + //} } else { volatile ApicIoUnit *ioapic = apic_get_ioapic(apic)->ioapic; - - ioapic_read_entry(apic, pin, &entry.both); - ioapic->eoi.r = entry.both.vector; + ioapic->eoi.r = irqinfo[pin].vector; } simple_unlock_irq(s, &ioapic_lock); @@ -407,6 +410,9 @@ ioapic_configure(void) entry.both.vector = IOAPIC_INT_BASE + gsi; ioapic_write_entry(apic, pin, entry.both); + irqinfo[pin].vector = entry.both.vector; + irqinfo[pin].trigger = entry.both.trigger; + /* Set initial state to masked */ mask_irq(pin); @@ -441,6 +447,9 @@ ioapic_configure(void) entry.both.vector = IOAPIC_INT_BASE + gsi; ioapic_write_entry(apic, pin, entry.both); + irqinfo[pin].vector = entry.both.vector; + irqinfo[pin].trigger = entry.both.trigger; + /* Set initial state to masked */ mask_irq(pin); } @@ -465,6 +474,9 @@ ioapic_configure(void) entry.both.vector = IOAPIC_INT_BASE + gsi; ioapic_write_entry(apic, pin, entry.both); + irqinfo[pin + ngsis].vector = entry.both.vector; + irqinfo[pin + ngsis].trigger = entry.both.trigger; + /* Set initial state to masked */ mask_irq(pin + ngsis); } |