Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/bi More intelligent BI vector assignment.
details: https://anonhg.NetBSD.org/src/rev/402eec73226c
branches: trunk
changeset: 495344:402eec73226c
user: ragge <ragge%NetBSD.org@localhost>
date: Wed Jul 26 12:41:40 2000 +0000
description:
More intelligent BI vector assignment.
diffstat:
sys/dev/bi/bi.c | 60 ++++++++++++++++++++++++++++-------------------------
sys/dev/bi/bivar.h | 9 +++++++-
2 files changed, 40 insertions(+), 29 deletions(-)
diffs (136 lines):
diff -r afca6f637923 -r 402eec73226c sys/dev/bi/bi.c
--- a/sys/dev/bi/bi.c Wed Jul 26 12:39:20 2000 +0000
+++ b/sys/dev/bi/bi.c Wed Jul 26 12:41:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bi.c,v 1.15 2000/07/06 17:47:02 ragge Exp $ */
+/* $NetBSD: bi.c,v 1.16 2000/07/26 12:41:40 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -52,21 +52,21 @@
static int bi_print __P((void *, const char *));
struct bi_list bi_list[] = {
- {BIDT_MS820, 1, "ms820"},
- {BIDT_DRB32, 0, "drb32"},
- {BIDT_DWBUA, 0, "dwbua"},
- {BIDT_KLESI, 0, "klesi"},
- {BIDT_KA820, 1, "ka820"},
- {BIDT_DB88, 0, "db88"},
- {BIDT_CIBCA, 0, "cibca"},
- {BIDT_DMB32, 0, "dmb32"},
- {BIDT_CIBCI, 0, "cibci"},
- {BIDT_KA800, 0, "ka800"},
- {BIDT_KDB50, 0, "kdb50"},
- {BIDT_DWMBA, 0, "dwmba"},
- {BIDT_KFBTA, 0, "kfbta"},
- {BIDT_DEBNK, 0, "debnk"},
- {BIDT_DEBNA, 0, "debna"},
+ {BIDT_MS820, DT_HAVDRV, "ms820"},
+ {BIDT_DRB32, DT_UNSUPP, "drb32"},
+ {BIDT_DWBUA, DT_HAVDRV|DT_ADAPT, "dwbua"},
+ {BIDT_KLESI, DT_HAVDRV|DT_ADAPT, "klesi"},
+ {BIDT_KA820, DT_HAVDRV, "ka820"},
+ {BIDT_DB88, DT_HAVDRV|DT_QUIET, "db88"},
+ {BIDT_CIBCA, DT_UNSUPP, "cibca"},
+ {BIDT_DMB32, DT_UNSUPP, "dmb32"},
+ {BIDT_CIBCI, DT_UNSUPP, "cibci"},
+ {BIDT_KA800, DT_UNSUPP, "ka800"},
+ {BIDT_KDB50, DT_HAVDRV|DT_VEC, "kdb50"},
+ {BIDT_DWMBA, DT_HAVDRV|DT_QUIET, "dwmba"},
+ {BIDT_KFBTA, DT_UNSUPP, "kfbta"},
+ {BIDT_DEBNK, DT_HAVDRV|DT_VEC, "debnk"},
+ {BIDT_DEBNA, DT_HAVDRV|DT_VEC, "debna"},
{0,0,0}
};
@@ -86,13 +86,14 @@
if (name) {
if (bl->bl_nr == 0)
- printf("unknown device 0x%x",
- bus_space_read_2(ba->ba_iot, ba->ba_ioh, 0));
+ printf("unknown device 0x%x", nr);
else
printf(bl->bl_name);
printf(" at %s", name);
}
printf(" node %d", ba->ba_nodenr);
+ if (bl->bl_havedriver & DT_VEC)
+ printf(" vec %o", ba->ba_ivec & 511);
#ifdef DEBUG
if (bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_SADR) &&
bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_EADR))
@@ -100,11 +101,12 @@
bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_SADR),
bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_EADR));
#endif
- return bl->bl_havedriver ? UNCONF : UNSUPP;
+ if (bl->bl_havedriver & DT_QUIET)
+ printf("\n");
+ return bl->bl_havedriver & DT_QUIET ? QUIET :
+ bl->bl_havedriver & DT_HAVDRV ? UNCONF : UNSUPP;
}
-static int lastiv = 0;
-
void
bi_attach(sc)
struct bi_softc *sc;
@@ -118,10 +120,12 @@
ba.ba_busnr = sc->sc_busnr;
ba.ba_dmat = sc->sc_dmat;
ba.ba_intcpu = sc->sc_intcpu;
+ ba.ba_icookie = sc;
/*
- * Interrupt numbers. All vectors from 256-512 are free, use
- * them for BI devices and just count them up.
- * Above 512 are only interrupt vectors for unibus devices.
+ * Interrupt numbers. Assign them as described in
+ * VAX 8800 system maintenance manual; this means like nexus
+ * adapters have them assigned.
+ * XXX - must address Unibus adapters.
*/
for (nodenr = 0; nodenr < NNODEBI; nodenr++) {
if (bus_space_map(sc->sc_iot, sc->sc_addr + BI_NODE(nodenr),
@@ -130,13 +134,13 @@
nodenr);
return;
}
- if (badaddr((caddr_t)ba.ba_ioh, 4)) {
- bus_space_unmap(sc->sc_iot, ba.ba_ioh, BI_NODESIZE);
+ if (badaddr((caddr_t)ba.ba_ioh, 4) ||
+ (bus_space_read_2(ba.ba_iot, ba.ba_ioh, 0) == 0)) {
+ bus_space_unmap(ba.ba_iot, ba.ba_ioh, BI_NODESIZE);
continue;
}
ba.ba_nodenr = nodenr;
- ba.ba_ivec = 256 + lastiv;
- lastiv += 4;
+ ba.ba_ivec = sc->sc_lastiv + 64 + 4 * nodenr; /* all on spl5 */
config_found(&sc->sc_dev, &ba, bi_print);
}
}
diff -r afca6f637923 -r 402eec73226c sys/dev/bi/bivar.h
--- a/sys/dev/bi/bivar.h Wed Jul 26 12:39:20 2000 +0000
+++ b/sys/dev/bi/bivar.h Wed Jul 26 12:41:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bivar.h,v 1.7 2000/06/04 06:17:00 matt Exp $ */
+/* $NetBSD: bivar.h,v 1.8 2000/07/26 12:41:40 ragge Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -68,6 +68,13 @@
char *bl_name; /* DEC name */
};
+/* bl_havedriver field meaning */
+#define DT_UNSUPP 0 /* pseudo define */
+#define DT_HAVDRV 1 /* device have driver */
+#define DT_ADAPT 2 /* is an adapter */
+#define DT_QUIET 4 /* don't complain when not conf'ed */
+#define DT_VEC 8 /* uses a interrupt vector */
+
/* Prototype */
void bi_attach (struct bi_softc *);
void bi_intr_establish (void *, int, void (*)(void *), void *, struct evcnt *);
Home |
Main Index |
Thread Index |
Old Index