summaryrefslogtreecommitdiff
path: root/sys/arch/vax/vsa
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-08-25 13:33:38 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-08-25 13:33:38 +0000
commit2f9f539a801e8c00430eacc3a70495465ca02e4e (patch)
treea8c95a4e7bd59da4baa2c4974425216c11ff94b4 /sys/arch/vax/vsa
parent1195029145310bb1c26d5da6e89f13372126bc9b (diff)
Bring in some useful stuff from NetBSD. Mostly work by Matt Thomas,
and concerned with intvec counting. Also some ANSIfication.
Diffstat (limited to 'sys/arch/vax/vsa')
-rw-r--r--sys/arch/vax/vsa/asc_vsbus.c7
-rw-r--r--sys/arch/vax/vsa/dz_ibus.c18
-rw-r--r--sys/arch/vax/vsa/if_le_vsbus.c6
-rw-r--r--sys/arch/vax/vsa/if_ze_vsbus.c14
-rw-r--r--sys/arch/vax/vsa/ncr.c29
-rw-r--r--sys/arch/vax/vsa/vsbus.c14
6 files changed, 50 insertions, 38 deletions
diff --git a/sys/arch/vax/vsa/asc_vsbus.c b/sys/arch/vax/vsa/asc_vsbus.c
index 3e330022c7e..00ffed74ce3 100644
--- a/sys/arch/vax/vsa/asc_vsbus.c
+++ b/sys/arch/vax/vsa/asc_vsbus.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: asc_vsbus.c,v 1.3 2001/02/11 06:34:37 hugh Exp $ */
-/* $NetBSD: asc_vsbus.c,v 1.20 2000/07/26 21:50:48 matt Exp $ */
+/* $OpenBSD: asc_vsbus.c,v 1.4 2001/08/25 13:33:37 hugh Exp $ */
+/* $NetBSD: asc_vsbus.c,v 1.22 2001/02/04 20:36:32 ragge Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -284,7 +284,8 @@ asc_vsbus_attach(struct device *parent, struct device *self, void *aux)
sc->sc_freq /= 1000000;
scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr53c9x_intr,
- &asc->sc_ncr53c9x, SCB_ISTACK);
+ &asc->sc_ncr53c9x, SCB_ISTACK, &asc->sc_intrcnt);
+ evcnt_attach(self, "intr", &asc->sc_intrcnt);
/*
* XXX More of this should be in ncr53c9x_attach(), but
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c
index 0be9c27a6d7..e6e3383aca4 100644
--- a/sys/arch/vax/vsa/dz_ibus.c
+++ b/sys/arch/vax/vsa/dz_ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz_ibus.c,v 1.6 2001/06/15 22:45:34 miod Exp $ */
+/* $OpenBSD: dz_ibus.c,v 1.7 2001/08/25 13:33:37 hugh Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -14,8 +14,8 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed at Ludd, University of
- * Lule}, Sweden and its contributors.
+ * This product includes software developed at Ludd, University of
+ * Lule}, Sweden and its contributors.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
@@ -51,6 +51,7 @@
#include <machine/vsbus.h>
#include <machine/cpu.h>
#include <machine/scb.h>
+#include <machine/nexus.h>
#include <machine/../vax/gencons.h>
@@ -62,8 +63,8 @@
#include "dzkbd.h"
#include "dzms.h"
-static int dz_vsbus_match __P((struct device *, struct cfdata *, void *));
-static void dz_vsbus_attach __P((struct device *, struct device *, void *));
+static int dz_vsbus_match(struct device *, struct cfdata *, void *);
+static void dz_vsbus_attach(struct device *, struct device *, void *);
static vaddr_t dz_regs; /* Used for console */
@@ -175,8 +176,11 @@ dz_vsbus_attach(parent, self, aux)
sc->sc_type = DZ_DZV;
sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
- scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK);
- scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK);
+ scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK,
+ &sc->sc_tintrcnt);
+ scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK,
+ &sc->sc_rintrcnt);
+
printf("\n%s: 4 lines", self->dv_xname);
dzattach(sc);
diff --git a/sys/arch/vax/vsa/if_le_vsbus.c b/sys/arch/vax/vsa/if_le_vsbus.c
index 8a3d1224a95..4fa5949eb34 100644
--- a/sys/arch/vax/vsa/if_le_vsbus.c
+++ b/sys/arch/vax/vsa/if_le_vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_vsbus.c,v 1.3 2001/02/11 06:34:38 hugh Exp $ */
+/* $OpenBSD: if_le_vsbus.c,v 1.4 2001/08/25 13:33:37 hugh Exp $ */
/* $NetBSD: if_le_vsbus.c,v 1.10 2000/06/29 07:14:18 mrg Exp $ */
/*-
@@ -225,7 +225,9 @@ le_vsbus_attach(parent, self, aux)
sc->sc_am7990.sc_wrcsr = lewrcsr;
sc->sc_am7990.sc_nocarrier = NULL;
- scb_vecalloc(va->va_cvec, (void (*)(void *)) am7990_intr, sc, SCB_ISTACK);
+ scb_vecalloc(va->va_cvec, (void (*)(void *)) am7990_intr, sc,
+ SCB_ISTACK, &sc->sc_intrcnt);
+ evcnt_attach(self, "intr", &sc->sc_intrcnt);
/*
* Allocate a (DMA-safe) block for all descriptors and buffers.
diff --git a/sys/arch/vax/vsa/if_ze_vsbus.c b/sys/arch/vax/vsa/if_ze_vsbus.c
index 64414a4e448..34d6ccb6156 100644
--- a/sys/arch/vax/vsa/if_ze_vsbus.c
+++ b/sys/arch/vax/vsa/if_ze_vsbus.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_ze_vsbus.c,v 1.1 2000/04/27 02:34:50 bjc Exp $ */
-/* $NetBSD: if_ze_vsbus.c,v 1.2 2000/01/24 02:40:35 matt Exp $ */
+/* $OpenBSD: if_ze_vsbus.c,v 1.2 2001/08/25 13:33:37 hugh Exp $ */
+/* $NetBSD: if_ze_vsbus.c,v 1.5 2000/07/26 21:50:49 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
*
@@ -63,8 +63,8 @@
#define NISA_ROM 0x27800000
#define SGECVEC 0x108
-static int zematch __P((struct device *, void *, void *));
-static void zeattach __P((struct device *, struct device *, void *));
+static int zematch(struct device *, void *, void *);
+static void zeattach(struct device *, struct device *, void *);
struct cfattach ze_vsbus_ca = {
sizeof(struct ze_softc), zematch, zeattach
@@ -103,6 +103,7 @@ zeattach(parent, self, aux)
{
struct ze_softc *sc = (struct ze_softc *)self;
struct vsbus_attach_args *va = aux;
+ extern struct vax_bus_dma_tag vax_bus_dma_tag;
int *ea, i;
/*
@@ -110,10 +111,11 @@ zeattach(parent, self, aux)
*/
sc->sc_ioh = vax_map_physmem(SGECADDR, 1);
sc->sc_iot = 0; /* :-) */
- sc->sc_dmat = va->va_dmat;
+ sc->sc_dmat = &vax_bus_dma_tag;
sc->sc_intvec = SGECVEC;
- scb_vecalloc(va->va_cvec, (void (*)(void *)) sgec_intr, sc, SCB_ISTACK);
+ scb_vecalloc(va->va_cvec, (void (*)(void *)) sgec_intr,
+ sc, SCB_ISTACK, &sc->sc_intrcnt);
/*
* Map in, read and release ethernet rom address.
diff --git a/sys/arch/vax/vsa/ncr.c b/sys/arch/vax/vsa/ncr.c
index 7bacbaf2a43..b38fb32635e 100644
--- a/sys/arch/vax/vsa/ncr.c
+++ b/sys/arch/vax/vsa/ncr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr.c,v 1.9 2001/02/15 13:15:03 hugh Exp $ */
+/* $OpenBSD: ncr.c,v 1.10 2001/08/25 13:33:37 hugh Exp $ */
/* $NetBSD: ncr.c,v 1.32 2000/06/25 16:00:43 ragge Exp $ */
/*-
@@ -91,6 +91,7 @@ struct si_dma_handle {
struct si_softc {
struct ncr5380_softc ncr_sc;
+ struct evcnt ncr_intrcnt;
caddr_t ncr_addr;
int ncr_off;
int ncr_dmaaddr;
@@ -108,18 +109,18 @@ struct si_softc {
static int ncr_dmasize;
-static int si_match __P((struct device *, void *, void *));
-static void si_attach __P((struct device *, struct device *, void *));
-static void si_minphys __P((struct buf *));
+static int si_match(struct device *, void *, void *);
+static void si_attach(struct device *, struct device *, void *);
+static void si_minphys(struct buf *);
-static void si_dma_alloc __P((struct ncr5380_softc *));
-static void si_dma_free __P((struct ncr5380_softc *));
-static void si_dma_setup __P((struct ncr5380_softc *));
-static void si_dma_start __P((struct ncr5380_softc *));
-static void si_dma_poll __P((struct ncr5380_softc *));
-static void si_dma_eop __P((struct ncr5380_softc *));
-static void si_dma_stop __P((struct ncr5380_softc *));
-static void si_dma_go __P((void *));
+static void si_dma_alloc(struct ncr5380_softc *);
+static void si_dma_free(struct ncr5380_softc *);
+static void si_dma_setup(struct ncr5380_softc *);
+static void si_dma_start(struct ncr5380_softc *);
+static void si_dma_poll(struct ncr5380_softc *);
+static void si_dma_eop(struct ncr5380_softc *);
+static void si_dma_stop(struct ncr5380_softc *);
+static void si_dma_go(void *);
#define NCR5380_READ(sc, reg) bus_space_read_1(sc->sc_regt, \
0, sc->ncr_sc.reg)
@@ -182,7 +183,9 @@ si_attach(parent, self, aux)
int tweak, target;
/* enable interrupts on vsbus too */
- scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr5380_intr, sc, SCB_ISTACK);
+ scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr5380_intr, sc,
+ SCB_ISTACK, &sc->ncr_intrcnt);
+ evcnt_attach(self, "intr", &sc->ncr_intrcnt);
/*
* DMA area mapin.
diff --git a/sys/arch/vax/vsa/vsbus.c b/sys/arch/vax/vsa/vsbus.c
index 43e18bf8584..bbf9fe688e8 100644
--- a/sys/arch/vax/vsa/vsbus.c
+++ b/sys/arch/vax/vsa/vsbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsbus.c,v 1.6 2001/02/11 06:34:38 hugh Exp $ */
+/* $OpenBSD: vsbus.c,v 1.7 2001/08/25 13:33:37 hugh Exp $ */
/* $NetBSD: vsbus.c,v 1.29 2000/06/29 07:14:37 mrg Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
@@ -67,13 +67,13 @@
#include <machine/vsbus.h>
-int vsbus_match __P((struct device *, struct cfdata *, void *));
-void vsbus_attach __P((struct device *, struct device *, void *));
-int vsbus_print __P((void *, const char *));
-int vsbus_search __P((struct device *, void *, void *));
+int vsbus_match(struct device *, struct cfdata *, void *);
+void vsbus_attach(struct device *, struct device *, void *);
+int vsbus_print(void *, const char *);
+int vsbus_search(struct device *, void *, void *);
-void ka410_attach __P((struct device *, struct device *, void *));
-void ka43_attach __P((struct device *, struct device *, void *));
+void ka410_attach(struct device *, struct device *, void *);
+void ka43_attach(struct device *, struct device *, void *);
static struct vax_bus_dma_tag vsbus_bus_dma_tag = {
0,