diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-03-14 20:26:21 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-03-14 20:26:21 +0000 |
commit | 67d6dde740ff2853f335523eff531319a44ab2d0 (patch) | |
tree | c8e47bbc8c14b06d1b1964169320dacdb434e3be /sys/arch | |
parent | 8e1c4e9c3e800e695c46177e1e6802467e422c9f (diff) |
Make the sbus ipl handling more like psycho. Some devices (Aurora 210sj, eg)
use Sbus level 5 for interrupts which means spltty() is not blocked correctly
because the sbus interrupt handling uses the implied spl of the interrupt
instead of the level passed to it.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/sbus.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index b5da982b638..dc753d1a770 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.13 2002/03/14 03:16:00 millert Exp $ */ +/* $OpenBSD: sbus.c,v 1.14 2002/03/14 20:26:20 jason Exp $ */ /* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */ /*- @@ -715,12 +715,18 @@ sbus_intr_establish(t, pri, level, flags, handler, arg) return (NULL); if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) != 0) - ipl = vec; + ipl = 1 << vec; else if ((vec & SBUS_INTR_COMPAT) != 0) - ipl = vec & ~SBUS_INTR_COMPAT; + ipl = 1 << (vec & ~SBUS_INTR_COMPAT); else { /* Decode and remove IPL */ - ipl = INTLEV(vec); + ipl = level; + if (ipl == IPL_NONE) + ipl = 1 << INTLEV(vec); + if (ipl == IPL_NONE) { + printf("ERROR: no IPL, setting IPL 2.\n"); + ipl = 2; + } vec = INTVEC(vec); DPRINTF(SDB_INTR, ("\nsbus: intr[%ld]%lx: %lx\nHunting for IRQ...\n", @@ -784,8 +790,8 @@ sbus_intr_establish(t, pri, level, flags, handler, arg) ih->ih_fun = handler; ih->ih_arg = arg; ih->ih_number = vec; - ih->ih_pil = (1<<ipl); - intr_establish(ipl, ih); + ih->ih_pil = ipl; + intr_establish(ih->ih_pil, ih); return (ih); } |