Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/dev Check if sbus is defined in the kernel co...



details:   https://anonhg.NetBSD.org/src/rev/86cbb4eb6fee
branches:  trunk
changeset: 785666:86cbb4eb6fee
user:      jdc <jdc%NetBSD.org@localhost>
date:      Sun Mar 24 17:50:26 2013 +0000

description:
Check if sbus is defined in the kernel configuration before using it.
>From Taylor R Campbell.

diffstat:

 sys/arch/sparc/dev/obio.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r 129de477556d -r 86cbb4eb6fee sys/arch/sparc/dev/obio.c
--- a/sys/arch/sparc/dev/obio.c Sun Mar 24 17:05:27 2013 +0000
+++ b/sys/arch/sparc/dev/obio.c Sun Mar 24 17:50:26 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio.c,v 1.73 2012/10/27 17:18:11 chs Exp $    */
+/*     $NetBSD: obio.c,v 1.74 2013/03/24 17:50:26 jdc Exp $    */
 
 /*-
  * Copyright (c) 1997,1998 The NetBSD Foundation, Inc.
@@ -30,10 +30,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.73 2012/10/27 17:18:11 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.74 2013/03/24 17:50:26 jdc Exp $");
 
 #include "locators.h"
 
+#ifdef _KERNEL_OPT
+#include "sbus.h"
+#endif
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -47,7 +51,9 @@
 #include <uvm/uvm_extern.h>
 
 #include <sys/bus.h>
+#if NSBUS > 0
 #include <sparc/dev/sbusvar.h>
+#endif
 #include <machine/autoconf.h>
 #include <machine/oldmon.h>
 #include <machine/cpu.h>
@@ -64,7 +70,9 @@
 
 union obio_softc {
        struct  obio4_softc sc_obio;    /* sun4 obio */
+#if NSBUS > 0
        struct  sbus_softc sc_sbus;     /* sun4m obio is another sbus slot */
+#endif
 };
 
 
@@ -97,6 +105,7 @@
 static struct sparc_bus_space_tag obio_space_tag;
 #endif
 
+#if NSBUS > 0
 /*
  * Translate obio `interrupts' property value to processor IPL (see sbus.c)
  * Apparently, the `interrupts' property on obio devices is just
@@ -105,6 +114,7 @@
 static int intr_obio2ipl[] = {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
 };
+#endif
 
 static int
 obiomatch(device_t parent, struct cfdata *cf, void *aux)
@@ -163,6 +173,7 @@
 #endif
                return;
        } else if (CPU_ISSUN4M) {
+#if NSBUS > 0
                /*
                 * Attach the on-board I/O bus at on a sun4m.
                 * In this case we treat the obio bus as another sbus slot.
@@ -189,6 +200,7 @@
                sc->sc_intr2ipl = intr_obio2ipl;
 
                sbus_attach_common(sc, "obio", ma->ma_node, special4m);
+#endif
        } else {
                printf("obio on this machine?\n");
        }



Home | Main Index | Thread Index | Old Index