From 633fd1e1cc6f352242a0b3d2bdb748320c8067ab Mon Sep 17 00:00:00 2001 From: pk Date: Sun, 21 Nov 1999 15:23:01 +0000 Subject: [PATCH] Check presence of Sbus interrupt properties before using them. --- sys/arch/sparc/dev/am7930_sparc.c | 5 +++-- sys/arch/sparc/dev/com_obio.c | 10 ++++++---- sys/arch/sparc/dev/fd.c | 5 +++-- sys/arch/sparc/dev/tctrl.c | 9 ++++++--- sys/arch/sparc/dev/zs.c | 5 +++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/sys/arch/sparc/dev/am7930_sparc.c b/sys/arch/sparc/dev/am7930_sparc.c index 401b781999c0..2634b38249d2 100644 --- a/sys/arch/sparc/dev/am7930_sparc.c +++ b/sys/arch/sparc/dev/am7930_sparc.c @@ -1,4 +1,4 @@ -/* $NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp $ */ +/* $NetBSD: am7930_sparc.c,v 1.45 1999/11/21 15:23:01 pk Exp $ */ /* * Copyright (c) 1995 Rolf Grossmann @@ -215,7 +215,8 @@ am7930attach_sbus(parent, self, aux) return; } sc->sc_bh = bh; - am7930_sparc_attach(sc, sa->sa_pri); + if (sa->sa_nintr != 0) + am7930_sparc_attach(sc, sa->sa_pri); } void diff --git a/sys/arch/sparc/dev/com_obio.c b/sys/arch/sparc/dev/com_obio.c index b3181b2a40b4..c482c3f15f06 100644 --- a/sys/arch/sparc/dev/com_obio.c +++ b/sys/arch/sparc/dev/com_obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_obio.c,v 1.3 1999/11/12 05:20:03 matt Exp $ */ +/* $NetBSD: com_obio.c,v 1.4 1999/11/21 15:23:01 pk Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -185,9 +185,11 @@ com_obio_attach(parent, self, aux) sc->sc_frequency = COM_FREQ; com_attach_subr(sc); - (void)bus_intr_establish(sc->sc_iot, sa->sa_pri, 0, comintr, sc); - - evcnt_attach(&osc->osc_com.sc_dev, "intr", &osc->osc_intrcnt); + if (sa->sa_nintr != 0) { + (void)bus_intr_establish(sc->sc_iot, sa->sa_pri, + 0, comintr, sc); + evcnt_attach(&osc->osc_com.sc_dev, "intr", &osc->osc_intrcnt); + } /* * Shutdown hook for buggy BIOSs that don't recognize the UART diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index b695f8738dda..15a4dc7da366 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.67 1999/03/24 05:51:10 mrg Exp $ */ +/* $NetBSD: fd.c,v 1.68 1999/11/21 15:23:01 pk Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. @@ -484,7 +484,8 @@ fdcattach_obio(parent, self, aux) bp = sa->sa_bp; } - fdcattach(fdc, sa->sa_pri, bp); + if (sa->sa_nintr != 0) + fdcattach(fdc, sa->sa_pri, bp); } void diff --git a/sys/arch/sparc/dev/tctrl.c b/sys/arch/sparc/dev/tctrl.c index 1d5560e570d0..7a98e795bd90 100644 --- a/sys/arch/sparc/dev/tctrl.c +++ b/sys/arch/sparc/dev/tctrl.c @@ -1,4 +1,4 @@ -/* $NetBSD: tctrl.c,v 1.2 1999/08/11 00:46:06 matt Exp $ */ +/* $NetBSD: tctrl.c,v 1.3 1999/11/21 15:23:02 pk Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -170,8 +170,11 @@ tctrl_attach(struct device *parent, struct device *self, void *aux) tctrl_write(sc, TS102_REG_UCTRL_STS, TS102_UCTRL_STS_RXNE_STA); } - (void)bus_intr_establish(sc->sc_memt, sa->sa_pri, 0, tctrl_intr, sc); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + if (sa->sa_nintr != 0) { + (void)bus_intr_establish(sc->sc_memt, sa->sa_pri, + 0, tctrl_intr, sc); + evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + } /* See what the external status is */ diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index 1ea22f6930f5..cc6fdf49aad1 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.70 1999/11/07 16:36:16 pk Exp $ */ +/* $NetBSD: zs.c,v 1.71 1999/11/21 15:23:02 pk Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -292,7 +292,8 @@ zs_attach_obio(parent, self, aux) struct sbus_attach_args *sa = &uoba->uoba_sbus; zsc->zsc_bustag = sa->sa_bustag; zsc->zsc_dmatag = sa->sa_dmatag; - zs_attach(zsc, sa->sa_pri); + if (sa->sa_nintr != 0) + zs_attach(zsc, sa->sa_pri); } else { struct obio4_attach_args *oba = &uoba->uoba_oba4; zsc->zsc_bustag = oba->oba_bustag;