svn commit: r199497 - projects/mips/sys/mips/atheros
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Nov 18 22:53:05 UTC 2009
Author: gonzo
Date: Wed Nov 18 22:53:05 2009
New Revision: 199497
URL: http://svn.freebsd.org/changeset/base/199497
Log:
- Add intr counters for APB interrupts
Modified:
projects/mips/sys/mips/atheros/apb.c
projects/mips/sys/mips/atheros/apbvar.h
Modified: projects/mips/sys/mips/atheros/apb.c
==============================================================================
--- projects/mips/sys/mips/atheros/apb.c Wed Nov 18 22:52:05 2009 (r199496)
+++ projects/mips/sys/mips/atheros/apb.c Wed Nov 18 22:53:05 2009 (r199497)
@@ -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 ch
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]);
}
}
Modified: projects/mips/sys/mips/atheros/apbvar.h
==============================================================================
--- projects/mips/sys/mips/atheros/apbvar.h Wed Nov 18 22:52:05 2009 (r199496)
+++ projects/mips/sys/mips/atheros/apbvar.h Wed Nov 18 22:53:05 2009 (r199497)
@@ -37,6 +37,7 @@ struct apb_softc {
struct rman apb_mem_rman;
/* IRQ events structs for child devices */
struct intr_event *sc_eventstab[APB_NIRQS];
+ mips_intrcnt_t sc_intr_counter[APB_NIRQS];
/* Resources and cookies for MIPS CPU INTs */
struct resource *sc_misc_irq;
void *sc_misc_ih;
More information about the svn-src-projects
mailing list