summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-07-29 21:25:24 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-07-29 21:25:24 +0000
commitb5f15637df8af4597daf3c54f56a05b91d80faac (patch)
tree9b9fba1bfe31a78d5748560b8a7856fa9969533d /sys/arch
parent5a840d9082f622411b7281cb37bc49d805866f6e (diff)
slot range check in add_nubus_intr() is wrong by one.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mac68k/mac68k/via.c13
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();