diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-29 07:35:15 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-29 07:35:15 +0000 |
commit | 98de1921367f7a5202910626ee67011985fc6238 (patch) | |
tree | 78c6738edd0eb52fb6c913736d7913c0c1f0674b /sys | |
parent | 4ee9b02e4ff2aca8569497a013add163e3752aa0 (diff) |
Switch sparc to evcount; ok deraadt@
Diffstat (limited to 'sys')
45 files changed, 201 insertions, 157 deletions
diff --git a/sys/arch/sparc/dev/amd7930.c b/sys/arch/sparc/dev/amd7930.c index 3820a6b26bb..14c81df10c7 100644 --- a/sys/arch/sparc/dev/amd7930.c +++ b/sys/arch/sparc/dev/amd7930.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amd7930.c,v 1.27 2003/11/03 07:01:33 david Exp $ */ +/* $OpenBSD: amd7930.c,v 1.28 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: amd7930.c,v 1.37 1998/03/30 14:23:40 pk Exp $ */ /* @@ -64,7 +64,6 @@ int amd7930debug = 0; */ struct amd7930_softc { struct device sc_dev; /* base device */ - struct intrhand sc_hwih; /* hardware interrupt vector */ struct intrhand sc_swih; /* software interrupt vector */ int sc_open; /* single use device */ @@ -84,7 +83,7 @@ struct amd7930_softc { /* sc_au is special in that the hardware interrupt handler uses it */ struct auio sc_au; /* recv and xmit buffers, etc */ -#define sc_intrcnt sc_au.au_intrcnt /* statistics */ +#define sc_hwih sc_au.au_ih /* hardware interrupt vector */ }; /* interrupt interfaces */ @@ -300,17 +299,19 @@ amd7930attach(parent, self, args) #ifndef AUDIO_C_HANDLER auiop = &sc->sc_au; + sc->sc_hwih.ih_vec = pri; + evcount_attach(&sc->sc_hwih.ih_count, sc->sc_dev.dv_xname, + &sc->sc_hwih.ih_vec, &evcount_intr); intr_fasttrap(pri, amd7930_trap); #else sc->sc_hwih.ih_fun = amd7930hwintr; sc->sc_hwih.ih_arg = &sc->sc_au; - intr_establish(pri, &sc->sc_hwih, IPL_AUHARD); + intr_establish(pri, &sc->sc_hwih, IPL_AUHARD, sc->sc_dev.dv_xname); #endif sc->sc_swih.ih_fun = amd7930swintr; sc->sc_swih.ih_arg = sc; - intr_establish(IPL_AUSOFT, &sc->sc_swih, IPL_AUSOFT); - - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + intr_establish(IPL_AUSOFT, &sc->sc_swih, IPL_AUSOFT, + sc->sc_dev.dv_xname); audio_attach_mi(&sa_hw_if, sc, &sc->sc_dev); amd7930_commit_settings(sc); @@ -811,7 +812,6 @@ amd7930hwintr(au0) } } - au->au_intrcnt.ev_count++; return (-1); } #endif /* AUDIO_C_HANDLER */ diff --git a/sys/arch/sparc/dev/amd7930var.h b/sys/arch/sparc/dev/amd7930var.h index bd73abde6d5..ccc2bead247 100644 --- a/sys/arch/sparc/dev/amd7930var.h +++ b/sys/arch/sparc/dev/amd7930var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amd7930var.h,v 1.6 2003/06/02 23:27:53 millert Exp $ */ +/* $OpenBSD: amd7930var.h,v 1.7 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: amd7930var.h,v 1.3 1996/02/01 22:32:25 mycroft Exp $ */ /* @@ -62,7 +62,8 @@ struct auio { u_char *au_rend; /* end of record data */ u_char *au_pdata; /* play data */ u_char *au_pend; /* end of play data */ - struct evcnt au_intrcnt; /* statistics */ + + struct intrhand au_ih; }; /* diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c index ef8adc5f67e..f9c87d423f1 100644 --- a/sys/arch/sparc/dev/be.c +++ b/sys/arch/sparc/dev/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.34 2003/06/02 18:40:58 jason Exp $ */ +/* $OpenBSD: be.c,v 1.35 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1998 Theo de Raadt and Jason L. Wright. @@ -163,7 +163,7 @@ beattach(parent, self, aux) sc->sc_ih.ih_fun = beintr; sc->sc_ih.ih_arg = sc; - intr_establish(pri, &sc->sc_ih, IPL_NET); + intr_establish(pri, &sc->sc_ih, IPL_NET, sc->sc_dev.dv_xname); myetheraddr(sc->sc_arpcom.ac_enaddr); diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index 74c12b853ca..1f32129a0c8 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.28 2003/06/28 17:05:33 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.29 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -319,7 +319,8 @@ cgsixattach(parent, self, args) sc->sc_ih.ih_fun = cgsix_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); /* reset cursor & frame buffer controls */ cgsix_reset(sc, fhcrev); diff --git a/sys/arch/sparc/dev/cgthree.c b/sys/arch/sparc/dev/cgthree.c index aac4ecf9e0f..6f077420d4c 100644 --- a/sys/arch/sparc/dev/cgthree.c +++ b/sys/arch/sparc/dev/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.24 2003/08/01 19:24:49 miod Exp $ */ +/* $OpenBSD: cgthree.c,v 1.25 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: cgthree.c,v 1.33 1997/05/24 20:16:11 pk Exp $ */ /* @@ -287,7 +287,8 @@ cgthreeattach(parent, self, args) sc->sc_ih.ih_fun = cgthree_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); /* grab initial (current) color map */ bt = &sc->sc_fbc->fbc_dac; diff --git a/sys/arch/sparc/dev/cs4231.c b/sys/arch/sparc/dev/cs4231.c index 19e5f3f7d49..8abb7e7aa9d 100644 --- a/sys/arch/sparc/dev/cs4231.c +++ b/sys/arch/sparc/dev/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.20 2003/12/20 00:49:45 miod Exp $ */ +/* $OpenBSD: cs4231.c,v 1.21 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -241,12 +241,11 @@ cs4231_attach(parent, self, aux) sc->sc_ih.ih_fun = cs4231_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_AUHARD); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_AUHARD, + self->dv_xname); printf(" pri %d, softpri %d\n", pri, IPL_AUSOFT); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); - audio_attach_mi(&cs4231_sa_hw_if, sc, &sc->sc_dev); /* Default to speaker, unmuted, reasonable volume */ diff --git a/sys/arch/sparc/dev/cs4231var.h b/sys/arch/sparc/dev/cs4231var.h index 12f774cfdec..c304974dad4 100644 --- a/sys/arch/sparc/dev/cs4231var.h +++ b/sys/arch/sparc/dev/cs4231var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231var.h,v 1.8 2003/06/02 18:40:59 jason Exp $ */ +/* $OpenBSD: cs4231var.h,v 1.9 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -60,7 +60,6 @@ struct cs4231_softc { struct sbusdev sc_sd; /* sbus device */ struct intrhand sc_ih; /* hardware interrupt vectoring */ struct cs4231_regs *sc_regs; /* CS4231/APC registers */ - struct evcnt sc_intrcnt; /* statistics */ int sc_node; /* which sbus node */ int sc_burst; /* XXX: DMA burst size in effect */ int sc_open; /* already open? */ diff --git a/sys/arch/sparc/dev/daadio.c b/sys/arch/sparc/dev/daadio.c index 5e897dcd6e4..e14c2a1be68 100644 --- a/sys/arch/sparc/dev/daadio.c +++ b/sys/arch/sparc/dev/daadio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: daadio.c,v 1.5 2003/06/02 18:40:59 jason Exp $ */ +/* $OpenBSD: daadio.c,v 1.6 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -134,7 +134,7 @@ daadioattach(parent, self, aux) sc->sc_ih.ih_fun = daadiointr; sc->sc_ih.ih_arg = sc; fvmeintrestablish(parent, ca->ca_ra.ra_intr[0].int_vec, - ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih); + ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, self->dv_xname); daadio_ier_setbit(sc, IER_PIOEVENT); daadio_ier_setbit(sc, IER_CONVERSION); diff --git a/sys/arch/sparc/dev/esp.c b/sys/arch/sparc/dev/esp.c index b4cd210048f..245e94d8a6b 100644 --- a/sys/arch/sparc/dev/esp.c +++ b/sys/arch/sparc/dev/esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esp.c,v 1.21 2003/06/05 12:27:02 deraadt Exp $ */ +/* $OpenBSD: esp.c,v 1.22 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: esp.c,v 1.69 1997/08/27 11:24:18 bouyer Exp $ */ /* @@ -371,8 +371,7 @@ espattach(parent, self, aux) /* and the interuppts */ esc->sc_ih.ih_fun = (void *) ncr53c9x_intr; esc->sc_ih.ih_arg = sc; - intr_establish(esc->sc_pri, &esc->sc_ih, IPL_BIO); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + intr_establish(esc->sc_pri, &esc->sc_ih, IPL_BIO, self->dv_xname); /* * If the boot path is "esp" at the moment and it's me, then diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index abd328067d8..f441f05123d 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.37 2004/09/22 22:12:57 miod Exp $ */ +/* $OpenBSD: fd.c,v 1.38 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -148,7 +148,6 @@ enum fdc_state { struct fdc_softc { struct device sc_dev; /* boilerplate */ struct intrhand sc_sih; - struct intrhand sc_hih; caddr_t sc_reg; struct fd_softc *sc_fd[4]; /* pointers to children */ TAILQ_HEAD(drivehead, fd_softc) sc_drives; @@ -172,13 +171,13 @@ struct fdc_softc { #define sc_tc sc_io.fdcio_tc #define sc_nstat sc_io.fdcio_nstat #define sc_status sc_io.fdcio_status -#define sc_intrcnt sc_io.fdcio_intrcnt +#define sc_hih sc_io.fdcio_ih struct timeout fdctimeout_to; struct timeout fdcpseudointr_to; }; #ifndef FDC_C_HANDLER -extern struct fdcio *fdciop; +extern struct fdcio *fdciop; #endif /* controller driver configuration */ @@ -447,14 +446,17 @@ fdcattach(parent, self, aux) #ifdef FDC_C_HANDLER fdc->sc_hih.ih_fun = (void *)fdc_c_hwintr; fdc->sc_hih.ih_arg = fdc; - intr_establish(pri, &fdc->sc_hih, IPL_FD); + intr_establish(pri, &fdc->sc_hih, IPL_FD, self->dv_xname); #else fdciop = &fdc->sc_io; + fdc->sc_hih.ih_vec = pri; + evcount_attach(&fdc->sc_hih.ih_count, self->dv_xname, + &fdc->sc_hih.ih_vec, &evcount_intr); intr_fasttrap(pri, fdchwintr); #endif fdc->sc_sih.ih_fun = (void *)fdcswintr; fdc->sc_sih.ih_arg = fdc; - intr_establish(IPL_FDSOFT, &fdc->sc_sih, IPL_BIO); + intr_establish(IPL_FDSOFT, &fdc->sc_sih, IPL_BIO, self->dv_xname); /* Assume a 82077 */ fdc->sc_reg_msr = &((struct fdreg_77 *)fdc->sc_reg)->fd_msr; @@ -499,8 +501,6 @@ fdcattach(parent, self, aux) printf(" CFGLOCK: unexpected response"); } - evcnt_attach(&fdc->sc_dev, "intr", &fdc->sc_intrcnt); - printf(" pri %d, softpri %d: chip 8207%c\n", pri, IPL_FDSOFT, code); /* @@ -1239,7 +1239,6 @@ fdc_c_hwintr(fdc) } } done: - fdc->sc_intrcnt.ev_count++; return (1); } #endif diff --git a/sys/arch/sparc/dev/fdvar.h b/sys/arch/sparc/dev/fdvar.h index c3022021574..317176babf3 100644 --- a/sys/arch/sparc/dev/fdvar.h +++ b/sys/arch/sparc/dev/fdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fdvar.h,v 1.6 2004/09/22 22:12:58 miod Exp $ */ +/* $OpenBSD: fdvar.h,v 1.7 2004/09/29 07:35:11 miod Exp $ */ /* * $NetBSD: fdvar.h,v 1.5 1996/12/08 23:40:34 pk Exp $ * @@ -61,10 +61,7 @@ struct fdcio { u_char fdcio_status[FDC_NSTATUS]; /* copy of registers */ int fdcio_nstat; /* # of valid status bytes */ - /* - * Statictics. - */ - struct evcnt fdcio_intrcnt; + struct intrhand fdcio_ih; }; #endif /* _LOCORE */ diff --git a/sys/arch/sparc/dev/fga.c b/sys/arch/sparc/dev/fga.c index 46976079c3c..f381258c29d 100644 --- a/sys/arch/sparc/dev/fga.c +++ b/sys/arch/sparc/dev/fga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fga.c,v 1.13 2003/06/04 07:18:16 miod Exp $ */ +/* $OpenBSD: fga.c,v 1.14 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -90,7 +90,7 @@ int fgaioctl(dev_t, u_long, caddr_t, int, struct proc *); int fga_vmerangemap(struct fga_softc *, u_int32_t, u_int32_t, int, int, u_int32_t, struct confargs *); int fga_intr_establish(struct fga_softc *, int, int, - struct intrhand *); + struct intrhand *, const char *); int fga_hwintr_establish(struct fga_softc *, u_int8_t); int fga_hwintr1(void *); @@ -480,8 +480,10 @@ fga_intrvec(sc, vec) for (ih = sc->sc_vmevec[vec]; ih; ih = ih->ih_next) { r = (*ih->ih_fun)(ih->ih_arg); - if (r > 0) + if (r > 0) { + ih->ih_count.ec_count++; return (r); + } s |= r; } @@ -492,10 +494,11 @@ fga_intrvec(sc, vec) * Establish a VME level/vector interrupt. */ int -fga_intr_establish(sc, vec, level, ih) +fga_intr_establish(sc, vec, level, ih, name) struct fga_softc *sc; int vec, level; struct intrhand *ih; + const char *name; { struct intrhand *ihs; u_int8_t level_to_sint[] = { @@ -530,6 +533,9 @@ fga_intr_establish(sc, vec, level, ih) ih->ih_next = ih; } + ih->ih_vec = level; + evcount_attach(&ih->ih_count, name, &ih->ih_vec, &evcount_intr); + /* setup hardware handler */ fga_hwintr_establish(sc, level_to_sint[level]); @@ -558,37 +564,37 @@ fga_hwintr_establish(sc, sint) case 1: sc->sc_ih1.ih_fun = fga_hwintr1; sc->sc_ih1.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih1, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih1, -1, NULL); break; case 2: sc->sc_ih2.ih_fun = fga_hwintr2; sc->sc_ih2.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih2, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih2, -1, NULL); break; case 3: sc->sc_ih3.ih_fun = fga_hwintr3; sc->sc_ih3.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih3, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih3, -1, NULL); break; case 4: sc->sc_ih4.ih_fun = fga_hwintr4; sc->sc_ih4.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih4, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih4, -1, NULL); break; case 5: sc->sc_ih5.ih_fun = fga_hwintr5; sc->sc_ih5.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih5, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih5, -1, NULL); break; case 6: sc->sc_ih6.ih_fun = fga_hwintr6; sc->sc_ih6.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih6, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih6, -1, NULL); break; case 7: sc->sc_ih7.ih_fun = fga_hwintr7; sc->sc_ih7.ih_arg = sc; - intr_establish(sint_to_pri[sint], &sc->sc_ih7, -1); + intr_establish(sint_to_pri[sint], &sc->sc_ih7, -1, NULL); break; default: panic("fga_sint"); @@ -803,12 +809,13 @@ fvmeprint(args, name) } int -fvmeintrestablish(dsc, vec, level, ih) +fvmeintrestablish(dsc, vec, level, ih, name) struct device *dsc; int vec, level; struct intrhand *ih; + const char *name; { struct fga_softc *fsc = (struct fga_softc *)dsc->dv_parent; - return (fga_intr_establish(fsc, vec, level, ih)); + return (fga_intr_establish(fsc, vec, level, ih, name)); } diff --git a/sys/arch/sparc/dev/fgavar.h b/sys/arch/sparc/dev/fgavar.h index ee21cd14edc..64883f6a3d9 100644 --- a/sys/arch/sparc/dev/fgavar.h +++ b/sys/arch/sparc/dev/fgavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fgavar.h,v 1.3 2003/06/02 18:40:59 jason Exp $ */ +/* $OpenBSD: fgavar.h,v 1.4 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -29,4 +29,5 @@ * POSSIBILITY OF SUCH DAMAGE. */ -int fvmeintrestablish(struct device *, int, int, struct intrhand *); +int fvmeintrestablish(struct device *, int, int, struct intrhand *, + const char *); diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c index b361dbc35a8..40727d19d93 100644 --- a/sys/arch/sparc/dev/hme.c +++ b/sys/arch/sparc/dev/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.44 2004/09/28 00:21:23 brad Exp $ */ +/* $OpenBSD: hme.c,v 1.45 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -207,7 +207,8 @@ hmeattach(parent, self, aux) sc->sc_ih.ih_fun = hmeintr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_NET); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_NET, + self->dv_xname); /* * Get MAC address from card if 'local-mac-address' property exists. diff --git a/sys/arch/sparc/dev/if_en_sbus.c b/sys/arch/sparc/dev/if_en_sbus.c index fbf5991adae..ff6a417b961 100644 --- a/sys/arch/sparc/dev/if_en_sbus.c +++ b/sys/arch/sparc/dev/if_en_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_en_sbus.c,v 1.5 2002/04/30 01:12:29 art Exp $ */ +/* $OpenBSD: if_en_sbus.c,v 1.6 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: if_en_sbus.c,v 1.4 1997/05/24 20:16:22 pk Exp $ */ /* @@ -161,7 +161,7 @@ void *aux; } scs->sc_ih.ih_fun = en_intr; scs->sc_ih.ih_arg = sc; - intr_establish(EN_IPL, &scs->sc_ih, IPL_NET); + intr_establish(EN_IPL, &scs->sc_ih, IPL_NET, self->dv_xname); /* * done SBUS specific stuff diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c index 36ebdc1bdfc..f42747a0f6e 100644 --- a/sys/arch/sparc/dev/if_ie.c +++ b/sys/arch/sparc/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.27 2003/11/14 19:05:36 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.28 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */ /*- @@ -669,14 +669,14 @@ ieattach(parent, self, aux) case BUS_OBIO: sc->sc_ih.ih_fun = ieintr; sc->sc_ih.ih_arg = sc; - intr_establish(pri, &sc->sc_ih, IPL_NET); + intr_establish(pri, &sc->sc_ih, IPL_NET, self->dv_xname); break; case BUS_VME16: case BUS_VME32: sc->sc_ih.ih_fun = ieintr; sc->sc_ih.ih_arg = sc; vmeintr_establish(ca->ca_ra.ra_intr[0].int_vec, pri, - &sc->sc_ih, IPL_NET); + &sc->sc_ih, IPL_NET, self->dv_xname); break; #endif /* SUN4 */ } diff --git a/sys/arch/sparc/dev/if_le.c b/sys/arch/sparc/dev/if_le.c index aec7bde2391..69bc8f30622 100644 --- a/sys/arch/sparc/dev/if_le.c +++ b/sys/arch/sparc/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.23 2003/06/04 22:08:17 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.24 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: if_le.c,v 1.50 1997/09/09 20:54:48 pk Exp $ */ /*- @@ -575,7 +575,7 @@ leattach(parent, self, aux) lesc->sc_ih.ih_fun = myleintr; #endif lesc->sc_ih.ih_arg = sc; - intr_establish(pri, &lesc->sc_ih, IPL_NET); + intr_establish(pri, &lesc->sc_ih, IPL_NET, self->dv_xname); /* now initialize DMA */ lehwreset(sc); diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c index 320ac148043..f13bb7b37b0 100644 --- a/sys/arch/sparc/dev/isp_sbus.c +++ b/sys/arch/sparc/dev/isp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_sbus.c,v 1.23 2002/10/12 01:09:43 krw Exp $ */ +/* $OpenBSD: isp_sbus.c,v 1.24 2004/09/29 07:35:11 miod Exp $ */ /* * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. * @@ -218,7 +218,7 @@ isp_sbus_attach(struct device *parent, struct device *self, void *aux) /* Establish interrupt channel */ sbc->sbus_ih.ih_fun = (void *) isp_sbus_intr; sbc->sbus_ih.ih_arg = sbc; - intr_establish(sbc->sbus_pri, &sbc->sbus_ih, IPL_BIO); + intr_establish(sbc->sbus_pri, &sbc->sbus_ih, IPL_BIO, self->dv_xname); /* * Set up logging levels. diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c index 10744180248..05aaf425258 100644 --- a/sys/arch/sparc/dev/magma.c +++ b/sys/arch/sparc/dev/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.17 2003/10/03 16:44:50 miod Exp $ */ +/* $OpenBSD: magma.c,v 1.18 2004/09/29 07:35:11 miod Exp $ */ /* * magma.c * @@ -465,11 +465,12 @@ void *base; */ sc->ms_hardint.ih_fun = magma_hard; sc->ms_hardint.ih_arg = sc; - intr_establish(ra->ra_intr[0].int_pri, &sc->ms_hardint, -1); + intr_establish(ra->ra_intr[0].int_pri, &sc->ms_hardint, -1, + dev->dv_xname); sc->ms_softint.ih_fun = magma_soft; sc->ms_softint.ih_arg = sc; - intr_establish(IPL_TTY, &sc->ms_softint, IPL_TTY); + intr_establish(IPL_TTY, &sc->ms_softint, IPL_TTY, dev->dv_xname); } /* diff --git a/sys/arch/sparc/dev/obio.c b/sys/arch/sparc/dev/obio.c index b1ff0ca3177..745c07258ea 100644 --- a/sys/arch/sparc/dev/obio.c +++ b/sys/arch/sparc/dev/obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: obio.c,v 1.15 2003/06/02 18:47:58 deraadt Exp $ */ +/* $OpenBSD: obio.c,v 1.16 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: obio.c,v 1.37 1997/07/29 09:58:11 fair Exp $ */ /* @@ -572,7 +572,7 @@ vmeintr(arg) { int pil = (int)arg, level, vec; struct intrhand *ih; - int i = 0; + int r, i = 0; level = (pil_to_vme[pil] << 1) | 1; @@ -589,16 +589,23 @@ vmeintr(arg) } for (ih = vmeints[vec]; ih; ih = ih->ih_next) - if (ih->ih_fun) - i += (ih->ih_fun)(ih->ih_arg); + if (ih->ih_fun) { + r = (ih->ih_fun)(ih->ih_arg); + if (r > 0) { + ih->ih_count.ec_count++; + return (r); + } + i |= r; + } return (i); } void -vmeintr_establish(vec, level, ih, ipl_block) +vmeintr_establish(vec, level, ih, ipl_block, name) int vec, level; struct intrhand *ih; int ipl_block; + const char *name; { struct intrhand *ihs; @@ -628,7 +635,7 @@ vmeintr_establish(vec, level, ih, ipl_block) bzero(ihs, sizeof *ihs); ihs->ih_fun = vmeintr; ihs->ih_arg = (void *)level; - intr_establish(level, ihs, ipl_block); + intr_establish(level, ihs, ipl_block, NULL); } #define getpte(va) lda(va, ASI_PTE) diff --git a/sys/arch/sparc/dev/p9000.c b/sys/arch/sparc/dev/p9000.c index e1ef60ce705..9aecf26c0db 100644 --- a/sys/arch/sparc/dev/p9000.c +++ b/sys/arch/sparc/dev/p9000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9000.c,v 1.8 2004/05/12 16:26:11 deraadt Exp $ */ +/* $OpenBSD: p9000.c,v 1.9 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. @@ -257,7 +257,8 @@ p9000attach(struct device *parent, struct device *self, void *args) sc->sc_ih.ih_fun = p9000_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); /* Disable frame buffer interrupts */ P9000_SELECT_SCR(sc); diff --git a/sys/arch/sparc/dev/p9100.c b/sys/arch/sparc/dev/p9100.c index bc5973b40db..43119858420 100644 --- a/sys/arch/sparc/dev/p9100.c +++ b/sys/arch/sparc/dev/p9100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9100.c,v 1.29 2004/05/12 16:26:11 deraadt Exp $ */ +/* $OpenBSD: p9100.c,v 1.30 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. @@ -299,7 +299,8 @@ p9100attach(struct device *parent, struct device *self, void *args) sc->sc_ih.ih_fun = p9100_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); /* Disable frame buffer interrupts */ P9100_SELECT_SCR(sc); diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c index 46335459761..0263de1e758 100644 --- a/sys/arch/sparc/dev/qe.c +++ b/sys/arch/sparc/dev/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.24 2003/06/02 18:40:59 jason Exp $ */ +/* $OpenBSD: qe.c,v 1.25 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1998, 2000 Jason L. Wright. @@ -150,7 +150,7 @@ qeattach(parent, self, aux) sc->sc_ih.ih_fun = qeintr; sc->sc_ih.ih_arg = sc; - intr_establish(pri, &sc->sc_ih, IPL_NET); + intr_establish(pri, &sc->sc_ih, IPL_NET, self->dv_xname); myetheraddr(sc->sc_arpcom.ac_enaddr); diff --git a/sys/arch/sparc/dev/rfx.c b/sys/arch/sparc/dev/rfx.c index accfa20587e..f8baca6bf71 100644 --- a/sys/arch/sparc/dev/rfx.c +++ b/sys/arch/sparc/dev/rfx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfx.c,v 1.4 2004/03/01 22:27:09 miod Exp $ */ +/* $OpenBSD: rfx.c,v 1.5 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. @@ -266,7 +266,8 @@ rfxattach(struct device *parent, struct device *self, void *args) #if 0 /* not yet */ sc->sc_ih.ih_fun = rfx_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); #endif /* diff --git a/sys/arch/sparc/dev/si.c b/sys/arch/sparc/dev/si.c index eb0e13a665a..4474da2ac2f 100644 --- a/sys/arch/sparc/dev/si.c +++ b/sys/arch/sparc/dev/si.c @@ -1,4 +1,4 @@ -/* $OpenBSD: si.c,v 1.19 2003/11/14 19:05:36 miod Exp $ */ +/* $OpenBSD: si.c,v 1.20 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: si.c,v 1.38 1997/08/27 11:24:20 bouyer Exp $ */ /*- @@ -448,7 +448,8 @@ si_attach(parent, self, args) /* * This will be an "sw" controller. */ - intr_establish(ra->ra_intr[0].int_pri, &sc->sc_ih, IPL_BIO); + intr_establish(ra->ra_intr[0].int_pri, &sc->sc_ih, IPL_BIO, + self->dv_xname); break; case BUS_VME16: @@ -456,7 +457,8 @@ si_attach(parent, self, args) * This will be an "si" controller. */ vmeintr_establish(ra->ra_intr[0].int_vec, - ra->ra_intr[0].int_pri, &sc->sc_ih, IPL_BIO); + ra->ra_intr[0].int_pri, &sc->sc_ih, IPL_BIO, + self->dv_xname); sc->sc_adapter_iv_am = VME_SUPV_DATA_24 | (ra->ra_intr[0].int_vec & 0xFF); break; diff --git a/sys/arch/sparc/dev/spif.c b/sys/arch/sparc/dev/spif.c index 9cc917732be..666fbe4551b 100644 --- a/sys/arch/sparc/dev/spif.c +++ b/sys/arch/sparc/dev/spif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spif.c,v 1.18 2003/10/03 16:44:50 miod Exp $ */ +/* $OpenBSD: spif.c,v 1.19 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -207,15 +207,15 @@ spifattach(parent, self, aux) sc->sc_ppcih.ih_fun = spifppcintr; sc->sc_ppcih.ih_arg = sc; - intr_establish(ppcpri, &sc->sc_ppcih, -1); + intr_establish(ppcpri, &sc->sc_ppcih, -1, self->dv_xname); sc->sc_stcih.ih_fun = spifstcintr; sc->sc_stcih.ih_arg = sc; - intr_establish(stcpri, &sc->sc_stcih, -1); + intr_establish(stcpri, &sc->sc_stcih, -1, self->dv_xname); sc->sc_softih.ih_fun = spifsoftintr; sc->sc_softih.ih_arg = sc; - intr_establish(IPL_TTY, &sc->sc_softih, IPL_TTY); + intr_establish(IPL_TTY, &sc->sc_softih, IPL_TTY, self->dv_xname); sbus_establish(&sc->sc_sd, &sc->sc_dev); } diff --git a/sys/arch/sparc/dev/stp_sbus.c b/sys/arch/sparc/dev/stp_sbus.c index 53b2305615b..df993017496 100644 --- a/sys/arch/sparc/dev/stp_sbus.c +++ b/sys/arch/sparc/dev/stp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp_sbus.c,v 1.3 2004/03/02 23:10:14 miod Exp $ */ +/* $OpenBSD: stp_sbus.c,v 1.4 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -175,13 +175,13 @@ stpattach(parent, self, aux) ssc->sc_ih[1].ih_fun = stp4020_statintr; ssc->sc_ih[1].ih_arg = sc; intr_establish(ca->ca_ra.ra_intr[1].int_pri, - &ssc->sc_ih[1], -1); + &ssc->sc_ih[1], -1, self->dv_xname); printf(" pri %d", ca->ca_ra.ra_intr[1].int_pri); ssc->sc_ih[0].ih_fun = stp4020_iointr; ssc->sc_ih[0].ih_arg = sc; intr_establish(ca->ca_ra.ra_intr[0].int_pri, - &ssc->sc_ih[0], -1); + &ssc->sc_ih[0], -1, self->dv_xname); printf(" and %d", ca->ca_ra.ra_intr[0].int_pri); stpattach_common(sc, ((struct sbus_softc *)parent)->sc_clockfreq); diff --git a/sys/arch/sparc/dev/tctrl.c b/sys/arch/sparc/dev/tctrl.c index fbdeddb00db..c0660769386 100644 --- a/sys/arch/sparc/dev/tctrl.c +++ b/sys/arch/sparc/dev/tctrl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tctrl.c,v 1.6 2004/05/10 09:05:52 miod Exp $ */ +/* $OpenBSD: tctrl.c,v 1.7 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: tctrl.c,v 1.2 1999/08/11 00:46:06 matt Exp $ */ /*- @@ -100,8 +100,6 @@ struct tctrl_softc { u_int8_t sc_cmdlen; u_int8_t sc_rspoff; u_int8_t sc_rsplen; - - struct evcnt sc_intrcnt; /* interrupt counting */ }; int tctrl_match(struct device *, void *, void *); @@ -188,8 +186,7 @@ tctrl_attach(parent, self, aux) sc->sc_ih.ih_fun = tctrl_intr; sc->sc_ih.ih_arg = sc; - intr_establish(pri, &sc->sc_ih, -1); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + intr_establish(pri, &sc->sc_ih, -1, self->dv_xname); /* See what the external status is */ diff --git a/sys/arch/sparc/dev/tcx.c b/sys/arch/sparc/dev/tcx.c index e263b8dcf65..d4ab0ccc8e7 100644 --- a/sys/arch/sparc/dev/tcx.c +++ b/sys/arch/sparc/dev/tcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcx.c,v 1.19 2003/06/28 17:05:33 miod Exp $ */ +/* $OpenBSD: tcx.c,v 1.20 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: tcx.c,v 1.8 1997/07/29 09:58:14 fair Exp $ */ /* @@ -273,7 +273,8 @@ tcxattach(parent, self, args) sc->sc_ih.ih_fun = tcx_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); if (isconsole) { fbwscons_console_init(&sc->sc_sunfb, &tcx_stdscreen, -1, diff --git a/sys/arch/sparc/dev/ts102.c b/sys/arch/sparc/dev/ts102.c index 3ffcad50119..34af52583a3 100644 --- a/sys/arch/sparc/dev/ts102.c +++ b/sys/arch/sparc/dev/ts102.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts102.c,v 1.12 2004/05/09 22:02:38 miod Exp $ */ +/* $OpenBSD: ts102.c,v 1.13 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 2003, 2004, Miodrag Vallat. * @@ -241,7 +241,7 @@ tslot_attach(struct device *parent, struct device *self, void *args) sc->sc_ih.ih_fun = tslot_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ra->ra_intr[0].int_pri, &sc->sc_ih, -1); + intr_establish(ra->ra_intr[0].int_pri, &sc->sc_ih, -1, self->dv_xname); printf(" pri %d", ra->ra_intr[0].int_pri); sbus_establish(&sc->sc_sd, self); diff --git a/sys/arch/sparc/dev/vigra.c b/sys/arch/sparc/dev/vigra.c index b1364e9a1b8..c346c6aac98 100644 --- a/sys/arch/sparc/dev/vigra.c +++ b/sys/arch/sparc/dev/vigra.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vigra.c,v 1.9 2003/06/28 17:05:33 miod Exp $ */ +/* $OpenBSD: vigra.c,v 1.10 2004/09/29 07:35:11 miod Exp $ */ /* * Copyright (c) 2002, 2003, Miodrag Vallat. @@ -293,7 +293,8 @@ vigraattach(struct device *parent, struct device *self, void *args) sc->sc_ih.ih_fun = vigra_intr; sc->sc_ih.ih_arg = sc; - intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB); + intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, + self->dv_xname); /* enable video */ vigra_burner(sc, 1, 0); diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c index cf175036bd7..426bb623fbf 100644 --- a/sys/arch/sparc/dev/xd.c +++ b/sys/arch/sparc/dev/xd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xd.c,v 1.28 2004/02/15 02:45:46 tedu Exp $ */ +/* $OpenBSD: xd.c,v 1.29 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */ /* @@ -488,9 +488,8 @@ xdcattach(parent, self, aux) xdc->sc_ih.ih_fun = xdcintr; xdc->sc_ih.ih_arg = xdc; vmeintr_establish(ca->ca_ra.ra_intr[0].int_vec, - ca->ca_ra.ra_intr[0].int_pri, &xdc->sc_ih, IPL_BIO); - evcnt_attach(&xdc->sc_dev, "intr", &xdc->sc_intrcnt); - + ca->ca_ra.ra_intr[0].int_pri, &xdc->sc_ih, IPL_BIO, + self->dv_xname); /* now we must look for disks using autoconfig */ xa.dvmabuf = (char *)dvma_malloc(XDFM_BPS, &xa.buf, M_NOWAIT); @@ -1141,10 +1140,6 @@ xdcintr(v) { struct xdc_softc *xdcsc = v; - /* kick the event counter */ - - xdcsc->sc_intrcnt.ev_count++; - /* remove as many done IOPBs as possible */ xdc_remove_iorq(xdcsc); diff --git a/sys/arch/sparc/dev/xdvar.h b/sys/arch/sparc/dev/xdvar.h index c1396427cab..eb98bf58953 100644 --- a/sys/arch/sparc/dev/xdvar.h +++ b/sys/arch/sparc/dev/xdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xdvar.h,v 1.5 2001/03/24 10:07:21 ho Exp $ */ +/* $OpenBSD: xdvar.h,v 1.6 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: xdvar.h,v 1.5 1996/03/31 22:38:56 pk Exp $ */ /* @@ -138,7 +138,6 @@ struct xd_softc { struct xdc_softc { struct device sc_dev; /* device struct, reqd by autoconf */ struct intrhand sc_ih; /* interrupt info */ - struct evcnt sc_intrcnt; /* event counter (for vmstat -i) */ struct xdc *xdc; /* vaddr of vme registers */ diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c index f651417287a..46791981c0e 100644 --- a/sys/arch/sparc/dev/xy.c +++ b/sys/arch/sparc/dev/xy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xy.c,v 1.24 2004/02/15 02:45:46 tedu Exp $ */ +/* $OpenBSD: xy.c,v 1.25 2004/09/29 07:35:11 miod Exp $ */ /* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */ /* @@ -431,9 +431,8 @@ xycattach(parent, self, aux) xyc->sc_ih.ih_fun = xycintr; xyc->sc_ih.ih_arg = xyc; vmeintr_establish(ca->ca_ra.ra_intr[0].int_vec, - ca->ca_ra.ra_intr[0].int_pri, &xyc->sc_ih, IPL_BIO); - evcnt_attach(&xyc->sc_dev, "intr", &xyc->sc_intrcnt); - + ca->ca_ra.ra_intr[0].int_pri, &xyc->sc_ih, IPL_BIO, + self->dv_xname); /* now we must look for disks using autoconfig */ xa.dvmabuf = (char *)dvma_malloc(XYFM_BPS, &xa.buf, M_NOWAIT); @@ -1079,10 +1078,6 @@ xycintr(v) { struct xyc_softc *xycsc = v; - /* kick the event counter */ - - xycsc->sc_intrcnt.ev_count++; - /* remove as many done IOPBs as possible */ xyc_remove_iorq(xycsc); diff --git a/sys/arch/sparc/dev/xyvar.h b/sys/arch/sparc/dev/xyvar.h index ee61acfaca7..eec8eb23c8e 100644 --- a/sys/arch/sparc/dev/xyvar.h +++ b/sys/arch/sparc/dev/xyvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xyvar.h,v 1.5 2001/03/24 10:07:22 ho Exp $ */ +/* $OpenBSD: xyvar.h,v 1.6 2004/09/29 07:35:12 miod Exp $ */ /* $NetBSD: xyvar.h,v 1.4 1996/03/31 22:39:04 pk Exp $ */ /* @@ -141,7 +141,6 @@ struct xy_softc { struct xyc_softc { struct device sc_dev; /* device struct, reqd by autoconf */ struct intrhand sc_ih; /* interrupt info */ - struct evcnt sc_intrcnt; /* event counter (for vmstat -i) */ struct xyc *xyc; /* vaddr of vme registers */ diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index bef5714a649..259e6fb8ce4 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.39 2003/01/22 18:59:36 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.40 2004/09/29 07:35:12 miod Exp $ */ /* $NetBSD: zs.c,v 1.50 1997/10/18 00:00:40 gwr Exp $ */ /*- @@ -344,11 +344,10 @@ zs_attach(parent, self, aux) if (!didintr) { didintr = 1; prevpri = pri; - intr_establish(pri, &levelhard, IPL_ZS); - intr_establish(IPL_TTY, &levelsoft, IPL_TTY); + intr_establish(pri, &levelhard, IPL_ZS, self->dv_xname); + intr_establish(IPL_TTY, &levelsoft, IPL_TTY, self->dv_xname); } else if (pri != prevpri) panic("broken zs interrupt scheme"); - evcnt_attach(&zsc->zsc_dev, "intr", &zsc->zsc_intrcnt); /* * Set the master interrupt enable and interrupt vector. @@ -414,7 +413,6 @@ zshard(arg) /* Count up the interrupts. */ if (rr3) { rval |= rr3; - zsc->zsc_intrcnt.ev_count++; } softreq |= zsc->zsc_cs[0].cs_softreq; softreq |= zsc->zsc_cs[1].cs_softreq; diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h index 872dce25b8f..5227cce8606 100644 --- a/sys/arch/sparc/include/cpu.h +++ b/sys/arch/sparc/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.22 2004/08/06 22:39:14 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.23 2004/09/29 07:35:13 miod Exp $ */ /* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */ /* @@ -66,6 +66,7 @@ * Exported definitions unique to SPARC cpu support. */ +#include <sys/evcount.h> #include <machine/psl.h> #include <sparc/sparc/intreg.h> @@ -159,11 +160,13 @@ struct intrhand { int (*ih_fun)(void *); void *ih_arg; int ih_ipl; + int ih_vec; /* human readable ipl for vmstat */ + struct evcount ih_count; struct intrhand *ih_next; }; extern struct intrhand *intrhand[15]; -void intr_establish(int level, struct intrhand *, int); -void vmeintr_establish(int vec, int level, struct intrhand *, int); +void intr_establish(int level, struct intrhand *, int, const char *); +void vmeintr_establish(int vec, int level, struct intrhand *, int, const char *); /* * intr_fasttrap() is a lot like intr_establish, but is used for ``fast'' @@ -182,6 +185,7 @@ int isbad(struct dkbad *bt, int, int, int); /* machdep.c */ int ldcontrolb(caddr_t); void dumpconf(void); +void intr_init(void); caddr_t reserve_dumppages(caddr_t); /* clock.c */ struct timeval; diff --git a/sys/arch/sparc/include/types.h b/sys/arch/sparc/include/types.h index affe9230a4f..49aed91e298 100644 --- a/sys/arch/sparc/include/types.h +++ b/sys/arch/sparc/include/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.14 2003/06/02 23:27:54 millert Exp $ */ +/* $OpenBSD: types.h,v 1.15 2004/09/29 07:35:13 miod Exp $ */ /* $NetBSD: types.h,v 1.11 1996/12/10 23:19:38 pk Exp $ */ /* @@ -77,5 +77,6 @@ typedef unsigned long long uint64_t; typedef int32_t register_t; +#define __HAVE_EVCOUNT #endif /* _MACHTYPES_H_ */ diff --git a/sys/arch/sparc/include/z8530var.h b/sys/arch/sparc/include/z8530var.h index 1568cf957c3..387c49a5e40 100644 --- a/sys/arch/sparc/include/z8530var.h +++ b/sys/arch/sparc/include/z8530var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530var.h,v 1.2 2003/06/02 23:27:55 millert Exp $ */ +/* $OpenBSD: z8530var.h,v 1.3 2004/09/29 07:35:13 miod Exp $ */ /* $NetBSD: z8530var.h,v 1.1 1997/10/18 00:01:30 gwr Exp $ */ /* @@ -46,8 +46,6 @@ struct zsc_softc { struct device zsc_dev; /* required first: base device */ struct zs_chanstate zsc_cs[2]; /* channel A and B soft state */ - /* Machine-dependent part follows... */ - struct evcnt zsc_intrcnt; /* count interrupts */ }; /* diff --git a/sys/arch/sparc/sparc/amd7930intr.s b/sys/arch/sparc/sparc/amd7930intr.s index b3ed77fb088..9f72e0151dd 100644 --- a/sys/arch/sparc/sparc/amd7930intr.s +++ b/sys/arch/sparc/sparc/amd7930intr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: amd7930intr.s,v 1.8 2003/06/02 23:27:55 millert Exp $ */ +/* $OpenBSD: amd7930intr.s,v 1.9 2004/09/29 07:35:13 miod Exp $ */ /* $NetBSD: amd7930intr.s,v 1.10 1997/03/11 01:03:07 pk Exp $ */ /* * Copyright (c) 1995 Rolf Grossmann. @@ -104,9 +104,10 @@ _C_LABEL(amd7930_trap): sethi %hi(_C_LABEL(auiop)), %l7 ld [%l7 + %lo(_C_LABEL(auiop))], %l7 - ld [%l7 + AU_EVCNT], %l6 - inc %l6 - st %l6, [%l7 + AU_EVCNT] + ldd [%l7 + AU_COUNT], %l2 + inccc %l3 + addx %l2, 0, %l2 + std %l2, [%l7 + AU_COUNT] ld [%l7 + AU_AMD], R_amd ldub [R_amd + AMD_IR], %g0 ! clear interrupt diff --git a/sys/arch/sparc/sparc/bsd_fdintr.s b/sys/arch/sparc/sparc/bsd_fdintr.s index 547c72120da..4e75c341eea 100644 --- a/sys/arch/sparc/sparc/bsd_fdintr.s +++ b/sys/arch/sparc/sparc/bsd_fdintr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd_fdintr.s,v 1.10 2004/09/22 22:12:59 miod Exp $ */ +/* $OpenBSD: bsd_fdintr.s,v 1.11 2004/09/29 07:35:13 miod Exp $ */ /* $NetBSD: bsd_fdintr.s,v 1.11 1997/04/07 21:00:36 pk Exp $ */ /* @@ -179,9 +179,10 @@ _C_LABEL(fdchwintr): ld [%l7 + %lo(_C_LABEL(fdciop))], R_fdc ! tally interrupt - ld [R_fdc + FDC_EVCNT], %l6 - inc %l6 - st %l6, [R_fdc + FDC_EVCNT] + ldd [R_fdc + FDC_COUNT], %l4 + inccc %l4 + addx %l4, 0, %l4 + std %l4, [R_fdc + FDC_COUNT] ! load chips register addresses ld [R_fdc + FDC_REG_MSR], R_msr ! get chip MSR reg addr diff --git a/sys/arch/sparc/sparc/genassym.cf b/sys/arch/sparc/sparc/genassym.cf index 7fc9e86d9a0..b3e7b4c3013 100644 --- a/sys/arch/sparc/sparc/genassym.cf +++ b/sys/arch/sparc/sparc/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.16 2004/09/22 22:12:59 miod Exp $ +# $OpenBSD: genassym.cf,v 1.17 2004/09/29 07:35:13 miod Exp $ # $NetBSD: genassym.cf,v 1.2 1997/06/28 19:59:04 pk Exp $ # @@ -159,6 +159,7 @@ member ih_fun member ih_arg member ih_ipl member ih_next +member IH_COUNT ih_count.ec_count ifdef notyet # ZSCC interrupt fields @@ -181,7 +182,7 @@ member au_rdata member au_rend member au_pdata member au_pend -define AU_EVCNT offsetof(struct auio, au_intrcnt.ev_count) +member AU_COUNT au_ih.ih_count.ec_count struct amd7930 AMD_ member ir @@ -214,4 +215,4 @@ member FDC_STATUS fdcio_status member FDC_NSTAT fdcio_nstat member FDC_DATA fdcio_data member FDC_TC fdcio_tc -member FDC_EVCNT fdcio_intrcnt.ev_count +member FDC_COUNT fdcio_ih.ih_count.ec_count diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c index 27807c4559c..e544aa33353 100644 --- a/sys/arch/sparc/sparc/intr.c +++ b/sys/arch/sparc/sparc/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.26 2003/11/06 21:09:35 mickey Exp $ */ +/* $OpenBSD: intr.c,v 1.27 2004/09/29 07:35:14 miod Exp $ */ /* $NetBSD: intr.c,v 1.20 1997/07/29 09:42:03 fair Exp $ */ /* @@ -206,6 +206,20 @@ nmi_hard() static struct intrhand level01 = { soft01intr, NULL, (IPL_SOFTINT << 8) }; +void +intr_init() +{ + level01.ih_vec = level01.ih_ipl >> 8; + evcount_attach(&level01.ih_count, "softintr", &level01.ih_vec, + &evcount_intr); + level10.ih_vec = level10.ih_ipl >> 8; + evcount_attach(&level10.ih_count, "clock", &level10.ih_vec, + &evcount_intr); + level14.ih_vec = level14.ih_ipl >> 8; + evcount_attach(&level14.ih_count, "prof", &level14.ih_vec, + &evcount_intr); +} + /* * Level 15 interrupts are special, and not vectored here. * Only `prewired' interrupts appear here; boot-time configured devices @@ -240,10 +254,11 @@ extern int sparc_interrupt44c[]; * This is not possible if it has been taken away as a fast vector. */ void -intr_establish(level, ih, ipl_block) +intr_establish(level, ih, ipl_block, name) int level; struct intrhand *ih; int ipl_block; + const char *name; { struct intrhand **p, *q; #ifdef DIAGNOSTIC @@ -273,7 +288,10 @@ intr_establish(level, ih, ipl_block) * We store the ipl pre-shifted so that we can avoid one instruction * in the interrupt handlers. */ + ih->ih_vec = ipl_block; ih->ih_ipl = (ipl_block << 8); + if (name != NULL) + evcount_attach(&ih->ih_count, name, &ih->ih_vec, &evcount_intr); s = splhigh(); if (fastvec & (1 << level)) diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s index 026c076cde2..c985c1a2c03 100644 --- a/sys/arch/sparc/sparc/locore.s +++ b/sys/arch/sparc/sparc/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.59 2004/06/13 21:49:20 niklas Exp $ */ +/* $OpenBSD: locore.s,v 1.60 2004/09/29 07:35:14 miod Exp $ */ /* $NetBSD: locore.s,v 1.73 1997/09/13 20:36:48 pk Exp $ */ /* @@ -2374,7 +2374,13 @@ softintr_common: bz,a 2f add %sp, CCFSZ, %o0 2: jmpl %o1, %o7 ! (void)(*ih->ih_fun)(...) - ld [%l4 + IH_NEXT], %l4 ! and ih = ih->ih_next + nop + mov %l4, %l3 + ldd [%l3 + IH_COUNT], %l4 + inccc %l5 + addx %l4, 0, %l4 + std %l4, [%l3 + IH_COUNT] + ld [%l3 + IH_NEXT], %l4 ! and ih = ih->ih_next 3: tst %l4 ! while ih != NULL bnz 1b nop @@ -2449,26 +2455,34 @@ _C_LABEL(sparc_interrupt_common): bz,a 2f add %sp, CCFSZ, %o0 2: jmpl %o1, %o7 ! handled = (*ih->ih_fun)(...) - ld [%l4 + IH_NEXT], %l4 ! and ih = ih->ih_next + nop cmp %o0, 1 bge 4f ! if (handled >= 1) break or %o0, %l5, %l5 ! and %l5 |= handled + ld [%l4 + IH_NEXT], %l4 ! and ih = ih->ih_next 3: tst %l4 bnz 1b ! while (ih) nop tst %l5 ! if (handled) break - bnz 4f + bnz 5f nop call _C_LABEL(strayintr) ! strayintr(&intrframe) add %sp, CCFSZ, %o0 - /* all done: restore registers and go return */ -4: mov %l7, %g1 +5: /* all done: restore registers and go return */ + mov %l7, %g1 wr %l6, 0, %y ldd [%sp + CCFSZ + 24], %g2 ldd [%sp + CCFSZ + 32], %g4 ldd [%sp + CCFSZ + 40], %g6 b return_from_trap wr %l0, 0, %psr +4: + mov %l4, %l3 + ldd [%l3 + IH_COUNT], %l4 + inccc %l5 + addx %l4, 0, %l4 + b 5b + std %l4, [%l3 + IH_COUNT] #ifdef notyet /* diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 10a475506e5..1a0da7217a7 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.101 2004/07/06 21:05:36 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.102 2004/09/29 07:35:14 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -283,6 +283,9 @@ cpu_startup() * Set up buffers, so they can be used to read disk labels. */ bufinit(); + + /* Early interrupt handlers initialization */ + intr_init(); } /* |