summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-08-16 02:48:41 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-08-16 02:48:41 +0000
commit3725fbb09bcf70557774be9e6726ea2cbdc9cf7d (patch)
tree2d077254ad69786581e2183286bca389392d8bf1
parentb446ebd37f35118779c1684f7f8824dd86fcb2c4 (diff)
evcnt count the interrupts, also optimize diagnostic printing
-rw-r--r--sys/arch/hppa/dev/cpu.c4
-rw-r--r--sys/arch/hppa/gsc/com_gsc.c5
-rw-r--r--sys/arch/hppa/gsc/gscbus.c17
-rw-r--r--sys/arch/hppa/gsc/gscbusvar.h4
-rw-r--r--sys/arch/hppa/gsc/if_ie_gsc.c5
-rw-r--r--sys/arch/hppa/gsc/lpt_gsc.c5
-rw-r--r--sys/arch/hppa/hppa/trap.c36
-rw-r--r--sys/arch/hppa/include/autoconf.h4
8 files changed, 42 insertions, 38 deletions
diff --git a/sys/arch/hppa/dev/cpu.c b/sys/arch/hppa/dev/cpu.c
index ef21842ccbf..3377dc14afc 100644
--- a/sys/arch/hppa/dev/cpu.c
+++ b/sys/arch/hppa/dev/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.4 1999/08/14 03:58:55 mickey Exp $ */
+/* $OpenBSD: cpu.c,v 1.5 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998,1999 Michael Shalayeff
@@ -163,7 +163,7 @@ cpuattach(parent, self, aux)
if (ca->ca_irq == 31) {
sc->sc_ih = cpu_intr_establish(IPL_CLOCK, ca->ca_irq,
clock_intr, NULL /*trapframe*/,
- sc->sc_dev.dv_xname);
+ &sc->sc_dev);
} else {
printf ("%s: bad irq number %d\n", sc->sc_dev.dv_xname,
ca->ca_irq);
diff --git a/sys/arch/hppa/gsc/com_gsc.c b/sys/arch/hppa/gsc/com_gsc.c
index 2fc94dffb35..743f1f8f334 100644
--- a/sys/arch/hppa/gsc/com_gsc.c
+++ b/sys/arch/hppa/gsc/com_gsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_gsc.c,v 1.4 1999/07/08 18:24:06 mickey Exp $ */
+/* $OpenBSD: com_gsc.c,v 1.5 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -95,7 +95,6 @@ com_gsc_attach(parent, self, aux)
com_attach_subr(sc);
sc->sc_ih = gsc_intr_establish((struct gsc_softc *)parent, IPL_TTY,
- ga->ga_irq, comintr, sc,
- sc->sc_dev.dv_xname);
+ ga->ga_irq, comintr, sc, &sc->sc_dev);
}
diff --git a/sys/arch/hppa/gsc/gscbus.c b/sys/arch/hppa/gsc/gscbus.c
index 78495e92430..5affc2e37f3 100644
--- a/sys/arch/hppa/gsc/gscbus.c
+++ b/sys/arch/hppa/gsc/gscbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gscbus.c,v 1.6 1999/08/14 04:22:51 mickey Exp $ */
+/* $OpenBSD: gscbus.c,v 1.7 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -143,7 +143,7 @@ gscattach(parent, self, aux)
printf ("\n");
sc->sc_ih = cpu_intr_establish(IPL_IO, ga->ga_irq,
- gsc_intr, sc, sc->sc_dev.dv_xname);
+ gsc_intr, sc, &sc->sc_dev);
/* DMA guts */
sc->sc_dmatag._cookie = sc;
sc->sc_dmatag._dmamap_create = gsc_dmamap_create;
@@ -174,13 +174,13 @@ gscprint(aux, pnp)
void *
-gsc_intr_establish(sc, pri, irq, handler, arg, name)
+gsc_intr_establish(sc, pri, irq, handler, arg, dv)
struct gsc_softc *sc;
int pri;
int irq;
int (*handler) __P((void *v));
void *arg;
- const char *name;
+ struct device *dv;
{
register struct gscbus_intr *iv;
register u_int32_t mask;
@@ -198,7 +198,7 @@ gsc_intr_establish(sc, pri, irq, handler, arg, name)
iv->pri = pri;
iv->handler = handler;
iv->arg = arg;
- evcnt_attach(&sc->sc_dev, name, &iv->evcnt);
+ evcnt_attach(dv, dv->dv_xname, &iv->evcnt);
(sc->sc_ic->gsc_intr_establish)(sc->sc_ic->gsc_dv, mask);
#ifdef GSCDEBUG
printf("gsc_intr_establish: mask=0x%08x irq=%d iv=%p\n", mask, irq, iv);
@@ -249,9 +249,14 @@ gsc_intr(v)
#ifdef GSCDEBUG_INTR
printf("gsc_intr: calling %p for irq %d\n", v, i);
#endif
+ iv->evcnt.ev_count++;
s = splx(iv->pri);
- ret += (iv->handler)(iv->arg);
+ ret = (iv->handler)(iv->arg);
splx(s);
+ if (!ret)
+ printf ("%s: can't handle interrupt\n",
+ iv->evcnt.ev_name);
+ ret++;
} else
printf("%s: stray interrupt %d\n",
sc->sc_dev.dv_xname, i);
diff --git a/sys/arch/hppa/gsc/gscbusvar.h b/sys/arch/hppa/gsc/gscbusvar.h
index cf210b7fa75..ece10350b53 100644
--- a/sys/arch/hppa/gsc/gscbusvar.h
+++ b/sys/arch/hppa/gsc/gscbusvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gscbusvar.h,v 1.2 1999/02/25 21:07:49 mickey Exp $ */
+/* $OpenBSD: gscbusvar.h,v 1.3 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -75,7 +75,7 @@ struct gsc_softc {
void *gsc_intr_establish __P((struct gsc_softc *sc, int pri, int irq,
int (*handler) __P((void *v)), void *arg,
- const char *name));
+ struct device *name));
void gsc_intr_disestablish __P((struct gsc_softc *sc, void *v));
int gsc_intr __P((void *));
diff --git a/sys/arch/hppa/gsc/if_ie_gsc.c b/sys/arch/hppa/gsc/if_ie_gsc.c
index 49690855a93..4469b08edb3 100644
--- a/sys/arch/hppa/gsc/if_ie_gsc.c
+++ b/sys/arch/hppa/gsc/if_ie_gsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie_gsc.c,v 1.2 1999/08/14 04:08:06 mickey Exp $ */
+/* $OpenBSD: if_ie_gsc.c,v 1.3 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -373,8 +373,7 @@ ie_gsc_attach(parent, self, aux)
ie_gsc_media, IE_NMEDIA, ie_gsc_media[0]);
sc->sc_ih = gsc_intr_establish((struct gsc_softc *)parent, IPL_NET,
- ga->ga_irq, i82596_intr, sc,
- sc->sc_dev.dv_xname);
+ ga->ga_irq, i82596_intr,sc,&sc->sc_dev);
#ifdef PMAPDEBUG
pmapdebug = opmapdebug;
#endif
diff --git a/sys/arch/hppa/gsc/lpt_gsc.c b/sys/arch/hppa/gsc/lpt_gsc.c
index 64777ea66d6..ecb52179d2d 100644
--- a/sys/arch/hppa/gsc/lpt_gsc.c
+++ b/sys/arch/hppa/gsc/lpt_gsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpt_gsc.c,v 1.4 1999/08/14 04:39:12 mickey Exp $ */
+/* $OpenBSD: lpt_gsc.c,v 1.5 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -174,6 +174,5 @@ lpt_gsc_attach(parent, self, aux)
bus_space_write_1(sc->sc_iot, sc->sc_ioh, lpt_control, LPC_NINIT);
sc->sc_ih = gsc_intr_establish((struct gsc_softc *)parent, IPL_TTY,
- ga->ga_irq, lptintr, sc,
- sc->sc_dev.dv_xname);
+ ga->ga_irq, lptintr, sc, &sc->sc_dev);
}
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index a4fc9a4a571..9c3546e1c6a 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.7 1999/08/14 03:06:55 mickey Exp $ */
+/* $OpenBSD: trap.c,v 1.8 1999/08/16 02:48:39 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -486,29 +486,29 @@ syscall(frame, args)
/* all the interrupts, minus cpu clock, which is the last */
struct cpu_intr_vector {
- const char *name;
+ struct evcnt evcnt;
int pri;
int (*handler) __P((void *));
void *arg;
} cpu_intr_vectors[CPU_NINTS];
void *
-cpu_intr_establish(pri, irq, handler, arg, name)
+cpu_intr_establish(pri, irq, handler, arg, dv)
int pri, irq;
int (*handler) __P((void *));
void *arg;
- const char *name;
+ struct device *dv;
{
- register struct cpu_intr_vector *p;
+ register struct cpu_intr_vector *iv;
if (0 <= irq && irq < CPU_NINTS && cpu_intr_vectors[irq].handler)
return NULL;
- p = &cpu_intr_vectors[irq];
- p->name = name;
- p->pri = pri;
- p->handler = handler;
- p->arg = arg;
+ iv = &cpu_intr_vectors[irq];
+ iv->pri = pri;
+ iv->handler = handler;
+ iv->arg = arg;
+ evcnt_attach(dv, dv->dv_xname, iv->evcnt);
return p;
}
@@ -518,7 +518,7 @@ cpu_intr(frame)
struct trapframe *frame;
{
u_int32_t eirr;
- register struct cpu_intr_vector *p;
+ register struct cpu_intr_vector *iv;
register int bit;
do {
@@ -533,17 +533,19 @@ cpu_intr(frame)
if (bit != 31)
printf ("cpu_intr: 0x%08x\n", (1 << bit));
#endif
- p = &cpu_intr_vectors[bit];
- if (p->handler) {
- register int s = splx(p->pri);
+ iv = &cpu_intr_vectors[bit];
+ if (iv->handler) {
+ register int s = splx(iv->pri);
+
+ iv->evcnt.ev_count++;
/* no arg means pass the frame */
- if (!(p->handler)(p->arg? p->arg:frame))
+ if (!(iv->handler)(iv->arg? iv->arg:frame))
#ifdef INTRDEBUG1
panic ("%s: can't handle interrupt",
- p->name);
+ iv->name);
#else
printf ("%s: can't handle interrupt\n",
- p->name);
+ iv->name);
#endif
splx(s);
} else {
diff --git a/sys/arch/hppa/include/autoconf.h b/sys/arch/hppa/include/autoconf.h
index 8eff170ca82..522541e82b7 100644
--- a/sys/arch/hppa/include/autoconf.h
+++ b/sys/arch/hppa/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.8 1999/08/14 03:22:07 mickey Exp $ */
+/* $OpenBSD: autoconf.h,v 1.9 1999/08/16 02:48:40 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -63,7 +63,7 @@ void pdc_scanbus __P((struct device *, struct confargs *, int bus, int));
int mbprint __P((void *, const char *));
int mbsubmatch __P((struct device *, void *, void *));
void *cpu_intr_establish __P((int pri, int, int (*handler) __P((void *)),
- void *arg, const char *name));
+ void *arg, struct device *name));
int clock_intr __P((void *));
void configure __P((void));