summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-01-22 04:52:24 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-01-22 04:52:24 +0000
commitae39834e967e79a1c98550cc90226342112cebf2 (patch)
tree76faabbea75bf1d27d179155ca7baebafb22b55e /sys/arch/amd64
parent22c9c3850c0937b005b1a8552095891e59df87c2 (diff)
Fix for ioapic irq routing.
From NetBSD, NetBSD PR 22728 for details ok beck@ krw@ tested by beck@ krw@ marc@ and a few others on a number of amd64 systems.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/intr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index 33007b95447..4d4be267d2d 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.11 2005/09/25 20:48:18 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.12 2006/01/22 04:52:23 brad Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
@@ -266,6 +266,14 @@ intr_allocate_slot(struct pic *pic, int legacy_irq, int pin, int level,
*/
if (legacy_irq != -1) {
ci = &cpu_info_primary;
+ /* must check for duplicate pic + pin first */
+ for (slot = 0 ; slot < MAX_INTR_SOURCES ; slot++) {
+ isp = ci->ci_isources[slot];
+ if (isp != NULL && isp->is_pic == pic &&
+ isp->is_pin == pin ) {
+ goto duplicate;
+ }
+ }
slot = legacy_irq;
isp = ci->ci_isources[slot];
if (isp == NULL) {
@@ -292,7 +300,7 @@ intr_allocate_slot(struct pic *pic, int legacy_irq, int pin, int level,
goto other;
}
}
-
+duplicate:
if (pic == &i8259_pic)
idtvec = ICU_OFFSET + legacy_irq;
else {