diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-24 14:22:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-24 14:22:50 +0000 |
commit | 6e2ea7ce732c94456d0c49db94ed26c8576c51d7 (patch) | |
tree | c02ae173cf40402ad1b514a0bf2501fda214f133 | |
parent | d52df26f7c3c2366a760882d1c325cf28a961381 (diff) |
new style interrupt counters; pefo ok
-rw-r--r-- | sys/arch/mips64/include/types.h | 3 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/clock.c | 8 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/interrupt.c | 9 | ||||
-rw-r--r-- | sys/arch/sgi/include/intr.h | 6 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/macebus.c | 9 | ||||
-rw-r--r-- | sys/arch/sgi/pci/macepcibridge.c | 4 |
6 files changed, 25 insertions, 14 deletions
diff --git a/sys/arch/mips64/include/types.h b/sys/arch/mips64/include/types.h index 9db319333e5..33f53a9bcc7 100644 --- a/sys/arch/mips64/include/types.h +++ b/sys/arch/mips64/include/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.3 2004/08/15 10:37:36 pefo Exp $ */ +/* $OpenBSD: types.h,v 1.4 2004/09/24 14:22:49 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -93,5 +93,6 @@ typedef struct label_t { /* XXX check why this still has to be defined. pmap.c issue? */ #define __SWAP_BROKEN +#define __HAVE_EVCOUNT #endif /* !_MIPS_TYPES_H_ */ diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c index 3b28a6d90b8..43584de1bbc 100644 --- a/sys/arch/mips64/mips64/clock.c +++ b/sys/arch/mips64/mips64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.7 2004/09/16 09:23:21 pefo Exp $ */ +/* $OpenBSD: clock.c,v 1.8 2004/09/24 14:22:49 deraadt Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -30,12 +30,15 @@ #include <sys/kernel.h> #include <sys/systm.h> #include <sys/device.h> +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/cpu.h> #include <mips64/dev/clockvar.h> #include <mips64/archtype.h> +static struct evcount clk_count; +static int clk_irq = 5; /* Definition of the driver for autoconfig. */ int clockmatch(struct device *, void *, void *); @@ -176,6 +179,7 @@ clock_int5( intrmask_t mask, struct trap_frame *tf) if ((tf->cpl & SPL_CLOCKMASK) == 0) { while (pendingticks) { + clk_count.ec_count++; hardclock(tf); pendingticks--; } @@ -270,6 +274,8 @@ cpu_initclocks() stathz = sc->sc_clock.clk_stathz; profhz = sc->sc_clock.clk_profhz; + evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr); + /* Start the clock. */ if (sc->sc_clock.clk_init != NULL) (*sc->sc_clock.clk_init)(sc); diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index cd6891c0eb2..fc1eacf6c3a 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.6 2004/09/21 05:51:15 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.7 2004/09/24 14:22:49 deraadt Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -378,11 +378,12 @@ static int initialized = 0; */ ih->ih_fun = ih_fun; ih->ih_arg = ih_arg; - ih->ih_count = 0; ih->ih_next = NULL; ih->ih_level = level; ih->ih_irq = irq; ih->ih_what = ih_what; + evcount_attach(&ih->ih_count, ih_what, (void *)&ih->ih_irq, + &evcount_intr); *p = ih; return (ih); @@ -490,7 +491,7 @@ static volatile int processing; while (ih) { ih->frame = &cf; if ((*ih->ih_fun)(ih->ih_arg)) { - ih->ih_count++; + ih->ih_count.ec_count++; } ih = ih->ih_next; } @@ -560,7 +561,7 @@ generic_iointr(intrmask_t pending, struct trap_frame *cf) ih->frame = cf; if ((*ih->ih_fun)(ih->ih_arg)) { catched |= vm; - ih->ih_count++; + ih->ih_count.ec_count++; } ih = ih->ih_next; } diff --git a/sys/arch/sgi/include/intr.h b/sys/arch/sgi/include/intr.h index 28822126337..7e9a3a847f1 100644 --- a/sys/arch/sgi/include/intr.h +++ b/sys/arch/sgi/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.7 2004/09/21 05:51:15 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.8 2004/09/24 14:22:48 deraadt Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -213,15 +213,17 @@ void set_sint(int pending); * to hold interrupt handler info. */ +#include <sys/evcount.h> + struct intrhand { struct intrhand *ih_next; int (*ih_fun)(void *); void *ih_arg; - u_long ih_count; int ih_level; int ih_irq; char *ih_what; void *frame; + struct evcount ih_count; }; extern struct intrhand *intrhand[INTMASKSIZE]; diff --git a/sys/arch/sgi/localbus/macebus.c b/sys/arch/sgi/localbus/macebus.c index 7bd0bbcdf08..b4686226f0e 100644 --- a/sys/arch/sgi/localbus/macebus.c +++ b/sys/arch/sgi/localbus/macebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macebus.c,v 1.8 2004/09/21 05:51:15 miod Exp $ */ +/* $OpenBSD: macebus.c,v 1.9 2004/09/24 14:22:49 deraadt Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -516,11 +516,12 @@ macebus_intr_establish(void *icp, u_long irq, int type, int level, */ ih->ih_fun = ih_fun; ih->ih_arg = ih_arg; - ih->ih_count = 0; ih->ih_next = NULL; ih->ih_level = level; ih->ih_irq = irq; ih->ih_what = ih_what; + evcount_attach(&ih->ih_count, ih_what, (void *)&ih->ih_irq, + &evcount_intr); *p = ih; return (ih); @@ -628,7 +629,7 @@ macebus_do_pending_int(void) while (ih) { ih->frame = &cf; if ((*ih->ih_fun)(ih->ih_arg)) { - ih->ih_count++; + ih->ih_count.ec_count++; } ih = ih->ih_next; } @@ -697,7 +698,7 @@ crimestat=intstat; ih->frame = cf; if ((*ih->ih_fun)(ih->ih_arg)) { catched |= vm; - ih->ih_count++; + ih->ih_count.ec_count++; } ih = ih->ih_next; } diff --git a/sys/arch/sgi/pci/macepcibridge.c b/sys/arch/sgi/pci/macepcibridge.c index 6a478c843a2..85e68bbe962 100644 --- a/sys/arch/sgi/pci/macepcibridge.c +++ b/sys/arch/sgi/pci/macepcibridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macepcibridge.c,v 1.4 2004/09/20 10:31:16 pefo Exp $ */ +/* $OpenBSD: macepcibridge.c,v 1.5 2004/09/24 14:22:49 deraadt Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se) @@ -426,7 +426,7 @@ pcibr_intr_string(lcv, ih) void *lcv; pci_intr_handle_t ih; { -static char str[16]; + static char str[16]; snprintf(str, sizeof(str), "irq %d", ih); return(str); |