diff options
author | 2006-01-22 04:52:23 +0000 | |
---|---|---|
committer | 2006-01-22 04:52:23 +0000 | |
commit | 898c0ff1f3f423b9027986a29f527f7df48b0811 (patch) | |
tree | 44341a7c1353701653d6dd2ffc2a0de921cb1b09 | |
parent | b_cylin -> b_cylinder; no functional change. (diff) | |
download | wireguard-openbsd-898c0ff1f3f423b9027986a29f527f7df48b0811.tar.xz wireguard-openbsd-898c0ff1f3f423b9027986a29f527f7df48b0811.zip |
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.
-rw-r--r-- | sys/arch/amd64/amd64/intr.c | 12 |
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 { |