diff --git a/sys/arch/sgimips/dev/zs.c b/sys/arch/sgimips/dev/zs.c index 9e3d69c06f68..d4d5c45b620b 100644 --- a/sys/arch/sgimips/dev/zs.c +++ b/sys/arch/sgimips/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.8 2002/03/13 13:12:26 simonb Exp $ */ +/* $NetBSD: zs.c,v 1.9 2002/04/17 13:49:55 rafal Exp $ */ /*- * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ * or you can not see messages done with printf during boot-up... */ int zs_def_cflag = (CREAD | CS8 | HUPCL); -int zs_major = 35; +int zs_major = 0; #define PCLK 3672000 /* PCLK pin input clock rate */ @@ -173,6 +173,7 @@ struct cfattach zsc_hpc_ca = { sizeof(struct zsc_softc), zs_hpc_match, zs_hpc_attach }; +cdev_decl(zs); extern struct cfdriver zsc_cd; static int zshard __P((void *)); @@ -332,6 +333,9 @@ zs_hpc_attach(parent, self, aux) zsc->sc_si = softintr_establish(IPL_SOFTSERIAL, zssoft, zsc); cpu_intr_establish(haa->ha_irq, IPL_TTY, zshard, NULL); + evcnt_attach_dynamic(&zsc->zsc_intrcnt, EVCNT_TYPE_INTR, NULL, + self->dv_xname, "intr"); + /* * Set the master interrupt enable and interrupt vector. * (common to both channels, do it on A) @@ -370,14 +374,19 @@ zshard(arg) void *arg; { register struct zsc_softc *zsc; - register int unit, rval, softreq; + register int rr3, unit, rval, softreq; rval = 0; for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) { zsc = zsc_cd.cd_devs[unit]; if (zsc == NULL) continue; - rval |= zsc_intr_hard(zsc); + + while ((rr3 = zsc_intr_hard(zsc))) { + rval |= rr3; + zsc->zsc_intrcnt.ev_count++; + } + softreq = zsc->zsc_cs[0]->cs_softreq; softreq |= zsc->zsc_cs[1]->cs_softreq; if (softreq && (zssoftpending == 0)) { @@ -709,6 +718,13 @@ zscninit(cn) cons_port = consdev[7] - '0'; + /* + * Initialize the zstty console device major (needed by cnopen) + */ + for (zs_major = 0; zs_major < nchrdev; zs_major++) + if (cdevsw[zs_major].d_open == zsopen) + break; + cn->cn_dev = makedev(zs_major, cons_port); cn->cn_pri = CN_REMOTE; diff --git a/sys/arch/sgimips/include/z8530var.h b/sys/arch/sgimips/include/z8530var.h index 65f91960f1da..1d8705ddd0d2 100644 --- a/sys/arch/sgimips/include/z8530var.h +++ b/sys/arch/sgimips/include/z8530var.h @@ -1,4 +1,4 @@ -/* $NetBSD: z8530var.h,v 1.3 2002/03/13 13:12:28 simonb Exp $ */ +/* $NetBSD: z8530var.h,v 1.4 2002/04/17 13:49:54 rafal Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -61,6 +61,7 @@ struct zsc_softc { /* Machine-dependent part follows... */ bus_space_tag_t zsc_bustag; /* Bus type */ bus_space_handle_t zsc_base; /* Device base address */ + struct evcnt zsc_intrcnt; /* count interrupts */ void *sc_si; /* Softinterrupt handle */ };