meaningful names associated to the interrupt counters.
-/* $OpenBSD: cfb.c,v 1.19 2007/11/06 18:20:05 miod Exp $ */
+/* $OpenBSD: cfb.c,v 1.20 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: cfb.c,v 1.7 1996/12/05 01:39:39 cgd Exp $ */
/*
sc->sc_dc->dc_depth);
/* Establish an interrupt handler, and clear any pending interrupts */
- tc_intr_establish(parent, ta->ta_cookie, IPL_TTY, cfbintr, sc);
+ tc_intr_establish(parent, ta->ta_cookie, IPL_TTY, cfbintr, sc,
+ self->dv_xname);
*(volatile u_int32_t *)(sc->sc_dc->dc_vaddr + CFB_IREQCTRL_OFFSET) = 0;
/* initialize the raster */
-/* $OpenBSD: ioasic.c,v 1.14 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: ioasic.c,v 1.15 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: ioasic.c,v 1.34 2000/07/18 06:10:06 thorpej Exp $ */
/*-
int (*iai_func)(void *);
void *iai_arg;
struct evcount iai_count;
- char iai_name[16];
} ioasicintrs[IOASIC_NCOOKIES];
tc_addr_t ioasic_base; /* XXX XXX XXX */
for (i = 0; i < IOASIC_NCOOKIES; i++) {
ioasicintrs[i].iai_func = ioasic_intrnull;
ioasicintrs[i].iai_arg = (void *)i;
- snprintf(ioasicintrs[i].iai_name,
- sizeof ioasicintrs[i].iai_name, "ioasic slot %u", i);
- evcount_attach(&ioasicintrs[i].iai_count,
- ioasicintrs[i].iai_name, NULL, &evcount_intr);
}
- tc_intr_establish(parent, ta->ta_cookie, IPL_NONE, ioasic_intr, sc);
+ tc_intr_establish(parent, ta->ta_cookie, IPL_NONE, ioasic_intr, sc,
+ NULL);
/*
* Try to configure each device.
}
void
-ioasic_intr_establish(ioa, cookie, level, func, arg)
+ioasic_intr_establish(ioa, cookie, level, func, arg, name)
struct device *ioa;
void *cookie, *arg;
int level;
int (*func)(void *);
+ const char *name;
{
struct ioasic_softc *sc = (void *)ioasic_cd.cd_devs[0];
u_long dev, i, imsk;
ioasicintrs[dev].iai_func = func;
ioasicintrs[dev].iai_arg = arg;
+ evcount_attach(&ioasicintrs[dev].iai_count, name, NULL, &evcount_intr);
/* Enable interrupts for the device. */
for (i = 0; i < ioasic_ndevs; i++)
ioasicintrs[dev].iai_func = ioasic_intrnull;
ioasicintrs[dev].iai_arg = (void *)dev;
+ evcount_detach(&ioasicintrs[dev].iai_count);
}
int
-/* $OpenBSD: scc.c,v 1.21 2007/11/06 18:20:05 miod Exp $ */
+/* $OpenBSD: scc.c,v 1.22 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: scc.c,v 1.58 2002/03/17 19:40:27 atatat Exp $ */
/*
/* Register the interrupt handler. */
ioasic_intr_establish(parent, d->iada_cookie, IPL_TTY,
- sccintr, (void *)sc);
+ sccintr, (void *)sc, self->dv_xname);
/*
* For a remote console, wait a while for previous output to
-/* $OpenBSD: tc_3000_300.c,v 1.13 2007/11/06 18:20:05 miod Exp $ */
+/* $OpenBSD: tc_3000_300.c,v 1.14 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: tc_3000_300.c,v 1.26 2001/07/27 00:25:21 thorpej Exp $ */
/*
int (*tci_func)(void *);
void *tci_arg;
struct evcount tci_count;
- char tci_name[12];
} tc_3000_300_intr[TC_3000_300_NCOOKIES];
void
for (i = 0; i < TC_3000_300_NCOOKIES; i++) {
tc_3000_300_intr[i].tci_func = tc_3000_300_intrnull;
tc_3000_300_intr[i].tci_arg = (void *)i;
- snprintf(tc_3000_300_intr[i].tci_name,
- sizeof tc_3000_300_intr[i].tci_name, "tc slot %u", i);
- evcount_attach(&tc_3000_300_intr[i].tci_count,
- tc_3000_300_intr[i].tci_name, NULL, &evcount_intr);
}
}
void
-tc_3000_300_intr_establish(tcadev, cookie, level, func, arg)
+tc_3000_300_intr_establish(tcadev, cookie, level, func, arg, name)
struct device *tcadev;
void *cookie, *arg;
int level;
int (*func)(void *);
+ const char *name;
{
volatile u_int32_t *imskp;
u_long dev = (u_long)cookie;
tc_3000_300_intr[dev].tci_func = func;
tc_3000_300_intr[dev].tci_arg = arg;
+ if (name != NULL)
+ evcount_attach(&tc_3000_300_intr[dev].tci_count,
+ name, NULL, &evcount_intr);
imskp = (volatile u_int32_t *)(DEC_3000_300_IOASIC_ADDR + IOASIC_IMSK);
switch (dev) {
tc_3000_300_intr[dev].tci_func = tc_3000_300_intrnull;
tc_3000_300_intr[dev].tci_arg = (void *)dev;
+ if (tc_3000_300_intr[dev].tci_count.ec_parent != NULL)
+ evcount_detach(&tc_3000_300_intr[dev].tci_count);
}
int
-/* $OpenBSD: tc_3000_500.c,v 1.14 2007/11/06 18:20:05 miod Exp $ */
+/* $OpenBSD: tc_3000_500.c,v 1.15 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: tc_3000_500.c,v 1.24 2001/07/27 00:25:21 thorpej Exp $ */
/*
extern int sfb_cnattach(tc_addr_t);
#endif
-void tc_3000_500_intr_setup(void);
-void tc_3000_500_intr_establish(struct device *, void *,
- int, int (*)(void *), void *);
-void tc_3000_500_intr_disestablish(struct device *, void *);
-void tc_3000_500_iointr(void *, unsigned long);
-
int tc_3000_500_intrnull(void *);
int tc_3000_500_fb_cnattach(u_int64_t);
int (*tci_func)(void *);
void *tci_arg;
struct evcount tci_count;
- char tci_name[12];
} tc_3000_500_intr[TC_3000_500_NCOOKIES];
u_int32_t tc_3000_500_imask; /* intrs we want to ignore; mirrors IMR. */
for (i = 0; i < TC_3000_500_NCOOKIES; i++) {
tc_3000_500_intr[i].tci_func = tc_3000_500_intrnull;
tc_3000_500_intr[i].tci_arg = (void *)i;
- snprintf(tc_3000_500_intr[i].tci_name,
- sizeof tc_3000_500_intr[i].tci_name, "tc slot %u", i);
- evcount_attach(&tc_3000_500_intr[i].tci_count,
- tc_3000_500_intr[i].tci_name, NULL, &evcount_intr);
}
}
void
-tc_3000_500_intr_establish(tcadev, cookie, level, func, arg)
+tc_3000_500_intr_establish(tcadev, cookie, level, func, arg, name)
struct device *tcadev;
void *cookie, *arg;
int level;
int (*func)(void *);
+ const char *name;
{
u_long dev = (u_long)cookie;
tc_3000_500_intr[dev].tci_func = func;
tc_3000_500_intr[dev].tci_arg = arg;
+ if (name != NULL)
+ evcount_attach(&tc_3000_500_intr[dev].tci_count,
+ name, NULL, &evcount_intr);
tc_3000_500_imask &= ~tc_3000_500_intrbits[dev];
*(volatile u_int32_t *)TC_3000_500_IMR_WRITE = tc_3000_500_imask;
tc_3000_500_intr[dev].tci_func = tc_3000_500_intrnull;
tc_3000_500_intr[dev].tci_arg = (void *)dev;
+ if (tc_3000_500_intr[dev].tci_count.ec_parent != NULL)
+ evcount_detach(&tc_3000_500_intr[dev].tci_count);
}
int
-/* $OpenBSD: tc_conf.h,v 1.9 2007/11/06 18:20:05 miod Exp $ */
+/* $OpenBSD: tc_conf.h,v 1.10 2008/08/09 16:42:29 miod Exp $ */
/* $NetBSD: tc_conf.h,v 1.10 2000/06/04 19:14:29 cgd Exp $ */
/*
extern void tc_3000_500_iointr(void *, unsigned long);
extern void tc_3000_500_intr_establish(struct device *, void *,
- int, int (*)(void *), void *);
+ int, int (*)(void *), void *, const char *);
extern void tc_3000_500_intr_disestablish(struct device *, void *);
extern int tc_3000_500_nslots;
extern void tc_3000_300_iointr(void *, unsigned long);
extern void tc_3000_300_intr_establish(struct device *, void *,
- int, int (*)(void *), void *);
+ int, int (*)(void *), void *, const char *);
extern void tc_3000_300_intr_disestablish(struct device *, void *);
extern int tc_3000_300_nslots;
-/* $OpenBSD: asc_tc.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: asc_tc.c,v 1.9 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: asc_tc.c,v 1.19 2001/11/15 09:48:19 lukem Exp $ */
/*-
}
asc->sc_base = (caddr_t)ta->ta_addr; /* XXX XXX XXX */
- tc_intr_establish(parent, ta->ta_cookie, IPL_BIO, ncr53c9x_intr, sc);
+ tc_intr_establish(parent, ta->ta_cookie, IPL_BIO, ncr53c9x_intr, sc,
+ self->dv_xname);
sc->sc_id = 7;
sc->sc_freq = (ta->ta_busspeed) ? 25000000 : 12500000;
-/* $OpenBSD: asc_tcds.c,v 1.5 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: asc_tcds.c,v 1.6 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: asc_tcds.c,v 1.5 2001/11/15 09:48:19 lukem Exp $ */
/*-
/* gimme MHz */
sc->sc_freq /= 1000000;
- tcds_intr_establish(parent, tcdsdev->tcdsda_chip, ncr53c9x_intr, sc);
+ tcds_intr_establish(parent, tcdsdev->tcdsda_chip, ncr53c9x_intr, sc,
+ self->dv_xname);
/*
* XXX More of this should be in ncr53c9x_attach(), but
-/* $OpenBSD: if_fta.c,v 1.14 2007/11/06 18:20:07 miod Exp $ */
+/* $OpenBSD: if_fta.c,v 1.15 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: if_fta.c,v 1.7 1996/10/22 21:37:26 cgd Exp $ */
/*-
pdq_ifattach(sc, NULL);
tc_intr_establish(parent, ta->ta_cookie, IPL_NET,
- (int (*)(void *)) pdq_interrupt, sc->sc_pdq);
+ (int (*)(void *)) pdq_interrupt, sc->sc_pdq, self->dv_xname);
sc->sc_ats = shutdownhook_establish((void (*)(void *)) pdq_hwreset,
sc->sc_pdq);
-/* $OpenBSD: if_le_ioasic.c,v 1.14 2007/11/06 18:20:07 miod Exp $ */
+/* $OpenBSD: if_le_ioasic.c,v 1.15 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: if_le_ioasic.c,v 1.18 2001/11/13 06:26:10 lukem Exp $ */
/*
+ IOASIC_SLOT_2_START);
ioasic_intr_establish(parent, d->iada_cookie, IPL_NET,
- am7990_intr, sc);
+ am7990_intr, sc, self->dv_xname);
return;
bad:
-/* $OpenBSD: if_le_tc.c,v 1.9 2007/11/06 18:20:07 miod Exp $ */
+/* $OpenBSD: if_le_tc.c,v 1.10 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: if_le_tc.c,v 1.12 2001/11/13 06:26:10 lukem Exp $ */
/*
dec_le_common_attach(&lesc->sc_am7990,
(u_char *)(d->ta_addr + LE_OFFSET_ROM + 2));
- tc_intr_establish(parent, d->ta_cookie, IPL_NET, am7990_intr, sc);
+ tc_intr_establish(parent, d->ta_cookie, IPL_NET, am7990_intr, sc,
+ self->dv_xname);
}
-/* $OpenBSD: ioasicvar.h,v 1.8 2008/07/30 22:02:09 miod Exp $ */
+/* $OpenBSD: ioasicvar.h,v 1.9 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: ioasicvar.h,v 1.14 2000/10/17 09:45:49 nisimura Exp $ */
/*
extern tc_addr_t ioasic_base;
void ioasic_intr_establish(struct device *, void *,
- int, int (*)(void *), void *);
+ int, int (*)(void *), void *, const char *);
void ioasic_intr_disestablish(struct device *, void *);
int ioasic_submatch(void *, struct ioasicdev_attach_args *);
void ioasic_attach_devs(struct ioasic_softc *,
-/* $OpenBSD: tc.c,v 1.17 2007/06/25 14:13:40 tom Exp $ */
+/* $OpenBSD: tc.c,v 1.18 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: tc.c,v 1.29 2001/11/13 06:26:10 lukem Exp $ */
/*
}
void
-tc_intr_establish(dev, cookie, level, handler, arg)
+tc_intr_establish(dev, cookie, level, handler, arg, name)
struct device *dev;
void *cookie, *arg;
int level;
int (*handler)(void *);
+ const char *name;
{
struct tc_softc *sc = tc_cd.cd_devs[0];
- (*sc->sc_intr_establish)(dev, cookie, level, handler, arg);
+ (*sc->sc_intr_establish)(dev, cookie, level, handler, arg, name);
}
void
-/* $OpenBSD: tcds.c,v 1.6 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: tcds.c,v 1.7 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: tcds.c,v 1.3 2001/11/13 06:26:10 lukem Exp $ */
/*-
sc->sc_cookie = ta->ta_cookie;
- tc_intr_establish(parent, sc->sc_cookie, IPL_BIO, tcds_intr, sc);
+ tc_intr_establish(parent, sc->sc_cookie, IPL_BIO, tcds_intr, sc,
+ self->dv_xname);
/*
* XXX
slotc = &sc->sc_slots[i];
bzero(slotc, sizeof *slotc); /* clear everything */
- evcount_attach(&slotc->sc_count, sc->sc_dv.dv_xname, NULL,
- &evcount_intr);
-
slotc->sc_slot = i;
slotc->sc_bst = sc->sc_bst;
slotc->sc_bsh = sc->sc_bsh;
}
void
-tcds_intr_establish(tcds, slot, func, arg)
+tcds_intr_establish(tcds, slot, func, arg, name)
struct device *tcds;
int slot;
int (*func)(void *);
void *arg;
+ const char *name;
{
struct tcds_softc *sc = (struct tcds_softc *)tcds;
sc->sc_slots[slot].sc_intrhand = func;
sc->sc_slots[slot].sc_intrarg = arg;
+ evcount_attach(&sc->sc_slots[slot].sc_count, name, NULL, &evcount_intr);
+
tcds_scsi_reset(&sc->sc_slots[slot]);
}
sc->sc_slots[slot].sc_intrhand = tcds_intrnull;
sc->sc_slots[slot].sc_intrarg = (void *)(u_long)slot;
+ evcount_detach(&sc->sc_slots[slot].sc_count);
tcds_dma_enable(&sc->sc_slots[slot], 0);
tcds_scsi_enable(&sc->sc_slots[slot], 0);
-/* $OpenBSD: tcdsvar.h,v 1.3 2006/03/13 22:36:06 miod Exp $ */
+/* $OpenBSD: tcdsvar.h,v 1.4 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: tcdsvar.h,v 1.2 2001/08/22 05:00:27 nisimura Exp $ */
/*
* TCDS functions.
*/
void tcds_intr_establish(struct device *, int,
- int (*)(void *), void *);
+ int (*)(void *), void *, const char *);
void tcds_intr_disestablish(struct device *, int);
void tcds_dma_enable(struct tcds_slotconfig *, int);
void tcds_scsi_enable(struct tcds_slotconfig *, int);
-/* $OpenBSD: tcvar.h,v 1.13 2007/11/06 18:20:07 miod Exp $ */
+/* $OpenBSD: tcvar.h,v 1.14 2008/08/09 16:42:30 miod Exp $ */
/* $NetBSD: tcvar.h,v 1.17 2000/06/04 19:15:15 cgd Exp $ */
/*
struct tc_slotdesc *sc_slots;
void (*sc_intr_establish)(struct device *, void *,
- int, int (*)(void *), void *);
+ int, int (*)(void *), void *, const char *);
void (*sc_intr_disestablish)(struct device *, void *);
bus_dma_tag_t (*sc_get_dma_tag)(int);
};
/* TC bus resource management; XXX will move elsewhere eventually. */
void (*tba_intr_establish)(struct device *, void *,
- int, int (*)(void *), void *);
+ int, int (*)(void *), void *, const char *);
void (*tba_intr_disestablish)(struct device *, void *);
bus_dma_tag_t (*tba_get_dma_tag)(int);
};
void tc_devinfo(const char *, char *, size_t);
void tcattach(struct device *, struct device *, void *);
void tc_intr_establish(struct device *, void *, int, int (*)(void *),
- void *);
+ void *, const char *);
void tc_intr_disestablish(struct device *, void *);
/*