summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-27 22:42:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-06-27 22:42:23 +0000
commitb370820787c50feefad6c3a1654ae937162f8540 (patch)
treec61dd8a7a8d266f4a13793bebf6db05145d74503 /sys/arch/i386
parent15f7b544383cd1be3b3b79b64d7444a9eb86d228 (diff)
make isa_intr_establish not panic, but return NULL for failure
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/isa/isa_machdep.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c
index fd641539bb1..d702b62e2ab 100644
--- a/sys/arch/i386/isa/isa_machdep.c
+++ b/sys/arch/i386/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.28 1998/02/22 21:35:30 niklas Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.29 1998/06/27 22:42:22 deraadt Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -464,12 +464,16 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
/* no point in sleeping unless someone can free memory. */
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
- if (ih == NULL)
- panic("isa_intr_establish: can't malloc handler info");
-
- if (!LEGAL_IRQ(irq) || type == IST_NONE)
- panic("intr_establish: bogus irq or type");
+ if (ih == NULL) {
+ printf("%s: isa_intr_establish: can't malloc handler info\n",
+ ih_what);
+ return NULL;
+ }
+ if (!LEGAL_IRQ(irq) || type == IST_NONE) {
+ printf("%s: intr_establish: bogus irq or type\n", ih_what);
+ return NULL;
+ }
switch (intrtype[irq]) {
case IST_NONE:
intrtype[irq] = type;
@@ -479,10 +483,12 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
if (type == intrtype[irq])
break;
case IST_PULSE:
- if (type != IST_NONE)
- panic("intr_establish: can't share %s with %s, irq %d",
- isa_intr_typename(intrtype[irq]),
- isa_intr_typename(type), irq);
+ if (type != IST_NONE) {
+ /*printf("%s: intr_establish: can't share %s with %s, irq %d\n",
+ ih_what, isa_intr_typename(intrtype[irq]),
+ isa_intr_typename(type), irq);*/
+ return NULL;
+ }
break;
}