diff options
author | 2007-07-29 21:25:23 +0000 | |
---|---|---|
committer | 2007-07-29 21:25:23 +0000 | |
commit | 05d423e09ed946799e6c59aa599c50dbab902b3f (patch) | |
tree | 7e8a04599b1e726a1128668776d7bd89d3b0025f | |
parent | It turns out that VIA2 always interrupts at level 2, and IPL_BIO is always 2 (diff) | |
download | wireguard-openbsd-05d423e09ed946799e6c59aa599c50dbab902b3f.tar.xz wireguard-openbsd-05d423e09ed946799e6c59aa599c50dbab902b3f.zip |
slot range check in add_nubus_intr() is wrong by one.
-rw-r--r-- | sys/arch/mac68k/mac68k/via.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/mac68k/mac68k/via.c b/sys/arch/mac68k/mac68k/via.c index 5fc0c7b9c10..f0902bb0dc1 100644 --- a/sys/arch/mac68k/mac68k/via.c +++ b/sys/arch/mac68k/mac68k/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.29 2007/07/29 21:24:05 miod Exp $ */ +/* $OpenBSD: via.c,v 1.30 2007/07/29 21:25:23 miod Exp $ */ /* $NetBSD: via.c,v 1.62 1997/09/10 04:38:48 scottr Exp $ */ /*- @@ -295,7 +295,7 @@ rbv_intr(void *arg) return (1); } -static int nubus_intr_mask = 0; +int nubus_intr_mask = 0; void add_nubus_intr(int slot, int (*func)(void *), void *client_data, @@ -308,13 +308,14 @@ add_nubus_intr(int slot, int (*func)(void *), void *client_data, * Map Nubus slot 0 to "slot" 15; see note on Nubus slot * interrupt tables. */ - if (slot == 0) - slot = 15; - slot -= 9; #ifdef DIAGNOSTIC - if (slot < 0 || slot > 7) + if (slot != 0 && (slot < 9 || slot > 14)) panic("add_nubus_intr: wrong slot %d", slot + 9); #endif + if (slot == 0) + slot = 15 - 9; + else + slot -= 9; s = splhigh(); |