diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-12 21:49:05 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-12 21:49:05 +0000 |
commit | ac7d3d8927f9e5a1e69af488a0d96ceb36089972 (patch) | |
tree | 82190f07255d070cff3a26ee5c3038412cf51d0b /sys/arm | |
parent | 583a3d8244e9f0392c00e6c9d66e5526929cc550 (diff) | |
download | FreeBSD-src-ac7d3d8927f9e5a1e69af488a0d96ceb36089972.zip FreeBSD-src-ac7d3d8927f9e5a1e69af488a0d96ceb36089972.tar.gz |
Implement interrupt counting, so that vmstat -i work.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/genassym.c | 4 | ||||
-rw-r--r-- | sys/arm/arm/intr.c | 17 | ||||
-rw-r--r-- | sys/arm/arm/irq_dispatch.S | 9 |
3 files changed, 21 insertions, 9 deletions
diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c index adea08d..4782a9d 100644 --- a/sys/arm/arm/genassym.c +++ b/sys/arm/arm/genassym.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <machine/proc.h> #include <machine/cpufunc.h> #include <machine/pte.h> +#include <machine/intr.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> @@ -109,3 +110,6 @@ ASSYM(P_TRACED, P_TRACED); ASSYM(P_SIGEVENT, P_SIGEVENT); ASSYM(P_PROFIL, P_PROFIL); ASSYM(TRAPFRAMESIZE, sizeof(struct trapframe)); + +ASSYM(MAXCOMLEN, MAXCOMLEN); +ASSYM(NIRQ, NIRQ); diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c index 2fa088e..e4e0506 100644 --- a/sys/arm/arm/intr.c +++ b/sys/arm/arm/intr.c @@ -50,7 +50,10 @@ __FBSDID("$FreeBSD$"); #include <machine/intr.h> #include <machine/cpu.h> -struct ithd *ithreads[NIRQ]; +static struct ithd *ithreads[NIRQ]; +static int intrcnt_tab[NIRQ]; +static int intrcnt_index = 0; +static int last_printed = 0; struct arm_intr { driver_intr_t *handler; void *arg; @@ -69,7 +72,8 @@ arm_intr_handler(void *arg) void arm_handler_execute(void *, int); -void arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg, +void +arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) { struct ithd *cur_ith; @@ -87,6 +91,14 @@ void arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg, if (error) return; ithreads[irq] = cur_ith; + last_printed += + snprintf(intrnames + last_printed, + MAXCOMLEN + 1, + "irq%d: %s", irq, name); + last_printed++; + intrcnt_tab[irq] = intrcnt_index; + intrcnt_index++; + } if (!(flags & INTR_FAST)) { intr->handler = hand; @@ -120,6 +132,7 @@ arm_handler_execute(void *frame, int irqnb) arm_mask_irqs(irqnb); while (irqnb != 0) { i = ffs(irqnb) - 1; + intrcnt[intrcnt_tab[i]]++; irqnb &= ~(1U << i); ithd = ithreads[i]; if (!ithd) diff --git a/sys/arm/arm/irq_dispatch.S b/sys/arm/arm/irq_dispatch.S index bfd304b..21976b9 100644 --- a/sys/arm/arm/irq_dispatch.S +++ b/sys/arm/arm/irq_dispatch.S @@ -102,18 +102,13 @@ ASENTRY_NP(irq_entry) .align 0 - /* - * XXX Provide intrnames/intrcnt for legacy code, but - * don't actually use them. - */ - .global _C_LABEL(intrnames), _C_LABEL(eintrnames) .global _C_LABEL(intrcnt), _C_LABEL(eintrcnt) _C_LABEL(intrnames): + .space NIRQ * (MAXCOMLEN + 1) _C_LABEL(eintrnames): - - .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt), _C_LABEL(eintrcnt) _C_LABEL(intrcnt): + .space NIRQ * 4 _C_LABEL(eintrcnt): .global _C_LABEL(current_intr_depth) |