summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-05-01 20:53:37 +0000
committermav <mav@FreeBSD.org>2009-05-01 20:53:37 +0000
commit50b57c0fb59d547c4f1cd4c469029d22b9293a3d (patch)
tree903f5cddafeddc9c9aa9d3b08f7ceec1ff236179 /sys/i386
parente3d44e50bfc84fefdaf95052a5584a05e0014823 (diff)
downloadFreeBSD-src-50b57c0fb59d547c4f1cd4c469029d22b9293a3d.zip
FreeBSD-src-50b57c0fb59d547c4f1cd4c469029d22b9293a3d.tar.gz
Small addition to r191720.
Restore previous behaviour for the case of unknown interrupt. Invocation of IRQ -1 crashes my system on resume. Returning 0, as it was, is not perfect also, but at least not so dangerous.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/local_apic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/i386/local_apic.c b/sys/i386/i386/local_apic.c
index 571edc4..82e2c30 100644
--- a/sys/i386/i386/local_apic.c
+++ b/sys/i386/i386/local_apic.c
@@ -954,11 +954,15 @@ apic_free_vector(u_int apic_id, u_int vector, u_int irq)
u_int
apic_idt_to_irq(u_int apic_id, u_int vector)
{
+ int irq;
KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL &&
vector <= APIC_IO_INTS + APIC_NUM_IOINTS,
("Vector %u does not map to an IRQ line", vector));
- return (lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS]);
+ irq = lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS];
+ if (irq < 0)
+ irq = 0;
+ return (irq);
}
#ifdef DDB
OpenPOWER on IntegriCloud