diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2004-06-28 02:28:44 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2004-06-28 02:28:44 +0000 |
commit | 2d2f1330c2629516ed3a6392bb05b754eccc7198 (patch) | |
tree | a2d1568c05e228e271d8ff8d0dc49c0fd318f85c /sys | |
parent | f0dfa358923d9feb4fdf1633601becea7e11ac3d (diff) |
Use new event counter API for interrupt counting on alpha. By me, with some
edits by Theo. deraadt@ ok
Diffstat (limited to 'sys')
30 files changed, 71 insertions, 498 deletions
diff --git a/sys/arch/alpha/alpha/clock.c b/sys/arch/alpha/alpha/clock.c index 61567594a89..e828b9430ac 100644 --- a/sys/arch/alpha/alpha/clock.c +++ b/sys/arch/alpha/alpha/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.13 2003/10/18 20:14:40 jmc Exp $ */ +/* $OpenBSD: clock.c,v 1.14 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: clock.c,v 1.29 2000/06/05 21:47:10 thorpej Exp $ */ /* @@ -43,6 +43,7 @@ #include <sys/kernel.h> #include <sys/systm.h> #include <sys/device.h> +#include <sys/evcount.h> #include <dev/clock_subr.h> @@ -71,6 +72,8 @@ extern int schedhz; struct device *clockdev; const struct clockfns *clockfns; int clockinitted; +struct evcount clk_count; +int clk_irq = 0; void clockattach(dev, fns) @@ -87,9 +90,6 @@ clockattach(dev, fns) panic("clockattach: multiple clocks"); clockdev = dev; clockfns = fns; -#ifdef EVCNT_COUNTERS - evcnt_attach(dev, "intr", &clock_intr_evcnt); -#endif } /* @@ -140,6 +140,8 @@ cpu_initclocks() platform.clockintr = hardclock; schedhz = 16; + evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr); + /* * Get the clock started. */ diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c index 5d0325b4e7a..49306f94b58 100644 --- a/sys/arch/alpha/alpha/interrupt.c +++ b/sys/arch/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.15 2003/11/06 21:09:34 mickey Exp $ */ +/* $OpenBSD: interrupt.c,v 1.16 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */ /*- @@ -79,6 +79,7 @@ #include <sys/device.h> #include <sys/mbuf.h> #include <sys/socket.h> +#include <sys/evcount.h> #include <uvm/uvm_extern.h> @@ -89,7 +90,6 @@ #include <machine/rpb.h> #include <machine/frame.h> #include <machine/cpuconf.h> -#include <machine/intrcnt.h> #if defined(MULTIPROCESSOR) #include <sys/device.h> @@ -117,6 +117,8 @@ static u_int schedclk2; +extern struct evcount clk_count; + void netintr(void); void @@ -170,7 +172,7 @@ interrupt(unsigned long a0, unsigned long a1, unsigned long a2, return; #endif uvmexp.intrs++; - intrcnt[INTRCNT_CLOCK]++; + clk_count.ec_count++; if (platform.clockintr) { /* * Call hardclock(). This will also call diff --git a/sys/arch/alpha/alpha/locore.s b/sys/arch/alpha/alpha/locore.s index 48849130727..05ccc2d9b98 100644 --- a/sys/arch/alpha/alpha/locore.s +++ b/sys/arch/alpha/alpha/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.22 2004/06/13 21:49:11 niklas Exp $ */ +/* $OpenBSD: locore.s,v 1.23 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: locore.s,v 1.94 2001/04/26 03:10:44 ross Exp $ */ /*- @@ -1457,26 +1457,15 @@ END(copyerr) /**************************************************************************/ -/* - * Some bogus data, to keep vmstat happy, for now. - */ - -#include <machine/intrcnt.h> - .data +/* Some bogus data, to keep vmstat happy, for now. */ EXPORT(intrnames) .type intrnames,@object -#ifndef EVCNT_COUNTERS - INTRNAMES_DEFINITION -#endif EXPORT(eintrnames) .type eintrnames,@object .align 3 EXPORT(intrcnt) .type intrcnt,@object -#ifndef EVCNT_COUNTERS - INTRCNT_DEFINITION -#endif EXPORT(eintrcnt) .type eintrcnt,@object .text diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c index 90c0c6bb4e4..31f78bb877c 100644 --- a/sys/arch/alpha/dev/shared_intr.c +++ b/sys/arch/alpha/dev/shared_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shared_intr.c,v 1.11 2002/03/14 01:26:26 millert Exp $ */ +/* $OpenBSD: shared_intr.c,v 1.12 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: shared_intr.c,v 1.13 2000/03/19 01:46:18 thorpej Exp $ */ /* @@ -106,7 +106,8 @@ alpha_shared_intr_dispatch(intr, num) * -1: This interrupt might have been for me, but I can't say * for sure. */ - rv = (*ih->ih_fn)(ih->ih_arg); + if ((rv = (*ih->ih_fn)(ih->ih_arg))) + ih->ih_count.ec_count++; handled = handled || (rv != 0); ih = ih->ih_q.tqe_next; @@ -172,6 +173,8 @@ alpha_shared_intr_establish(intr, num, type, level, fn, arg, basename) ih->ih_arg = arg; ih->ih_level = level; ih->ih_num = num; + evcount_attach(&ih->ih_count, basename, (void *)&ih->ih_num, + &evcount_intr); intr[num].intr_sharetype = type; TAILQ_INSERT_TAIL(&intr[num].intr_q, ih, ih_q); @@ -192,7 +195,9 @@ alpha_shared_intr_disestablish(intr, cookie, basename) * Just remove it from the list and free the entry. We let * the caller deal with resetting the share type, if appropriate. */ + evcount_detach(&ih->ih_count); TAILQ_REMOVE(&intr[num].intr_q, ih, ih_q); + free(ih, M_DEVBUF); } int diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h index 25fdcba079d..979d823ab93 100644 --- a/sys/arch/alpha/include/intr.h +++ b/sys/arch/alpha/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.17 2004/06/13 21:49:12 niklas Exp $ */ +/* $OpenBSD: intr.h,v 1.18 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */ /*- @@ -68,6 +68,7 @@ #ifndef _ALPHA_INTR_H_ #define _ALPHA_INTR_H_ +#include <sys/evcount.h> #include <sys/lock.h> #include <sys/queue.h> #include <machine/atomic.h> @@ -173,6 +174,7 @@ struct alpha_shared_intrhand { void *ih_arg; int ih_level; unsigned int ih_num; + struct evcount ih_count; }; struct alpha_shared_intr { diff --git a/sys/arch/alpha/include/intrcnt.h b/sys/arch/alpha/include/intrcnt.h deleted file mode 100644 index 568ae353458..00000000000 --- a/sys/arch/alpha/include/intrcnt.h +++ /dev/null @@ -1,152 +0,0 @@ -/* $OpenBSD: intrcnt.h,v 1.6 2003/02/28 23:02:09 jason Exp $ */ -/* $NetBSD: intrcnt.h,v 1.7 1996/11/16 23:11:57 cgd Exp $ */ - -/* - * Copyright (c) 1995, 1996 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#define INTRNAMES_DEFINITION \ -/* 0x00 */ ASCIZ "clock"; \ - ASCIZ "isa irq 0"; \ - ASCIZ "isa irq 1"; \ - ASCIZ "isa irq 2"; \ - ASCIZ "isa irq 3"; \ - ASCIZ "isa irq 4"; \ - ASCIZ "isa irq 5"; \ - ASCIZ "isa irq 6"; \ - ASCIZ "isa irq 7"; \ - ASCIZ "isa irq 8"; \ - ASCIZ "isa irq 9"; \ - ASCIZ "isa irq 10"; \ - ASCIZ "isa irq 11"; \ - ASCIZ "isa irq 12"; \ - ASCIZ "isa irq 13"; \ - ASCIZ "isa irq 14"; \ -/* 0x10 */ ASCIZ "isa irq 15"; \ - ASCIZ "kn20aa irq 0"; \ - ASCIZ "kn20aa irq 1"; \ - ASCIZ "kn20aa irq 2"; \ - ASCIZ "kn20aa irq 3"; \ - ASCIZ "kn20aa irq 4"; \ - ASCIZ "kn20aa irq 5"; \ - ASCIZ "kn20aa irq 6"; \ - ASCIZ "kn20aa irq 7"; \ - ASCIZ "kn20aa irq 8"; \ - ASCIZ "kn20aa irq 9"; \ - ASCIZ "kn20aa irq 10"; \ - ASCIZ "kn20aa irq 11"; \ - ASCIZ "kn20aa irq 12"; \ - ASCIZ "kn20aa irq 13"; \ - ASCIZ "kn20aa irq 14"; \ -/* 0x20 */ ASCIZ "kn20aa irq 15"; \ - ASCIZ "kn20aa irq 16"; \ - ASCIZ "kn20aa irq 17"; \ - ASCIZ "kn20aa irq 18"; \ - ASCIZ "kn20aa irq 19"; \ - ASCIZ "kn20aa irq 20"; \ - ASCIZ "kn20aa irq 21"; \ - ASCIZ "kn20aa irq 22"; \ - ASCIZ "kn20aa irq 23"; \ - ASCIZ "kn20aa irq 24"; \ - ASCIZ "kn20aa irq 25"; \ - ASCIZ "kn20aa irq 26"; \ - ASCIZ "kn20aa irq 27"; \ - ASCIZ "kn20aa irq 28"; \ - ASCIZ "kn20aa irq 29"; \ - ASCIZ "kn20aa irq 30"; \ -/* 0x30 */ ASCIZ "kn20aa irq 31"; \ - ASCIZ "kn15 tc slot 0"; \ - ASCIZ "kn15 tc slot 1"; \ - ASCIZ "kn15 tc slot 2"; \ - ASCIZ "kn15 tc slot 3"; \ - ASCIZ "kn15 tc slot 4"; \ - ASCIZ "kn15 tc slot 5"; \ - ASCIZ "kn15 tcds"; \ - ASCIZ "kn15 ioasic"; \ - ASCIZ "kn15 sfb"; \ - ASCIZ "kn16 tc slot 0"; \ - ASCIZ "kn16 tc slot 1"; \ - ASCIZ "kn16 tcds"; \ - ASCIZ "kn16 ioasic"; \ - ASCIZ "kn16 sfb"; \ - ASCIZ "tcds esp 0"; \ -/* 0x40 */ ASCIZ "tcds esp 1"; \ - ASCIZ "ioasic le"; \ - ASCIZ "ioasic scc 0"; \ - ASCIZ "ioasic scc 1"; \ - ASCIZ "ioasic am79c30"; \ - ASCIZ "eb164 irq 0"; \ - ASCIZ "eb164 irq 1"; \ - ASCIZ "eb164 irq 2"; \ - ASCIZ "eb164 irq 3"; \ - ASCIZ "eb164 irq 4"; \ - ASCIZ "eb164 irq 5"; \ - ASCIZ "eb164 irq 6"; \ - ASCIZ "eb164 irq 7"; \ - ASCIZ "eb164 irq 8"; \ - ASCIZ "eb164 irq 9"; \ - ASCIZ "eb164 irq 10"; \ -/* 0x50 */ ASCIZ "eb164 irq 11"; \ - ASCIZ "eb164 irq 12"; \ - ASCIZ "eb164 irq 13"; \ - ASCIZ "eb164 irq 14"; \ - ASCIZ "eb164 irq 15"; \ - ASCIZ "eb164 irq 16"; \ - ASCIZ "eb164 irq 17"; \ - ASCIZ "eb164 irq 18"; \ - ASCIZ "eb164 irq 19"; \ - ASCIZ "eb164 irq 20"; \ - ASCIZ "eb164 irq 21"; \ - ASCIZ "eb164 irq 22"; \ - ASCIZ "eb164 irq 23"; - -#define INTRCNT_DEFINITION \ -/* 0x00 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \ -/* 0x10 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \ -/* 0x20 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \ -/* 0x30 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \ -/* 0x40 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \ -/* 0x50 */ .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; - -#define INTRCNT_CLOCK 0 -#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1) -#define INTRCNT_ISA_IRQ_LEN 16 -#define INTRCNT_KN20AA_IRQ (INTRCNT_ISA_IRQ + INTRCNT_ISA_IRQ_LEN) -#define INTRCNT_KN20AA_IRQ_LEN 32 -#define INTRCNT_KN15 (INTRCNT_KN20AA_IRQ + INTRCNT_KN20AA_IRQ_LEN) -#define INTRCNT_KN15_LEN 9 -#define INTRCNT_KN16 (INTRCNT_KN15 + INTRCNT_KN15_LEN) -#define INTRCNT_KN16_LEN 5 -#define INTRCNT_TCDS (INTRCNT_KN16 + INTRCNT_KN16_LEN) -#define INTRCNT_TCDS_LEN 2 -#define INTRCNT_IOASIC (INTRCNT_TCDS + INTRCNT_TCDS_LEN) -#define INTRCNT_IOASIC_LEN 4 -#define INTRCNT_EB164_IRQ (INTRCNT_IOASIC + INTRCNT_IOASIC_LEN) -#define INTRCNT_EB164_IRQ_LEN 24 - -#ifndef _LOCORE -extern volatile int intrcnt[]; -#endif diff --git a/sys/arch/alpha/include/types.h b/sys/arch/alpha/include/types.h index 1967be2ba53..b24bedab8bf 100644 --- a/sys/arch/alpha/include/types.h +++ b/sys/arch/alpha/include/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.12 2003/06/02 23:27:43 millert Exp $ */ +/* $OpenBSD: types.h,v 1.13 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: types.h,v 1.6 1996/12/05 00:13:47 cgd Exp $ */ /*- @@ -74,5 +74,6 @@ typedef long register_t; #define __BROKEN_INDIRECT_CONFIG #define __HAVE_DEVICE_REGISTER #define __HAVE_NWSCONS +#define __HAVE_EVCOUNT #endif /* _MACHTYPES_H_ */ diff --git a/sys/arch/alpha/pci/pci_1000.c b/sys/arch/alpha/pci/pci_1000.c index 3d5ae2e63a7..430aae9421c 100644 --- a/sys/arch/alpha/pci/pci_1000.c +++ b/sys/arch/alpha/pci/pci_1000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_1000.c,v 1.1 2002/06/30 16:24:40 miod Exp $ */ +/* $OpenBSD: pci_1000.c,v 1.2 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: pci_1000.c,v 1.12 2001/07/27 00:25:20 thorpej Exp $ */ /* @@ -94,9 +94,6 @@ static bus_space_handle_t another_mystery_icu_ioh; int dec_1000_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *dec_1000_intr_string(void *, pci_intr_handle_t); int dec_1000_intr_line(void *, pci_intr_handle_t); -#if 0 -const struct evcnt *dec_1000_intr_evcnt(void *, pci_intr_handle_t); -#endif void *dec_1000_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void dec_1000_intr_disestablish(void *, void *); @@ -132,9 +129,6 @@ pci_1000_pickintr(core, iot, memt, pc) pc->pc_intr_map = dec_1000_intr_map; pc->pc_intr_string = dec_1000_intr_string; pc->pc_intr_line = dec_1000_intr_line; -#if 0 - pc->pc_intr_evcnt = dec_1000_intr_evcnt; -#endif pc->pc_intr_establish = dec_1000_intr_establish; pc->pc_intr_disestablish = dec_1000_intr_disestablish; @@ -146,14 +140,6 @@ pci_1000_pickintr(core, iot, memt, pc) for (i = 0; i < PCI_NIRQ; i++) { alpha_shared_intr_set_maxstrays(dec_1000_pci_intr, i, PCI_STRAY_MAX); - -#if 0 - cp = alpha_shared_intr_string(dec_1000_pci_intr, i); - sprintf(cp, "irq %d", i); - evcnt_attach_dynamic(alpha_shared_intr_evcnt( - dec_1000_pci_intr, i), EVCNT_TYPE_INTR, NULL, - "dec_1000", cp); -#endif } pci_1000_imi(); @@ -223,20 +209,6 @@ dec_1000_intr_line(ccv, ih) #endif } -#if 0 -const struct evcnt * -dec_1000_intr_evcnt(ccv, ih) - void *ccv; - pci_intr_handle_t ih; -{ - - if (ih >= PCI_NIRQ) - panic("dec_1000_intr_evcnt: bogus dec_1000 IRQ 0x%lx", ih); - - return (alpha_shared_intr_evcnt(dec_1000_pci_intr, ih)); -} -#endif - void * dec_1000_intr_establish(ccv, ih, level, func, arg, name) void *ccv; diff --git a/sys/arch/alpha/pci/pci_1000a.c b/sys/arch/alpha/pci/pci_1000a.c index 5392264f46d..0579b368bed 100644 --- a/sys/arch/alpha/pci/pci_1000a.c +++ b/sys/arch/alpha/pci/pci_1000a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_1000a.c,v 1.1 2002/06/30 16:24:40 miod Exp $ */ +/* $OpenBSD: pci_1000a.c,v 1.2 2004/06/28 02:28:42 aaron Exp $ */ /* $NetBSD: pci_1000a.c,v 1.14 2001/07/27 00:25:20 thorpej Exp $ */ /* @@ -101,9 +101,6 @@ int dec_1000a_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *dec_1000a_intr_string(void *, pci_intr_handle_t); int dec_1000a_intr_line(void *, pci_intr_handle_t); -#if 0 -const struct evcnt *dec_1000a_intr_evcnt(void *, pci_intr_handle_t); -#endif void *dec_1000a_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void dec_1000a_intr_disestablish(void *, void *); @@ -137,9 +134,6 @@ pci_1000a_pickintr(core, iot, memt, pc) pc->pc_intr_map = dec_1000a_intr_map; pc->pc_intr_string = dec_1000a_intr_string; pc->pc_intr_line = dec_1000a_intr_line; -#if 0 - pc->pc_intr_evcnt = dec_1000a_intr_evcnt; -#endif pc->pc_intr_establish = dec_1000a_intr_establish; pc->pc_intr_disestablish = dec_1000a_intr_disestablish; @@ -150,14 +144,6 @@ pci_1000a_pickintr(core, iot, memt, pc) for (i = 0; i < PCI_NIRQ; i++) { alpha_shared_intr_set_maxstrays(dec_1000a_pci_intr, i, PCI_STRAY_MAX); - -#if 0 - cp = alpha_shared_intr_string(dec_1000a_pci_intr, i); - sprintf(cp, "irq %d", i); - evcnt_attach_dynamic(alpha_shared_intr_evcnt( - dec_1000a_pci_intr, i), EVCNT_TYPE_INTR, NULL, - "dec_1000a", cp); -#endif } pci_1000a_imi(); @@ -244,20 +230,6 @@ dec_1000a_intr_line(ccv, ih) #endif } -#if 0 -const struct evcnt * -dec_1000a_intr_evcnt(ccv, ih) - void *ccv; - pci_intr_handle_t ih; -{ - - if (ih >= PCI_NIRQ) - panic("dec_1000a_intr_evcnt: bogus dec_1000a IRQ 0x%lx", ih); - - return (alpha_shared_intr_evcnt(dec_1000a_pci_intr, ih)); -} -#endif - void * dec_1000a_intr_establish(ccv, ih, level, func, arg, name) void *ccv; diff --git a/sys/arch/alpha/pci/pci_550.c b/sys/arch/alpha/pci/pci_550.c index e7046bab335..1fc437e9f02 100644 --- a/sys/arch/alpha/pci/pci_550.c +++ b/sys/arch/alpha/pci/pci_550.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_550.c,v 1.11 2003/05/11 19:41:09 deraadt Exp $ */ +/* $OpenBSD: pci_550.c,v 1.12 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_550.c,v 1.18 2000/06/29 08:58:48 mrg Exp $ */ /*- @@ -98,7 +98,6 @@ int dec_550_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *dec_550_intr_string(void *, pci_intr_handle_t); int dec_550_intr_line(void *, pci_intr_handle_t); -const struct evcnt *dec_550_intr_evcnt(void *, pci_intr_handle_t); void *dec_550_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void dec_550_intr_disestablish(void *, void *); @@ -147,9 +146,6 @@ pci_550_pickintr(ccp) pc->pc_intr_map = dec_550_intr_map; pc->pc_intr_string = dec_550_intr_string; pc->pc_intr_line = dec_550_intr_line; -#if 0 - pc->pc_intr_evcnt = dec_550_intr_evcnt; -#endif pc->pc_intr_establish = dec_550_intr_establish; pc->pc_intr_disestablish = dec_550_intr_disestablish; @@ -171,13 +167,6 @@ pci_550_pickintr(ccp) alpha_shared_intr_set_maxstrays(dec_550_pci_intr, i, PCI_STRAY_MAX); alpha_shared_intr_set_private(dec_550_pci_intr, i, ccp); -#if 0 - cp = alpha_shared_intr_string(dec_550_pci_intr, i); - sprintf(cp, "irq %d", i); - evcnt_attach_dynamic(alpha_shared_intr_evcnt( - dec_550_pci_intr, i), EVCNT_TYPE_INTR, NULL, - "dec_550", cp); -#endif } #if NSIO @@ -303,29 +292,6 @@ dec_550_intr_line(ccv, ih) return (ih); } -#if 0 -const struct evcnt * -dec_550_intr_evcnt(ccv, ih) - void *ccv; - pci_intr_handle_t ih; -{ -#if 0 - struct cia_config *ccp = ccv; -#endif - -#if NSIO - if (DEC_550_LINE_IS_ISA(ih)) - return (sio_intr_evcnt(NULL /*XXX*/, - DEC_550_LINE_ISA_IRQ(ih))); -#endif - - if (ih >= DEC_550_MAX_IRQ) - panic("dec_550_intr_evcnt: bogus 550 IRQ 0x%lx", ih); - - return (alpha_shared_intr_evcnt(dec_550_pci_intr, ih)); -} -#endif - void * dec_550_intr_establish(ccv, ih, level, func, arg, name) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_6600.c b/sys/arch/alpha/pci/pci_6600.c index f98f7cb7079..0bb50fe4afd 100644 --- a/sys/arch/alpha/pci/pci_6600.c +++ b/sys/arch/alpha/pci/pci_6600.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_6600.c,v 1.10 2002/06/25 21:33:21 miod Exp $ */ +/* $OpenBSD: pci_6600.c,v 1.11 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_6600.c,v 1.5 2000/06/06 00:50:15 thorpej Exp $ */ /*- @@ -81,7 +81,6 @@ void *dec_6600_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); const char *dec_6600_intr_string(void *, pci_intr_handle_t); int dec_6600_intr_line(void *, pci_intr_handle_t); -const struct evcnt *dec_6600_intr_evcnt(void *, pci_intr_handle_t); int dec_6600_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); void *dec_6600_pciide_compat_intr_establish(void *, struct device *, struct pci_attach_args *, int, int (*)(void *), void *); @@ -108,9 +107,6 @@ pci_6600_pickintr(pcp) pc->pc_intr_map = dec_6600_intr_map; pc->pc_intr_string = dec_6600_intr_string; pc->pc_intr_line = dec_6600_intr_line; -#if 0 - pc->pc_intr_evcnt = dec_6600_intr_evcnt; -#endif pc->pc_intr_establish = dec_6600_intr_establish; pc->pc_intr_disestablish = dec_6600_intr_disestablish; pc->pc_pciide_compat_intr_establish = NULL; @@ -128,14 +124,6 @@ pci_6600_pickintr(pcp) PCI_STRAY_MAX); alpha_shared_intr_set_private(dec_6600_pci_intr, i, sioprimary); - -#if 0 - cp = alpha_shared_intr_string(dec_6600_pci_intr); - sprintf(cp, "irq %d", i); - evcnt_attach_dynamic(alpha_shared_intr_evcnt( - dec_6600_pci_intr, 1), EVCNT_TYPE_INTR, NULL, - "dec_6600", cp); -#endif } #if NSIO sio_intr_setup(pc, iot); @@ -199,7 +187,7 @@ dec_6600_intr_string(acv, ih) pci_intr_handle_t ih; { - static const char irqfmt[] = "dec 6600 irq %ld"; + static const char irqfmt[] = "%lddec6600"; static char irqstr[sizeof irqfmt]; #if NSIO @@ -227,23 +215,6 @@ dec_6600_intr_line(acv, ih) return (ih); } -#if 0 -const struct evcnt * -dec_6600_intr_evcnt(acv, ih) - void *acv; - pci_intr_handle_t ih; -{ - -#if NSIO - if (DEC_6600_LINE_IS_ISA(ih)) - return (sio_intr_evcnt(NULL /*XXX*/, - DEC_6600_LINE_ISA_IRQ(ih))); -#endif - - return (alpha_shared_intr_evcnt(dec_6600_pci_intr, ih)); -} -#endif - void * dec_6600_intr_establish(acv, ih, level, func, arg, name) void *acv, *arg; diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c index 8be7804db6e..5aec27d2658 100644 --- a/sys/arch/alpha/pci/pci_eb164.c +++ b/sys/arch/alpha/pci/pci_eb164.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_eb164.c,v 1.15 2003/05/10 21:11:12 deraadt Exp $ */ +/* $OpenBSD: pci_eb164.c,v 1.16 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_eb164.c,v 1.27 2000/06/06 00:50:15 thorpej Exp $ */ /*- @@ -98,7 +98,6 @@ int dec_eb164_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *dec_eb164_intr_string(void *, pci_intr_handle_t); int dec_eb164_intr_line(void *, pci_intr_handle_t); -const struct evcnt *dec_eb164_intr_evcnt(void *, pci_intr_handle_t); void *dec_eb164_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void dec_eb164_intr_disestablish(void *, void *); diff --git a/sys/arch/alpha/pci/pci_eb164.h b/sys/arch/alpha/pci/pci_eb164.h index 71521177906..617ad4e37e4 100644 --- a/sys/arch/alpha/pci/pci_eb164.h +++ b/sys/arch/alpha/pci/pci_eb164.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_eb164.h,v 1.3 2002/03/14 01:26:27 millert Exp $ */ +/* $OpenBSD: pci_eb164.h,v 1.4 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_eb164.h,v 1.1 1996/11/11 21:08:13 cgd Exp $ */ /* @@ -29,7 +29,3 @@ */ void pci_eb164_pickintr(struct cia_config *); - -#ifdef EVCNT_COUNTERS -extern struct evcnt eb164_intr_evcnt; -#endif diff --git a/sys/arch/alpha/pci/pci_eb64plus.c b/sys/arch/alpha/pci/pci_eb64plus.c index 8589bb87452..a4857570e98 100644 --- a/sys/arch/alpha/pci/pci_eb64plus.c +++ b/sys/arch/alpha/pci/pci_eb64plus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_eb64plus.c,v 1.5 2003/05/10 21:11:12 deraadt Exp $ */ +/* $OpenBSD: pci_eb64plus.c,v 1.6 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_eb64plus.c,v 1.10 2001/07/27 00:25:20 thorpej Exp $ */ /*- @@ -94,7 +94,6 @@ int dec_eb64plus_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *dec_eb64plus_intr_string(void *, pci_intr_handle_t); -const struct evcnt *dec_eb64plus_intr_evcnt(void *, pci_intr_handle_t); void *dec_eb64plus_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void dec_eb64plus_intr_disestablish(void *, void *); diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c index dec0ee5bd47..ba6eb7fd1cc 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.c +++ b/sys/arch/alpha/pci/pci_kn20aa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_kn20aa.c,v 1.19 2003/05/10 21:11:12 deraadt Exp $ */ +/* $OpenBSD: pci_kn20aa.c,v 1.20 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_kn20aa.c,v 1.21 1996/11/17 02:05:27 cgd Exp $ */ /* @@ -49,10 +49,6 @@ #include <alpha/pci/pci_kn20aa.h> -#ifndef EVCNT_COUNTERS -#include <machine/intrcnt.h> -#endif - #include "sio.h" #if NSIO #include <alpha/pci/siovar.h> @@ -71,9 +67,7 @@ void dec_kn20aa_intr_disestablish(void *, void *); #define PCI_STRAY_MAX 5 struct alpha_shared_intr *kn20aa_pci_intr; -#ifdef EVCNT_COUNTERS -struct evcnt kn20aa_intr_evcnt; -#endif +struct evcount kn20aa_intr_count; void kn20aa_iointr(void *framep, unsigned long vec); void kn20aa_enable_intr(int irq); @@ -255,13 +249,7 @@ kn20aa_iointr(framep, vec) panic("kn20aa_iointr: vec 0x%x out of range", vec); irq = (vec - 0x900) >> 4; -#ifdef EVCNT_COUNTERS - kn20aa_intr_evcnt.ev_count++; -#else - if (KN20AA_MAX_IRQ != INTRCNT_KN20AA_IRQ_LEN) - panic("kn20aa interrupt counter sizes inconsistent"); - intrcnt[INTRCNT_KN20AA_IRQ + irq]++; -#endif + kn20aa_intr_count.ec_count++; if (!alpha_shared_intr_dispatch(kn20aa_pci_intr, irq)) { alpha_shared_intr_stray(kn20aa_pci_intr, irq, diff --git a/sys/arch/alpha/pci/pci_kn20aa.h b/sys/arch/alpha/pci/pci_kn20aa.h index 8f656d4406e..b96b9fe7db9 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.h +++ b/sys/arch/alpha/pci/pci_kn20aa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_kn20aa.h,v 1.5 2002/03/14 01:26:27 millert Exp $ */ +/* $OpenBSD: pci_kn20aa.h,v 1.6 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_kn20aa.h,v 1.2 1996/04/13 00:24:35 cgd Exp $ */ /* @@ -29,7 +29,3 @@ */ void pci_kn20aa_pickintr(struct cia_config *); - -#ifdef EVCNT_COUNTERS -extern struct evcnt kn20aa_intr_evcnt; -#endif diff --git a/sys/arch/alpha/pci/pci_up1000.c b/sys/arch/alpha/pci/pci_up1000.c index d615581988d..6fe070eacd9 100644 --- a/sys/arch/alpha/pci/pci_up1000.c +++ b/sys/arch/alpha/pci/pci_up1000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_up1000.c,v 1.7 2001/12/14 00:44:59 nate Exp $ */ +/* $OpenBSD: pci_up1000.c,v 1.8 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: pci_up1000.c,v 1.6 2000/12/28 22:59:07 sommerfeld Exp $ */ /*- @@ -68,7 +68,6 @@ int api_up1000_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *api_up1000_intr_string(void *, pci_intr_handle_t); int api_up1000_intr_line(void *, pci_intr_handle_t); -const struct evcnt *api_up1000_intr_evcnt(void *, pci_intr_handle_t); void *api_up1000_intr_establish(void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *); void api_up1000_intr_disestablish(void *, void *); @@ -87,9 +86,6 @@ pci_up1000_pickintr(struct irongate_config *icp) pc->pc_intr_map = api_up1000_intr_map; pc->pc_intr_string = api_up1000_intr_string; pc->pc_intr_line = api_up1000_intr_line; -#if 0 - pc->pc_intr_evcnt = api_up1000_intr_evcnt; -#endif pc->pc_intr_establish = api_up1000_intr_establish; pc->pc_intr_disestablish = api_up1000_intr_disestablish; @@ -166,18 +162,6 @@ api_up1000_intr_line(void *icv, pci_intr_handle_t ih) return sio_intr_line(NULL /*XXX*/, ih); } -#if 0 -const struct evcnt * -api_up1000_intr_evcnt(void *icv, pci_intr_handle_t ih) -{ -#if 0 - struct irongate_config *icp = icv; -#endif - - return sio_intr_evcnt(NULL /*XXX*/, ih); -} -#endif - void * api_up1000_intr_establish(void *icv, pci_intr_handle_t ih, int level, int (*func)(void *), void *arg, char *name) diff --git a/sys/arch/alpha/pci/sio.c b/sys/arch/alpha/pci/sio.c index 6dc2a6f24d8..e8580c600de 100644 --- a/sys/arch/alpha/pci/sio.c +++ b/sys/arch/alpha/pci/sio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio.c,v 1.28 2004/01/12 19:01:54 deraadt Exp $ */ +/* $OpenBSD: sio.c,v 1.29 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: sio.c,v 1.15 1996/12/05 01:39:36 cgd Exp $ */ /* @@ -168,9 +168,7 @@ sioattach(parent, self, aux) sc->sc_haseisa = (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL && PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_PCEB); -#ifdef EVCNT_COUNTERS - evcnt_attach(&sc->sc_dv, "intr", &sio_intr_evcnt); -#endif + evcount_attach(&sio_intr_count, self->dv_xname, NULL, &evcount_intr); set_pci_isa_bridge_callback(sio_bridge_callback, sc); } diff --git a/sys/arch/alpha/pci/sio_pic.c b/sys/arch/alpha/pci/sio_pic.c index 4b35058438e..84a462cbe0d 100644 --- a/sys/arch/alpha/pci/sio_pic.c +++ b/sys/arch/alpha/pci/sio_pic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio_pic.c,v 1.23 2004/06/18 21:33:42 miod Exp $ */ +/* $OpenBSD: sio_pic.c,v 1.24 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: sio_pic.c,v 1.28 2000/06/06 03:10:13 thorpej Exp $ */ /*- @@ -370,13 +370,6 @@ sio_intr_setup(pc, iot) for (i = 0; i < ICU_LEN; i++) { alpha_shared_intr_set_maxstrays(sio_intr, i, STRAY_MAX); -#ifdef notyet - cp = alpha_shared_intr_string(sio_intr, i); - sprintf(cp, "irq %d", i); - evcnt_attach_dynamic(alpha_shared_intr_evcnt(sio_intr, i), - EVCNT_TYPE_INTR, NULL, "isa", cp); -#endif - switch (i) { case 0: case 1: @@ -453,20 +446,6 @@ sio_intr_line(v, irq) return (irq); } -#ifdef notyet -const struct evcnt * -sio_intr_evcnt(v, irq) - void *v; - int irq; -{ - - if (irq == 0 || irq >= ICU_LEN || irq == 2) - panic("sio_intr_evcnt: bogus isa irq 0x%x", irq); - - return (alpha_shared_intr_evcnt(sio_intr, irq)); -} -#endif - void * sio_intr_establish(v, irq, type, level, fn, arg, name) void *v, *arg; diff --git a/sys/arch/alpha/pci/siovar.h b/sys/arch/alpha/pci/siovar.h index e8798963ec3..a6d2ffaeae1 100644 --- a/sys/arch/alpha/pci/siovar.h +++ b/sys/arch/alpha/pci/siovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siovar.h,v 1.11 2002/03/14 03:15:50 millert Exp $ */ +/* $OpenBSD: siovar.h,v 1.12 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: siovar.h,v 1.5 1996/10/23 04:12:34 cgd Exp $ */ /* @@ -28,6 +28,8 @@ * rights to redistribute these changes. */ +#include <sys/evcount.h> + void sio_intr_setup(pci_chipset_tag_t, bus_space_tag_t); void sio_iointr(void *framep, unsigned long vec); @@ -37,6 +39,4 @@ void *sio_intr_establish(void *, int, int, int, int (*)(void *), void *, char *); void sio_intr_disestablish(void *, void *); -#ifdef EVCNT_COUNTERS -extern struct evcnt sio_intr_evcnt; -#endif +struct evcount sio_intr_count; diff --git a/sys/arch/alpha/tc/ioasic.c b/sys/arch/alpha/tc/ioasic.c index aa5e360149d..6c44ccee234 100644 --- a/sys/arch/alpha/tc/ioasic.c +++ b/sys/arch/alpha/tc/ioasic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioasic.c,v 1.10 2003/05/13 21:32:17 deraadt Exp $ */ +/* $OpenBSD: ioasic.c,v 1.11 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: ioasic.c,v 1.34 2000/07/18 06:10:06 thorpej Exp $ */ /*- @@ -75,7 +75,6 @@ #include <machine/bus.h> #include <machine/pte.h> #include <machine/rpb.h> -#include <machine/intrcnt.h> #include <dev/tc/tcvar.h> #include <dev/tc/ioasicreg.h> @@ -124,9 +123,7 @@ int ioasic_ndevs = sizeof(ioasic_devs) / sizeof(ioasic_devs[0]); struct ioasicintr { int (*iai_func)(void *); void *iai_arg; -#ifdef EVCNT_COUNTERS - struct evcnt iai_evcnt; -#endif + struct evcount iai_count; } ioasicintrs[IOASIC_NCOOKIES]; tc_addr_t ioasic_base; /* XXX XXX XXX */ @@ -166,7 +163,6 @@ ioasicattach(parent, self, aux) u_long ssr; #endif u_long i, imsk; - const struct evcnt *pevcnt; char *cp; ioasicfound = 1; @@ -203,7 +199,6 @@ ioasicattach(parent, self, aux) /* * Set up interrupt handlers. */ - pevcnt = tc_intr_evcnt(parent, ta->ta_cookie); for (i = 0; i < IOASIC_NCOOKIES; i++) { ioasicintrs[i].iai_func = ioasic_intrnull; ioasicintrs[i].iai_arg = (void *)i; @@ -212,10 +207,8 @@ ioasicattach(parent, self, aux) if (cp == NULL) panic("ioasicattach"); snprintf(cp, 12, "slot %lu", i); -#ifdef EVCNT_COUNTERS - evcnt_attach_dynamic(&ioasicintrs[i].iai_evcnt, - EVCNT_TYPE_INTR, pevcnt, self->dv_xname, cp); -#endif + evcount_attach(&ioasicintrs[i].iai_count, self->dv_xname, NULL, + &evcount_intr); } tc_intr_establish(parent, ta->ta_cookie, TC_IPL_NONE, ioasic_intr, sc); @@ -318,17 +311,11 @@ ioasic_intr(val) osir = sir = bus_space_read_4(sc->sc_bst, sc->sc_bsh, IOASIC_INTR); -#ifdef EVCNT_COUNTERS -#define INCRINTRCNT(slot) ioasicintrs[slot].iai_evcnt.ev_count++ -#else -#define INCRINTRCNT(slot) intrcnt[INTRCNT_IOASIC + slot]++ -#endif - /* XXX DUPLICATION OF INTERRUPT BIT INFORMATION... */ #define CHECKINTR(slot, bits, clear) \ if (sir & (bits)) { \ ifound = 1; \ - INCRINTRCNT(slot); \ + ioasicintrs[slot].iai_count.ec_count++; \ (*ioasicintrs[slot].iai_func) \ (ioasicintrs[slot].iai_arg); \ if (clear) \ diff --git a/sys/arch/alpha/tc/tc_3000_300.c b/sys/arch/alpha/tc/tc_3000_300.c index 1c352912f27..08c26d6ad6f 100644 --- a/sys/arch/alpha/tc/tc_3000_300.c +++ b/sys/arch/alpha/tc/tc_3000_300.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tc_3000_300.c,v 1.10 2003/05/13 21:32:17 deraadt Exp $ */ +/* $OpenBSD: tc_3000_300.c,v 1.11 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tc_3000_300.c,v 1.26 2001/07/27 00:25:21 thorpej Exp $ */ /* @@ -35,7 +35,6 @@ #include <machine/autoconf.h> #include <machine/pte.h> -#include <machine/intrcnt.h> #include <dev/tc/tcvar.h> #include <dev/tc/ioasicreg.h> @@ -85,7 +84,7 @@ int tc_3000_300_nbuiltins = struct tcintr { int (*tci_func)(void *); void *tci_arg; - struct evcnt tci_evcnt; + struct evcount tci_count; } tc_3000_300_intr[TC_3000_300_NCOOKIES]; void @@ -112,27 +111,11 @@ tc_3000_300_intr_setup() if (cp == NULL) panic("tc_3000_300_intr_setup"); snprintf(cp, 12, "slot %lu", i); -#ifdef EVCNT_COUNTERS - evcnt_attach_dynamic(&tc_3000_300_intr[i].tci_evcnt, - EVCNT_TYPE_INTR, NULL, "tc", cp); -#endif + evcount_attach(&tc_3000_300_intr[i].tci_count, "tc", NULL, + &evcount_intr); } } -const struct evcnt * -tc_3000_300_intr_evcnt(tcadev, cookie) - struct device *tcadev; - void *cookie; -{ - u_long dev = (u_long)cookie; - -#ifdef DIAGNOSTIC - /* XXX bounds-check cookie. */ -#endif - - return (&tc_3000_300_intr[dev].tci_evcnt); -} - void tc_3000_300_intr_establish(tcadev, cookie, level, func, arg) struct device *tcadev; @@ -249,16 +232,10 @@ tc_3000_300_iointr(arg, vec) ifound = 0; -#ifdef EVCNT_COUNTERS -#define INCRINTRCNT(slot) tc_3000_300_intr[slot].tci_evcnt.ev_count++ -#else -#define INCRINTRCNT(slot) intrcnt[INTRCNT_KN16 + slot]++ -#endif - #define CHECKINTR(slot, flag) \ if (flag) { \ ifound = 1; \ - INCRINTRCNT(slot); \ + tc_3000_300_intr[slot].tci_count.ec_count++; \ (*tc_3000_300_intr[slot].tci_func) \ (tc_3000_300_intr[slot].tci_arg); \ } diff --git a/sys/arch/alpha/tc/tc_3000_500.c b/sys/arch/alpha/tc/tc_3000_500.c index 9dca715fdb8..94aee0a09cd 100644 --- a/sys/arch/alpha/tc/tc_3000_500.c +++ b/sys/arch/alpha/tc/tc_3000_500.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tc_3000_500.c,v 1.11 2003/05/13 21:32:17 deraadt Exp $ */ +/* $OpenBSD: tc_3000_500.c,v 1.12 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tc_3000_500.c,v 1.24 2001/07/27 00:25:21 thorpej Exp $ */ /* @@ -36,7 +36,6 @@ #include <machine/autoconf.h> #include <machine/pte.h> #include <machine/rpb.h> -#include <machine/intrcnt.h> #include <dev/tc/tcvar.h> #include <alpha/tc/tc_conf.h> @@ -104,7 +103,7 @@ u_int32_t tc_3000_500_intrbits[TC_3000_500_NCOOKIES] = { struct tcintr { int (*tci_func)(void *); void *tci_arg; - struct evcnt tci_evcnt; + struct evcount tci_count; } tc_3000_500_intr[TC_3000_500_NCOOKIES]; u_int32_t tc_3000_500_imask; /* intrs we want to ignore; mirrors IMR. */ @@ -136,27 +135,11 @@ tc_3000_500_intr_setup() if (cp == NULL) panic("tc_3000_500_intr_setup"); snprintf(cp, 12, "slot %lu", i); -#ifdef EVCNT_COUNTERS - evcnt_attach_dynamic(&tc_3000_500_intr[i].tci_evcnt, - EVCNT_TYPE_INTR, NULL, "tc", cp); -#endif + evcount_attach(&tc_3000_500_intr[i].tci_count, "tc", NULL, + &evcount_intr); } } -const struct evcnt * -tc_3000_500_intr_evcnt(tcadev, cookie) - struct device *tcadev; - void *cookie; -{ - u_long dev = (u_long)cookie; - -#ifdef DIAGNOSTIC - /* XXX bounds-check cookie. */ -#endif - - return (&tc_3000_500_intr[dev].tci_evcnt); -} - void tc_3000_500_intr_establish(tcadev, cookie, level, func, arg) struct device *tcadev; @@ -241,16 +224,10 @@ tc_3000_500_iointr(arg, vec) ifound = 0; -#ifdef EVCNT_COUNTERS -#define INCRINTRCNT(slot) tc_3000_500_intr[slot].tci_evcnt.ev_count++ -#else -#define INCRINTRCNT(slot) intrcnt[INTRCNT_KN15 + slot]++ -#endif - #define CHECKINTR(slot) \ if (ir & tc_3000_500_intrbits[slot]) { \ ifound = 1; \ - INCRINTRCNT(slot); \ + tc_3000_500_intr[slot].tci_count.ec_count++; \ (*tc_3000_500_intr[slot].tci_func) \ (tc_3000_500_intr[slot].tci_arg); \ } diff --git a/sys/arch/alpha/tc/tc_conf.h b/sys/arch/alpha/tc/tc_conf.h index ec70762c9f9..b4391d67ef8 100644 --- a/sys/arch/alpha/tc/tc_conf.h +++ b/sys/arch/alpha/tc/tc_conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tc_conf.h,v 1.7 2002/05/02 22:56:06 miod Exp $ */ +/* $OpenBSD: tc_conf.h,v 1.8 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tc_conf.h,v 1.10 2000/06/04 19:14:29 cgd Exp $ */ /* @@ -38,8 +38,6 @@ extern void tc_3000_500_intr_setup(void); extern void tc_3000_500_iointr(void *, unsigned long); -extern const struct evcnt * - tc_3000_500_intr_evcnt(struct device *, void *); extern void tc_3000_500_intr_establish(struct device *, void *, tc_intrlevel_t, int (*)(void *), void *); extern void tc_3000_500_intr_disestablish(struct device *, void *); @@ -58,8 +56,6 @@ extern struct tc_builtin tc_3000_500_nographics_builtins[]; extern void tc_3000_300_intr_setup(void); extern void tc_3000_300_iointr(void *, unsigned long); -extern const struct evcnt * - tc_3000_300_intr_evcnt(struct device *, void *); extern void tc_3000_300_intr_establish(struct device *, void *, tc_intrlevel_t, int (*)(void *), void *); extern void tc_3000_300_intr_disestablish(struct device *, void *); diff --git a/sys/arch/alpha/tc/tcasic.c b/sys/arch/alpha/tc/tcasic.c index 1875007363d..6e6cebb5d02 100644 --- a/sys/arch/alpha/tc/tcasic.c +++ b/sys/arch/alpha/tc/tcasic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcasic.c,v 1.12 2002/05/03 00:04:26 millert Exp $ */ +/* $OpenBSD: tcasic.c,v 1.13 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tcasic.c,v 1.36 2001/08/23 01:16:52 nisimura Exp $ */ /* @@ -108,7 +108,6 @@ tcasicattach(parent, self, aux) tba.tba_nbuiltins = tc_3000_500_nographics_nbuiltins; tba.tba_builtins = tc_3000_500_nographics_builtins; } - tba.tba_intr_evcnt = tc_3000_500_intr_evcnt; tba.tba_intr_establish = tc_3000_500_intr_establish; tba.tba_intr_disestablish = tc_3000_500_intr_disestablish; tba.tba_get_dma_tag = tc_dma_get_tag_3000_500; @@ -129,7 +128,6 @@ tcasicattach(parent, self, aux) tba.tba_slots = tc_3000_300_slots; tba.tba_nbuiltins = tc_3000_300_nbuiltins; tba.tba_builtins = tc_3000_300_builtins; - tba.tba_intr_evcnt = tc_3000_300_intr_evcnt; tba.tba_intr_establish = tc_3000_300_intr_establish; tba.tba_intr_disestablish = tc_3000_300_intr_disestablish; tba.tba_get_dma_tag = tc_dma_get_tag_3000_300; diff --git a/sys/dev/tc/ioasicvar.h b/sys/dev/tc/ioasicvar.h index 09b95ac8414..b554e9aff52 100644 --- a/sys/dev/tc/ioasicvar.h +++ b/sys/dev/tc/ioasicvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ioasicvar.h,v 1.6 2002/05/02 22:56:06 miod Exp $ */ +/* $OpenBSD: ioasicvar.h,v 1.7 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: ioasicvar.h,v 1.14 2000/10/17 09:45:49 nisimura Exp $ */ /* @@ -66,7 +66,6 @@ extern struct cfdriver ioasic_cd; */ extern tc_addr_t ioasic_base; -const struct evcnt *ioasic_intr_evcnt(struct device *, void *); void ioasic_intr_establish(struct device *, void *, int, int (*)(void *), void *); void ioasic_intr_disestablish(struct device *, void *); diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c index 8f31502139d..73f5a1cd040 100644 --- a/sys/dev/tc/tc.c +++ b/sys/dev/tc/tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tc.c,v 1.14 2003/04/27 11:22:54 ho Exp $ */ +/* $OpenBSD: tc.c,v 1.15 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tc.c,v 1.29 2001/11/13 06:26:10 lukem Exp $ */ /* @@ -91,7 +91,6 @@ tcattach(parent, self, aux) sc->sc_speed = tba->tba_speed; sc->sc_nslots = tba->tba_nslots; sc->sc_slots = tba->tba_slots; - sc->sc_intr_evcnt = tba->tba_intr_evcnt; sc->sc_intr_establish = tba->tba_intr_establish; sc->sc_intr_disestablish = tba->tba_intr_disestablish; sc->sc_get_dma_tag = tba->tba_get_dma_tag; @@ -262,14 +261,6 @@ tc_checkslot(slotbase, namep) return (0); } -const struct evcnt * -tc_intr_evcnt(struct device *dev, void *cookie) -{ - struct tc_softc *sc = tc_cd.cd_devs[0]; - - return ((*sc->sc_intr_evcnt)(dev, cookie)); -} - void tc_intr_establish(dev, cookie, level, handler, arg) struct device *dev; diff --git a/sys/dev/tc/tcds.c b/sys/dev/tc/tcds.c index 4e7d6947641..22aeaeebf2d 100644 --- a/sys/dev/tc/tcds.c +++ b/sys/dev/tc/tcds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcds.c,v 1.3 2003/09/26 21:43:31 miod Exp $ */ +/* $OpenBSD: tcds.c,v 1.4 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tcds.c,v 1.3 2001/11/13 06:26:10 lukem Exp $ */ /*- @@ -82,10 +82,6 @@ #include <machine/bus.h> -#ifndef EVCNT_COUNTERS -#include <machine/intrcnt.h> -#endif - #include <dev/tc/tcvar.h> #include <dev/tc/tcdsreg.h> #include <dev/tc/tcdsvar.h> @@ -172,7 +168,6 @@ tcdsattach(parent, self, aux) struct tcds_device *td; bus_space_handle_t sbsh[2]; int i, gpi2; - const struct evcnt *pevcnt; td = tcds_lookup(ta->ta_modname); if (td == NULL) @@ -211,7 +206,6 @@ tcdsattach(parent, self, aux) sc->sc_cookie = ta->ta_cookie; - pevcnt = tc_intr_evcnt(parent, sc->sc_cookie); tc_intr_establish(parent, sc->sc_cookie, TC_IPL_BIO, tcds_intr, sc); /* @@ -235,17 +229,11 @@ tcdsattach(parent, self, aux) /* fill in common information first */ for (i = 0; i < 2; i++) { - char *cp; - slotc = &sc->sc_slots[i]; bzero(slotc, sizeof *slotc); /* clear everything */ - cp = slotc->sc_name; - snprintf(cp, sizeof(slotc->sc_name), "chip %d", i); -#ifdef EVCNT_COUNTERS - evcnt_attach_dynamic(&slotc->sc_evcnt, EVCNT_TYPE_INTR, - pevcnt, sc->sc_dv.dv_xname, cp); -#endif + evcount_attach(&slotc->sc_count, sc->sc_dv.dv_xname, NULL, + &evcount_intr); slotc->sc_slot = i; slotc->sc_bst = sc->sc_bst; @@ -502,15 +490,9 @@ tcds_intr(arg) bus_space_write_4(sc->sc_bst, sc->sc_bsh, TCDS_CIR, ir0); tc_syncbus(); -#ifdef EVCNT_COUNTERS -#define INCRINTRCNT(slot) sc->sc_slots[slot].sc_evcnt.ev_count++ -#else -#define INCRINTRCNT(slot) intrcnt[INTRCNT_TCDS + slot]++ -#endif - #define CHECKINTR(slot) \ if (ir & sc->sc_slots[slot].sc_intrbits) { \ - INCRINTRCNT(slot); \ + sc->sc_slots[slot].sc_count.ec_count++; \ (void)(*sc->sc_slots[slot].sc_intrhand) \ (sc->sc_slots[slot].sc_intrarg); \ } diff --git a/sys/dev/tc/tcdsvar.h b/sys/dev/tc/tcdsvar.h index e1470188d10..b5d7a5c8125 100644 --- a/sys/dev/tc/tcdsvar.h +++ b/sys/dev/tc/tcdsvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcdsvar.h,v 1.1 2002/05/02 22:56:06 miod Exp $ */ +/* $OpenBSD: tcdsvar.h,v 1.2 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tcdsvar.h,v 1.2 2001/08/22 05:00:27 nisimura Exp $ */ /* @@ -39,7 +39,7 @@ struct tcds_slotconfig { int (*sc_intrhand)(void *); /* intr. handler */ void *sc_intrarg; /* intr. handler arg. */ - struct evcnt sc_evcnt; /* intr. count */ + struct evcount sc_count; /* intr. count */ char sc_name[8]; /* ev_name */ /* diff --git a/sys/dev/tc/tcvar.h b/sys/dev/tc/tcvar.h index 35a5db9bc30..6d7319a01ea 100644 --- a/sys/dev/tc/tcvar.h +++ b/sys/dev/tc/tcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcvar.h,v 1.11 2003/04/27 11:22:54 ho Exp $ */ +/* $OpenBSD: tcvar.h,v 1.12 2004/06/28 02:28:43 aaron Exp $ */ /* $NetBSD: tcvar.h,v 1.17 2000/06/04 19:15:15 cgd Exp $ */ /* @@ -70,7 +70,6 @@ struct tc_softc { int sc_nslots; struct tc_slotdesc *sc_slots; - const struct evcnt *(*sc_intr_evcnt)(struct device *, void *); void (*sc_intr_establish)(struct device *, void *, int, int (*)(void *), void *); void (*sc_intr_disestablish)(struct device *, void *); @@ -93,7 +92,6 @@ struct tcbus_attach_args { /* TC bus resource management; XXX will move elsewhere eventually. */ - const struct evcnt *(*tba_intr_evcnt)(struct device *, void *); void (*tba_intr_establish)(struct device *, void *, int, int (*)(void *), void *); void (*tba_intr_disestablish)(struct device *, void *); @@ -142,7 +140,6 @@ struct tc_builtin { int tc_checkslot(tc_addr_t, char *); void tc_devinfo(const char *, char *, size_t); void tcattach(struct device *, struct device *, void *); -const struct evcnt *tc_intr_evcnt(struct device *, void *); void tc_intr_establish(struct device *, void *, int, int (*)(void *), void *); void tc_intr_disestablish(struct device *, void *); |