diff options
author | gonzo <gonzo@FreeBSD.org> | 2009-11-18 22:53:05 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2009-11-18 22:53:05 +0000 |
commit | 5f019e757e130ca1dedc8de3edd3266b1c1b2d13 (patch) | |
tree | ce0354d9e9afc27981a745690a3716e58297b672 /sys/mips/atheros/apb.c | |
parent | 13b67a1ebd8e96ae64a4166502ac16600a85a531 (diff) | |
download | FreeBSD-src-5f019e757e130ca1dedc8de3edd3266b1c1b2d13.zip FreeBSD-src-5f019e757e130ca1dedc8de3edd3266b1c1b2d13.tar.gz |
- Add intr counters for APB interrupts
Diffstat (limited to 'sys/mips/atheros/apb.c')
-rw-r--r-- | sys/mips/atheros/apb.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/mips/atheros/apb.c b/sys/mips/atheros/apb.c index ee8a167..d71b242 100644 --- a/sys/mips/atheros/apb.c +++ b/sys/mips/atheros/apb.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <machine/bus.h> +#include <machine/intr_machdep.h> #include <mips/atheros/apbvar.h> #include <mips/atheros/ar71xxreg.h> @@ -285,11 +286,18 @@ apb_setup_intr(device_t bus, device_t child, struct resource *ires, NULL, NULL, "apb intr%d:", irq); - sc->sc_eventstab[irq] = event; + if (error == 0) { + sc->sc_eventstab[irq] = event; + sc->sc_intr_counter[irq] = + mips_intrcnt_create(event->ie_name); + } + else + return (error); } intr_event_add_handler(event, device_get_nameunit(child), filt, handler, arg, intr_priority(flags), flags, cookiep); + mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname); apb_unmask_irq((void*)irq); @@ -333,12 +341,13 @@ apb_intr(void *arg) if (!event || TAILQ_EMPTY(&event->ie_handlers)) { /* Ignore timer interrupts */ if (irq != 0) - printf("Stray IRQ %d\n", irq); + printf("Stray APB IRQ %d\n", irq); continue; } /* TODO: frame instead of NULL? */ intr_event_handle(event, NULL); + mips_intrcnt_inc(sc->sc_intr_counter[irq]); } } |