diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi index 8f7c934e4688..ed7a1f88452d 100644 --- a/distrib/sets/lists/comp/mi +++ b/distrib/sets/lists/comp/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.224 2000/06/04 11:52:06 itojun Exp $ +# $NetBSD: mi,v 1.225 2000/06/04 19:14:14 cgd Exp $ ./sys comp-sysutil-root ./usr/bin/addr2line comp-miscutil-bin ./usr/bin/ar comp-util-bin @@ -2596,6 +2596,10 @@ ./usr/share/man/cat9/ether_delmulti.0 comp-kern-catman ./usr/share/man/cat9/ether_ifattach.0 comp-kern-catman ./usr/share/man/cat9/ethersubr.0 comp-kern-catman +./usr/share/man/cat9/evcnt.0 comp-kern-catman +./usr/share/man/cat9/evcnt_attach_dynamic.0 comp-kern-catman +./usr/share/man/cat9/evcnt_attach_static.0 comp-kern-catman +./usr/share/man/cat9/evcnt_detach.0 comp-kern-catman ./usr/share/man/cat9/extent.0 comp-kern-catman ./usr/share/man/cat9/extent_alloc.0 comp-kern-catman ./usr/share/man/cat9/extent_alloc_region.0 comp-kern-catman @@ -4124,6 +4128,10 @@ ./usr/share/man/man9/ether_delmulti.9 comp-kern-man ./usr/share/man/man9/ether_ifattach.9 comp-kern-man ./usr/share/man/man9/ethersubr.9 comp-kern-man +./usr/share/man/man9/evcnt.9 comp-kern-man +./usr/share/man/man9/evcnt_attach_dynamic.9 comp-kern-man +./usr/share/man/man9/evcnt_attach_static.9 comp-kern-man +./usr/share/man/man9/evcnt_detach.9 comp-kern-man ./usr/share/man/man9/extent.9 comp-kern-man ./usr/share/man/man9/extent_alloc.9 comp-kern-man ./usr/share/man/man9/extent_alloc_region.9 comp-kern-man diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index f037fcafbfca..c613d4dd2b90 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.61 2000/05/31 00:40:51 cgd Exp $ +# $NetBSD: Makefile,v 1.62 2000/06/04 19:14:16 cgd Exp $ # Makefile for section 9 (kernel function and variable) manual pages. MAN= access.9 arp.9 audio.9 bus_dma.9 bus_space.9 callout.9 copy.9 \ cpu_reboot.9 ctxsw.9 disk.9 disklabel.9 dopowerhooks.9 \ - doshutdownhooks.9 ethersubr.9 extent.9 fetch.9 fork1.9 \ + doshutdownhooks.9 ethersubr.9 evcnt.9 extent.9 fetch.9 fork1.9 \ humanize_number.9 inittodr.9 intro.9 ioctl.9 kprintf.9 \ log.9 malloc.9 mbuf.9 microtime.9 panic.9 pfil.9 physio.9 pool.9 \ powerhook_establish.9 psignal.9 ratecheck.9 resettodr.9 rnd.9 \ @@ -68,6 +68,8 @@ MLINKS+=ethersubr.9 ether_ifattach.9 ethersubr.9 ether_addmulti.9 \ ethersubr.9 ETHER_FIRST_MULTI.9 ethersubr.9 ETHER_NEXT_MULTI.9 \ ethersubr.9 fddi_ifattach.9 \ ethersubr.9 fddi_addmulti.9 ethersubr.9 fddi_delmulti.9 +MLINKS+=evcnt.9 evcnt_attach_dynamic.9 evcnt.9 evcnt_attach_static.9 \ + evcnt.9 evcnt_detach.9 MLINKS+=extent.9 extent_create.9 extent.9 extent_destroy.9 \ extent.9 extent_alloc.9 extent.9 extent_alloc_subregion.9 \ extent.9 extent_alloc_region.9 extent.9 extent_free.9 \ diff --git a/share/man/man9/evcnt.9 b/share/man/man9/evcnt.9 new file mode 100644 index 000000000000..995bb9c66d86 --- /dev/null +++ b/share/man/man9/evcnt.9 @@ -0,0 +1,316 @@ +.\" $NetBSD: evcnt.9,v 1.1 2000/06/04 19:14:17 cgd Exp $ +.\" +.\" Copyright (c) 2000 Christopher G. Demetriou +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed for the NetBSD Project +.\" by Christopher G. Demetriou. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 1, 2000 +.Dt EVCNT 9 +.Os +.Sh NAME +.Nm evcnt , +.Nm evcnt_attach_dynamic , +.Nm evcnt_attach_static , +.Nm evcnt_detach +.Nd generic event counter framework +.Sh SYNOPSIS +.Fd #include +.Ft void +.Fn evcnt_attach_dynamic "struct evcnt *ev" "int type" "const struct evcnt *parent" "const char *group" "const char *name" +.Ft void +.Fn evcnt_attach_static "struct evcnt *ev" +.Ft void +.Fn evcnt_detach "struct evcnt *ev" +.Sh DESCRIPTION +The +.Nx +generic event counter framework is designed to provide a flexible and +hierarchical event counting facility, which is useful for tracking +system events (including device interrupts). +.Pp +The fundamental component of this framework is the +.Nm evcnt +structure. Its user-accessible fields are: +.Bd -literal +struct evcnt { + u_int64_t ev_count; /* how many have occurred */ + TAILQ_ENTRY(evcnt) ev_list; /* entry on list of all counters */ + unsigned char ev_type; /* counter type; see below */ + unsigned char ev_grouplen; /* 'group' len, excluding NUL */ + unsigned char ev_namelen; /* 'name' len, excluding NUL */ + const struct evcnt *ev_parent; /* parent, for hierarchical ctrs */ + const char *ev_group; /* name of group */ + const char *ev_name; /* name of specific event */ +}; +.Ed +.Pp +The system maintains a global linked list of all active event counters. +This list, called +.Nm allevents , +may grow or shrink over time as event counters are dynamically +added to and removed from the system. +.Pp +Each event counter is marked (in the +.Fa ev_type +field) with the type of event being counted. +The following types are currently defined: +.Bl -tag -offset indent -width EVCNT_TYPE_MISC -compact +.It Ev EVCNT_TYPE_MISC +Miscellaneous; doesn't fit into one of the other types. +.It Ev EVCNT_TYPE_INTR +Interrupt counter, reported by +.Ic vmstat -i . +.El +.Pp +Each event counter also has a group name +.Pq Fa ev_group +and +an event name +.Pq Fa ev_name +which are used to identify the counter. The group name +may be shared by a set of counters. For example, device +interrupt counters would use the name of the device whose +interrupts are being counted as the group name. +The counter +name is meant to distinguish the counter from others in its group +(and need not be unique across groups). +Both names should be understandable by users, since they are printed +by commands like +.Xr vmstat 8 . +The constant +.Dv EVCNT_STRING_MAX +is defined to be the maximum group or event name length in +bytes (including the trailing +.Dv NUL ) . +In the current implementation it is 256. +.Pp +To support hierarchical tracking of events, each event counter can +name a +.Dq parent +event counter. For instance, interrupt dispatch code could have an +event counter per interrupt line, and devices could each have +counters for the number of interrupts that they were responsible for +causing. In that case, the counter for a device on a given interrupt line +would have the line's counter as its parent. +The value +.Dv NULL +is be used to indicate that a counter has no parent. +A counter's parent must be attached before the counter is attached, +and detached after the counter is detached. +.Pp +The +.Fn EVCNT_INITIALIZER +macro can be used to provide a static initializer for an event +counter structure. It is be invoked as +.Fn EVCNT_INITIALIZER "type" "parent" "group" "name" , +and its arguments will be placed into the corresponding fields of +the event counter structure it is initializing. The +.Fa group +and +.Fa name +arguments must be constant strings. +.Pp +The following is a brief description of each function in the framework: +.Bl -tag -width indent +.It Fn "void evcnt_attach_dynamic" "struct evcnt *ev" "int type" "const struct evcnt *parent" "const char *group" "const char *name" +.Pp +Attach the event counter structure pointed to by +.Fa ev +to the system event list. The event counter is cleared and its fields +initialized using the arguments to the function call. +The contents of the remaining elements in the structure (e.g., the +name lengths) are calculated, and the counter is added to the +system event list. +.Pp +The strings specified as the group and +counter names must persist (with the same value) +throughout the life of the event counter; they are referenced by, +not copied into, the counter. +.It Fn "void evcnt_attach_static" "struct evcnt *ev" +.Pp +Attach the statically-initialized event counter structure +pointed to by +.Fa ev +to the system event list. The event counter is assumed to be +statically initialized using the +.Fn EVCNT_INITIALIZER +macro. This function simply calculates structure elements' +values as appropriate (e.g., the string lengths), and adds +the counter to the system event list. +.It Fn "void evcnt_detach" "struct evcnt *ev" +.Pp +Detach the event counter structure pointed to by +.Fa ev +from the system event list. +.El +.Pp +Note that no method is provided to increment the value of an +event counter. Code incrementing an event counter should +do so by directly accessing its +.Fa ev_count +field in a manner that is known to be safe. For instance, +additions to a device's event counters in the interrupt handler +for that device will often be safe without additional protection +(because interrupt handler entries for a given device have to be +serialized). +However, for other uses of event counters, additional locking +or use of machine-dependent atomic operation may be appropriate. +(The overhead of using a mechanism that is guaranteed to +be safe to increment every counter, regardless of actual need +for such a mechanism where the counter is being incremented, +would be too great. On some systems, it might involve a global +lock and several function calls.) +.Sh USING THE FRAMEWORK +This section includes a description on basic use of the framework +and example usage of its functions. +.Pp +Device drivers can use the +.Fn evcnt_attach_dynamic +and +.Fn evcnt_detach +functions to manage device-specific event counters. +Statically configured system modules can use +.Fn evcnt_attach_static +to configure global event counters. Similarly, loadable +modules can use +.Fn evcnt_attach_static +to configure their global event counters, +.Fn evcnt_attach_dynamic +to attach device-specific event +counters, and +.Fn evcnt_detach +to detach all counters when being unloaded. +.Pp +Device drivers that wish to use the generic event counter +framework should place event counter structures in their +.Dq softc +structures. For example, to keep track of the number of interrupts +for a given device (broken down further into +.Dq device readable +and +.Dq device writable +interrupts) a device driver might use: +.Bd -literal +struct foo_softc { + struct device sc_dev; /* generic device information */ + [ . . . ] + struct evcnt sc_ev_intr; /* interrupt count */ + struct evcnt sc_ev_intr_rd; /* 'readable' interrupt count */ + struct evcnt sc_ev_intr_wr; /* 'writable' interrupt count */ + [ . . . ] +}; +.Ed +.Pp +In the device attach function, those counters would be registered with +the system using the +.Fn evcnt_attach_dynamic +function, using code like: +.Bd -literal +void +fooattach(parent, self, aux) + struct device *parent, *self; + void *aux; +{ + struct foo_softc *sc = (struct foo_softc *)self; + + [ . . . ] + + /* Initialize and attach event counters. */ + evcnt_attach_dynamic(&sc->sc_ev, EVCNT_TYPE_INTR, + NULL, sc->sc_dev.dv_xname, "intr"); + evcnt_attach_dynamic(&sc->sc_ev_rd, EVCNT_TYPE_INTR, + &sc->sc_ev, sc->sc_dev.dv_xname, "intr rd"); + evcnt_attach_dynamic(&sc->sc_ev_wr, EVCNT_TYPE_INTR, + &sc->sc_ev, sc->sc_dev.dv_xname, "intr wr"); + + [ . . . ] +} +.Ed +.Pp +If the device can be detached from the system, its detach +function should invoke +.Fn evcnt_detach +on each attached counter (making sure to detach any +.Dq parent +counters only after detaching all children). +.Pp +Code like the following might be used to initialize a static +event counter (in this example, one used to track CPU alignment traps): +.Bd -literal + struct evcnt aligntrap_ev = EVCNT_INITIALIZER(EVCNT_TYPE_MISC, + NULL, "cpu", "aligntrap") +.Ed +.Pp +To attach this event counter, code like the following could be used: +.Bd -literal + evcnt_attach_static(&aligntrap_ev); +.Ed +.Sh CODE REFERENCES +This section describes places within the +.Nx +source tree where actual +code implementing or utilizing the event counter framework can be found. +All pathnames are relative to +.Pa /usr/src . +.Pp +The event counter framework itself is implemented within the file +.Pa sys/kern/subr_autoconf.c . +Data structures and function prototypes for the framework are located in +.Pa sys/sys/device.h . +.Pp +Event counters are used throughout the system. +.Pp +The +.Xr vmstat 8 +source file +.Pa usr.bin/vmstat/vmstat.c +shows an example of how to access event counters from user programs. +.Sh AUTHOR +The +.Nx +generic event counter framework was designed and implemented by +Chris Demetriou . +.Sh SEE ALSO +.Xr vmstat 8 +.Sh HISTORY +A set of interrupt counter interfaces with similar names to the interfaces +in the +.Nx +generic event counter framework appeared as part +of the new autoconfiguration system in +.Bx 4.4 . +Those interfaces were never widely adopted in +.Nx +because of limitations in their applicability. +(Their use was limited to non-hierarchical, dynamically +attached device interrupt counters.) +The +.Nx +generic event counter framework first appeared in +.Nx 1.5 . diff --git a/sys/arch/alpha/alpha/clock.c b/sys/arch/alpha/alpha/clock.c index d14ac5ceb992..5d9f8c3da504 100644 --- a/sys/arch/alpha/alpha/clock.c +++ b/sys/arch/alpha/alpha/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.27 2000/06/03 20:47:36 thorpej Exp $ */ +/* $NetBSD: clock.c,v 1.28 2000/06/04 19:14:18 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,7 +44,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.27 2000/06/03 20:47:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.28 2000/06/04 19:14:18 cgd Exp $"); #include #include @@ -100,7 +100,8 @@ clockattach(dev, fns) clockdev = dev; clockfns = fns; #ifdef EVCNT_COUNTERS - evcnt_attach(dev, "intr", &clock_intr_evcnt); + evcnt_attach_dynamic(&clock_intr_evcnt, EVCNT_TYPE_INTR, NULL, + dev->dv_xname, "intr"); #endif } diff --git a/sys/arch/alpha/include/eisa_machdep.h b/sys/arch/alpha/include/eisa_machdep.h index eac23b972ac8..3489c3b11931 100644 --- a/sys/arch/alpha/include/eisa_machdep.h +++ b/sys/arch/alpha/include/eisa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: eisa_machdep.h,v 1.4 2000/06/01 00:04:50 cgd Exp $ */ +/* $NetBSD: eisa_machdep.h,v 1.5 2000/06/04 19:14:18 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -41,6 +41,7 @@ struct alpha_eisa_chipset { int (*ec_maxslots)(void *); int (*ec_intr_map)(void *, u_int, eisa_intr_handle_t *); const char *(*ec_intr_string)(void *, eisa_intr_handle_t); + const struct evcnt *(*ec_intr_evcnt)(void *, eisa_intr_handle_t); void *(*ec_intr_establish)(void *, eisa_intr_handle_t, int, int, int (*)(void *), void *); void (*ec_intr_disestablish)(void *, void *); @@ -57,6 +58,8 @@ struct alpha_eisa_chipset { (*(c)->ec_intr_map)((c)->ec_v, (i), (hp)) #define eisa_intr_string(c, h) \ (*(c)->ec_intr_string)((c)->ec_v, (h)) +#define eisa_intr_evcnt(c, h) \ + (*(c)->ec_intr_evcnt)((c)->ec_v, (h)) #define eisa_intr_establish(c, h, t, l, f, a) \ (*(c)->ec_intr_establish)((c)->ec_v, (h), (t), (l), (f), (a)) #define eisa_intr_disestablish(c, h) \ diff --git a/sys/arch/alpha/include/isa_machdep.h b/sys/arch/alpha/include/isa_machdep.h index 2a2e8e27ef7f..36bf17768b6f 100644 --- a/sys/arch/alpha/include/isa_machdep.h +++ b/sys/arch/alpha/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.6 2000/06/01 03:55:45 thorpej Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.7 2000/06/04 19:14:19 cgd Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -77,6 +77,7 @@ struct alpha_isa_chipset { void (*ic_attach_hook)(struct device *, struct device *, struct isabus_attach_args *); + const struct evcnt *(*ic_intr_evcnt)(void *, int); void *(*ic_intr_establish)(void *, int, int, int, int (*)(void *), void *); void (*ic_intr_disestablish)(void *, void *); @@ -89,6 +90,8 @@ struct alpha_isa_chipset { */ #define isa_attach_hook(p, s, a) \ (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) +#define isa_intr_evcnt(c, i) \ + (*(c)->ic_intr_evcnt)((c)->ic_v, (i)) #define isa_intr_establish(c, i, t, l, f, a) \ (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a)) #define isa_intr_disestablish(c, h) \ diff --git a/sys/arch/alpha/include/pci_machdep.h b/sys/arch/alpha/include/pci_machdep.h index b1afa31bf9f3..b83315aaf4f5 100644 --- a/sys/arch/alpha/include/pci_machdep.h +++ b/sys/arch/alpha/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.4 2000/06/01 00:04:50 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.5 2000/06/04 19:14:19 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -60,6 +60,7 @@ struct alpha_pci_chipset { int (*pc_intr_map)(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *(*pc_intr_string)(void *, pci_intr_handle_t); + const struct evcnt *(*pc_intr_evcnt)(void *, pci_intr_handle_t); void *(*pc_intr_establish)(void *, pci_intr_handle_t, int, int (*)(void *), void *); void (*pc_intr_disestablish)(void *, void *); @@ -89,6 +90,8 @@ struct alpha_pci_chipset { (*(c)->pc_intr_map)((c)->pc_intr_v, (it), (ip), (il), (ihp)) #define pci_intr_string(c, ih) \ (*(c)->pc_intr_string)((c)->pc_intr_v, (ih)) +#define pci_intr_evcnt(c, ih) \ + (*(c)->pc_intr_evcnt)((c)->pc_intr_v, (ih)) #define pci_intr_establish(c, ih, l, h, a) \ (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a)) #define pci_intr_disestablish(c, iv) \ diff --git a/sys/arch/alpha/pci/a12c.c b/sys/arch/alpha/pci/a12c.c index 0e34f3437ab4..30ab039b595c 100644 --- a/sys/arch/alpha/pci/a12c.c +++ b/sys/arch/alpha/pci/a12c.c @@ -1,4 +1,4 @@ -/* $NetBSD: a12c.c,v 1.5 1999/11/04 19:15:22 thorpej Exp $ */ +/* $NetBSD: a12c.c,v 1.6 2000/06/04 19:14:19 cgd Exp $ */ /* [Notice revision 2.2] * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc. @@ -38,7 +38,7 @@ #include "opt_avalon_a12.h" /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.5 1999/11/04 19:15:22 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.6 2000/06/04 19:14:19 cgd Exp $"); #include #include @@ -144,12 +144,13 @@ a12cattach(parent, self, aux) a12c_init(ccp, 1); /* XXX print chipset information */ - printf(": driver %s over logic %x\n", "$Revision: 1.5 $", + printf(": driver %s over logic %x\n", "$Revision: 1.6 $", A12_ALL_EXTRACT(REGVAL(A12_VERS))); pci_a12_pickintr(ccp); #ifdef EVCNT_COUNTERS - evcnt_attach(self, "intr", &a12_intr_evcnt); + evcnt_attach_dynamic(&a12_intr_evcnt, EVCNT_TYPE_INTR, NULL, + self->dv_xname, "intr"); #endif clockfns = &noclock_fns; /* XXX? */ diff --git a/sys/arch/alpha/pci/dwlpx.c b/sys/arch/alpha/pci/dwlpx.c index 54a41a6301aa..6dc5f1851ffa 100644 --- a/sys/arch/alpha/pci/dwlpx.c +++ b/sys/arch/alpha/pci/dwlpx.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwlpx.c,v 1.19 1999/11/04 19:15:22 thorpej Exp $ */ +/* $NetBSD: dwlpx.c,v 1.20 2000/06/04 19:14:19 cgd Exp $ */ /* * Copyright (c) 1997 by Matthew Jacob @@ -32,7 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.19 1999/11/04 19:15:22 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.20 2000/06/04 19:14:19 cgd Exp $"); #include #include @@ -159,7 +159,8 @@ dwlpxattach(parent, self, aux) */ pci_kn8ae_pickintr(&sc->dwlpx_cc, 1); #ifdef EVCNT_COUNTERS - evcnt_attach(self, "intr", kn8ae_intr_evcnt); + evcnt_attach_dynamic(kn8ae_intr_evcnt, EVCNT_TYPE_INTR, NULL, + self->dv_xname, "intr"); #endif once++; } else { diff --git a/sys/arch/alpha/pci/mcpcia.c b/sys/arch/alpha/pci/mcpcia.c index b252259a9c07..205816879bd4 100644 --- a/sys/arch/alpha/pci/mcpcia.c +++ b/sys/arch/alpha/pci/mcpcia.c @@ -1,4 +1,4 @@ -/* $NetBSD: mcpcia.c,v 1.7 1999/11/16 18:33:11 mjacob Exp $ */ +/* $NetBSD: mcpcia.c,v 1.8 2000/06/04 19:14:20 cgd Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.7 1999/11/16 18:33:11 mjacob Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.8 2000/06/04 19:14:20 cgd Exp $"); #include #include @@ -202,7 +202,8 @@ mcpciaattach(parent, self, aux) pci_kn300_pickintr(ccp, first); #ifdef EVCNT_COUNTERS if (first == 1) { - evcnt_attach(self, "intr", kn300_intr_evcnt); + evcnt_attach_dynamic(kn300_intr_evcnt, EVCNT_TYPE_INTR, NULL, + self->dv_xname, "intr"); first = 0; } #else diff --git a/sys/arch/alpha/pci/pci_1000.c b/sys/arch/alpha/pci/pci_1000.c index a887bc620254..a4414a6a2cd3 100644 --- a/sys/arch/alpha/pci/pci_1000.c +++ b/sys/arch/alpha/pci/pci_1000.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_1000.c,v 1.7 1999/12/15 22:30:40 thorpej Exp $ */ +/* $NetBSD: pci_1000.c,v 1.8 2000/06/04 19:14:20 cgd Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_1000.c,v 1.7 1999/12/15 22:30:40 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_1000.c,v 1.8 2000/06/04 19:14:20 cgd Exp $"); #include #include @@ -99,6 +99,7 @@ static bus_space_handle_t another_mystery_icu_ioh; int dec_1000_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_1000_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_1000_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_1000_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_1000_intr_disestablish __P((void *, void *)); @@ -129,6 +130,7 @@ pci_1000_pickintr(core, iot, memt, pc) pc->pc_intr_v = core; pc->pc_intr_map = dec_1000_intr_map; pc->pc_intr_string = dec_1000_intr_string; + pc->pc_intr_evcnt = dec_1000_intr_evcnt; pc->pc_intr_establish = dec_1000_intr_establish; pc->pc_intr_disestablish = dec_1000_intr_disestablish; @@ -194,6 +196,16 @@ dec_1000_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_1000_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_1000_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_1000a.c b/sys/arch/alpha/pci/pci_1000a.c index fec0b732291e..f5c3e4fc300a 100644 --- a/sys/arch/alpha/pci/pci_1000a.c +++ b/sys/arch/alpha/pci/pci_1000a.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_1000a.c,v 1.9 1999/12/15 22:31:04 thorpej Exp $ */ +/* $NetBSD: pci_1000a.c,v 1.10 2000/06/04 19:14:20 cgd Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_1000a.c,v 1.9 1999/12/15 22:31:04 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_1000a.c,v 1.10 2000/06/04 19:14:20 cgd Exp $"); #include #include @@ -105,6 +105,7 @@ static bus_space_handle_t mystery_icu_ioh[2]; int dec_1000a_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_1000a_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_1000a_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_1000a_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_1000a_intr_disestablish __P((void *, void *)); @@ -134,6 +135,7 @@ pci_1000a_pickintr(core, iot, memt, pc) pc->pc_intr_v = core; pc->pc_intr_map = dec_1000a_intr_map; pc->pc_intr_string = dec_1000a_intr_string; + pc->pc_intr_evcnt = dec_1000a_intr_evcnt; pc->pc_intr_establish = dec_1000a_intr_establish; pc->pc_intr_disestablish = dec_1000a_intr_disestablish; @@ -216,6 +218,16 @@ dec_1000a_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_1000a_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_1000a_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_2100_a50.c b/sys/arch/alpha/pci/pci_2100_a50.c index 8fb55d7608fe..cb7e417787e1 100644 --- a/sys/arch/alpha/pci/pci_2100_a50.c +++ b/sys/arch/alpha/pci/pci_2100_a50.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_2100_a50.c,v 1.25 1998/11/19 02:35:39 ross Exp $ */ +/* $NetBSD: pci_2100_a50.c,v 1.26 2000/06/04 19:14:21 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.25 1998/11/19 02:35:39 ross Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.26 2000/06/04 19:14:21 cgd Exp $"); #include #include @@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.25 1998/11/19 02:35:39 ross Exp $ int dec_2100_a50_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_2100_a50_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_2100_a50_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_2100_a50_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_2100_a50_intr_disestablish __P((void *, void *)); @@ -84,6 +85,7 @@ pci_2100_a50_pickintr(acp) pc->pc_intr_v = acp; pc->pc_intr_map = dec_2100_a50_intr_map; pc->pc_intr_string = dec_2100_a50_intr_string; + pc->pc_intr_evcnt = dec_2100_a50_intr_evcnt; pc->pc_intr_establish = dec_2100_a50_intr_establish; pc->pc_intr_disestablish = dec_2100_a50_intr_disestablish; @@ -231,6 +233,18 @@ dec_2100_a50_intr_string(acv, ih) return sio_intr_string(NULL /*XXX*/, ih); } +const struct evcnt * +dec_2100_a50_intr_evcnt(acv, ih) + void *acv; + pci_intr_handle_t ih; +{ +#if 0 + struct apecs_config *acp = acv; +#endif + + return sio_intr_evcnt(NULL /*XXX*/, ih); +} + void * dec_2100_a50_intr_establish(acv, ih, level, func, arg) void *acv, *arg; diff --git a/sys/arch/alpha/pci/pci_550.c b/sys/arch/alpha/pci/pci_550.c index 709e50d2bc17..83d57fce08a4 100644 --- a/sys/arch/alpha/pci/pci_550.c +++ b/sys/arch/alpha/pci/pci_550.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_550.c,v 1.14 2000/03/19 02:25:29 thorpej Exp $ */ +/* $NetBSD: pci_550.c,v 1.15 2000/06/04 19:14:21 cgd Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.14 2000/03/19 02:25:29 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.15 2000/06/04 19:14:21 cgd Exp $"); #include #include @@ -104,6 +104,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_550.c,v 1.14 2000/03/19 02:25:29 thorpej Exp $") int dec_550_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_550_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_550_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_550_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_550_intr_disestablish __P((void *, void *)); @@ -150,6 +151,7 @@ pci_550_pickintr(ccp) pc->pc_intr_v = ccp; pc->pc_intr_map = dec_550_intr_map; pc->pc_intr_string = dec_550_intr_string; + pc->pc_intr_evcnt = dec_550_intr_evcnt; pc->pc_intr_establish = dec_550_intr_establish; pc->pc_intr_disestablish = dec_550_intr_disestablish; @@ -281,6 +283,25 @@ dec_550_intr_string(ccv, ih) return (irqstr); } +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 + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_550_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_6600.c b/sys/arch/alpha/pci/pci_6600.c index ac01f03ef3f6..e91cffefb427 100644 --- a/sys/arch/alpha/pci/pci_6600.c +++ b/sys/arch/alpha/pci/pci_6600.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_6600.c,v 1.2 2000/03/19 02:25:29 thorpej Exp $ */ +/* $NetBSD: pci_6600.c,v 1.3 2000/06/04 19:14:21 cgd Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.2 2000/03/19 02:25:29 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_6600.c,v 1.3 2000/06/04 19:14:21 cgd Exp $"); #include #include @@ -84,6 +84,7 @@ void dec_6600_intr_disestablish __P((void *, void *)); void *dec_6600_intr_establish __P(( void *, pci_intr_handle_t, int, int (*func)(void *), void *)); const char *dec_6600_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_6600_intr_evcnt __P((void *, pci_intr_handle_t)); int dec_6600_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); void *dec_6600_pciide_compat_intr_establish __P((void *, struct device *, struct pci_attach_args *, int, int (*)(void *), void *)); @@ -105,6 +106,7 @@ pci_6600_pickintr(pcp) pc->pc_intr_v = pcp; pc->pc_intr_map = dec_6600_intr_map; pc->pc_intr_string = dec_6600_intr_string; + pc->pc_intr_evcnt = dec_6600_intr_evcnt; pc->pc_intr_establish = dec_6600_intr_establish; pc->pc_intr_disestablish = dec_6600_intr_disestablish; pc->pc_pciide_compat_intr_establish = NULL; @@ -198,6 +200,22 @@ dec_6600_intr_string(acv, ih) return (irqstr); } +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 + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_6600_intr_establish(acv, ih, level, func, arg) void *acv, *arg; diff --git a/sys/arch/alpha/pci/pci_a12.c b/sys/arch/alpha/pci/pci_a12.c index d567fc97c399..ed726b3497bd 100644 --- a/sys/arch/alpha/pci/pci_a12.c +++ b/sys/arch/alpha/pci/pci_a12.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_a12.c,v 1.4 1998/04/24 01:25:18 mjacob Exp $ */ +/* $NetBSD: pci_a12.c,v 1.5 2000/06/04 19:14:22 cgd Exp $ */ /* [Notice revision 2.0] * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc. @@ -38,7 +38,7 @@ #include "opt_avalon_a12.h" /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_a12.c,v 1.4 1998/04/24 01:25:18 mjacob Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_a12.c,v 1.5 2000/06/04 19:14:22 cgd Exp $"); #include #include @@ -110,6 +110,7 @@ struct evcnt a12_intr_evcnt; int avalon_a12_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *avalon_a12_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *avalon_a12_intr_evcnt __P((void *, pci_intr_handle_t)); void *avalon_a12_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void avalon_a12_intr_disestablish __P((void *, void *)); @@ -128,6 +129,7 @@ pci_a12_pickintr(ccp) pc->pc_intr_v = ccp; pc->pc_intr_map = avalon_a12_intr_map; pc->pc_intr_string = avalon_a12_intr_string; + pc->pc_intr_evcnt = avalon_a12_intr_evcnt; pc->pc_intr_establish = avalon_a12_intr_establish; pc->pc_intr_disestablish = avalon_a12_intr_disestablish; @@ -157,6 +159,16 @@ avalon_a12_intr_string(ccv, ih) return "a12 pci irq"; /* see "only one" note above */ } +const struct evcnt * +avalon_a12_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * avalon_a12_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_alphabook1.c b/sys/arch/alpha/pci/pci_alphabook1.c index 1bbd12d43bab..e9435c358a35 100644 --- a/sys/arch/alpha/pci/pci_alphabook1.c +++ b/sys/arch/alpha/pci/pci_alphabook1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_alphabook1.c,v 1.2 1998/11/19 02:35:39 ross Exp $ */ +/* $NetBSD: pci_alphabook1.c,v 1.3 2000/06/04 19:14:22 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_alphabook1.c,v 1.2 1998/11/19 02:35:39 ross Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_alphabook1.c,v 1.3 2000/06/04 19:14:22 cgd Exp $"); #include #include @@ -96,6 +96,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_alphabook1.c,v 1.2 1998/11/19 02:35:39 ross Exp int dec_alphabook1_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_alphabook1_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_alphabook1_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_alphabook1_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_alphabook1_intr_disestablish __P((void *, void *)); @@ -122,6 +123,7 @@ pci_alphabook1_pickintr(lcp) pc->pc_intr_v = lcp; pc->pc_intr_map = dec_alphabook1_intr_map; pc->pc_intr_string = dec_alphabook1_intr_string; + pc->pc_intr_evcnt = dec_alphabook1_intr_evcnt; pc->pc_intr_establish = dec_alphabook1_intr_establish; pc->pc_intr_disestablish = dec_alphabook1_intr_disestablish; @@ -197,6 +199,18 @@ dec_alphabook1_intr_string(lcv, ih) return sio_intr_string(NULL /*XXX*/, ih); } +const struct evcnt * +dec_alphabook1_intr_evcnt(lcv, ih) + void *lcv; + pci_intr_handle_t ih; +{ +#if 0 + struct lca_config *lcp = lcv; +#endif + + return sio_intr_evcnt(NULL /*XXX*/, ih); +} + void * dec_alphabook1_intr_establish(lcv, ih, level, func, arg) void *lcv, *arg; diff --git a/sys/arch/alpha/pci/pci_axppci_33.c b/sys/arch/alpha/pci/pci_axppci_33.c index 884c3127d8cc..7a6f47266b90 100644 --- a/sys/arch/alpha/pci/pci_axppci_33.c +++ b/sys/arch/alpha/pci/pci_axppci_33.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_axppci_33.c,v 1.22 1998/11/19 02:35:39 ross Exp $ */ +/* $NetBSD: pci_axppci_33.c,v 1.23 2000/06/04 19:14:22 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.22 1998/11/19 02:35:39 ross Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.23 2000/06/04 19:14:22 cgd Exp $"); #include #include @@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.22 1998/11/19 02:35:39 ross Exp int dec_axppci_33_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_axppci_33_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_axppci_33_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_axppci_33_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_axppci_33_intr_disestablish __P((void *, void *)); @@ -85,6 +86,7 @@ pci_axppci_33_pickintr(lcp) pc->pc_intr_v = lcp; pc->pc_intr_map = dec_axppci_33_intr_map; pc->pc_intr_string = dec_axppci_33_intr_string; + pc->pc_intr_evcnt = dec_axppci_33_intr_evcnt; pc->pc_intr_establish = dec_axppci_33_intr_establish; pc->pc_intr_disestablish = dec_axppci_33_intr_disestablish; @@ -231,6 +233,18 @@ dec_axppci_33_intr_string(lcv, ih) return sio_intr_string(NULL /*XXX*/, ih); } +const struct evcnt * +dec_axppci_33_intr_evcnt(lcv, ih) + void *lcv; + pci_intr_handle_t ih; +{ +#if 0 + struct lca_config *lcp = lcv; +#endif + + return sio_intr_evcnt(NULL /*XXX*/, ih); +} + void * dec_axppci_33_intr_establish(lcv, ih, level, func, arg) void *lcv, *arg; diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c index 3b71ec431aec..527d3d98dc58 100644 --- a/sys/arch/alpha/pci/pci_eb164.c +++ b/sys/arch/alpha/pci/pci_eb164.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_eb164.c,v 1.24 1999/02/12 06:25:13 thorpej Exp $ */ +/* $NetBSD: pci_eb164.c,v 1.25 2000/06/04 19:14:23 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.24 1999/02/12 06:25:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.25 2000/06/04 19:14:23 cgd Exp $"); #include #include @@ -104,6 +104,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.24 1999/02/12 06:25:13 thorpej Exp $ int dec_eb164_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_eb164_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_eb164_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_eb164_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_eb164_intr_disestablish __P((void *, void *)); @@ -138,6 +139,7 @@ pci_eb164_pickintr(ccp) pc->pc_intr_v = ccp; pc->pc_intr_map = dec_eb164_intr_map; pc->pc_intr_string = dec_eb164_intr_string; + pc->pc_intr_evcnt = dec_eb164_intr_evcnt; pc->pc_intr_establish = dec_eb164_intr_establish; pc->pc_intr_disestablish = dec_eb164_intr_disestablish; @@ -261,6 +263,19 @@ dec_eb164_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_eb164_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ +#if 0 + struct cia_config *ccp = ccv; +#endif + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_eb164_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_eb64plus.c b/sys/arch/alpha/pci/pci_eb64plus.c index 3f1fcd1ab5d8..d4fb81014fda 100644 --- a/sys/arch/alpha/pci/pci_eb64plus.c +++ b/sys/arch/alpha/pci/pci_eb64plus.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_eb64plus.c,v 1.5 1999/02/12 06:25:13 thorpej Exp $ */ +/* $NetBSD: pci_eb64plus.c,v 1.6 2000/06/04 19:14:23 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_eb64plus.c,v 1.5 1999/02/12 06:25:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_eb64plus.c,v 1.6 2000/06/04 19:14:23 cgd Exp $"); #include #include @@ -101,6 +101,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_eb64plus.c,v 1.5 1999/02/12 06:25:13 thorpej Exp int dec_eb64plus_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_eb64plus_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_eb64plus_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_eb64plus_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_eb64plus_intr_disestablish __P((void *, void *)); @@ -131,6 +132,7 @@ pci_eb64plus_pickintr(acp) pc->pc_intr_v = acp; pc->pc_intr_map = dec_eb64plus_intr_map; pc->pc_intr_string = dec_eb64plus_intr_string; + pc->pc_intr_evcnt = dec_eb64plus_intr_evcnt; pc->pc_intr_establish = dec_eb64plus_intr_establish; pc->pc_intr_disestablish = dec_eb64plus_intr_disestablish; @@ -209,6 +211,16 @@ dec_eb64plus_intr_string(acv, ih) return (irqstr); } +const struct evcnt * +dec_eb64plus_intr_evcnt(acv, ih) + void *acv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_eb64plus_intr_establish(acv, ih, level, func, arg) void *acv, *arg; diff --git a/sys/arch/alpha/pci/pci_eb66.c b/sys/arch/alpha/pci/pci_eb66.c index 2462d072f8fc..eace83321ccc 100644 --- a/sys/arch/alpha/pci/pci_eb66.c +++ b/sys/arch/alpha/pci/pci_eb66.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_eb66.c,v 1.5 1999/02/12 06:25:13 thorpej Exp $ */ +/* $NetBSD: pci_eb66.c,v 1.6 2000/06/04 19:14:24 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_eb66.c,v 1.5 1999/02/12 06:25:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_eb66.c,v 1.6 2000/06/04 19:14:24 cgd Exp $"); #include #include @@ -99,6 +99,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_eb66.c,v 1.5 1999/02/12 06:25:13 thorpej Exp $") int dec_eb66_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_eb66_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_eb66_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_eb66_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_eb66_intr_disestablish __P((void *, void *)); @@ -126,6 +127,7 @@ pci_eb66_pickintr(lcp) pc->pc_intr_v = lcp; pc->pc_intr_map = dec_eb66_intr_map; pc->pc_intr_string = dec_eb66_intr_string; + pc->pc_intr_evcnt = dec_eb66_intr_evcnt; pc->pc_intr_establish = dec_eb66_intr_establish; pc->pc_intr_disestablish = dec_eb66_intr_disestablish; @@ -204,6 +206,16 @@ dec_eb66_intr_string(lcv, ih) return (irqstr); } +const struct evcnt * +dec_eb66_intr_evcnt(lcv, ih) + void *lcv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_eb66_intr_establish(lcv, ih, level, func, arg) void *lcv, *arg; diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c index 5cd8bd388b0e..47c367c4283d 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.c +++ b/sys/arch/alpha/pci/pci_kn20aa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_kn20aa.c,v 1.37 1999/12/15 22:28:15 thorpej Exp $ */ +/* $NetBSD: pci_kn20aa.c,v 1.38 2000/06/04 19:14:24 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_kn20aa.c,v 1.37 1999/12/15 22:28:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_kn20aa.c,v 1.38 2000/06/04 19:14:24 cgd Exp $"); #include #include @@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_kn20aa.c,v 1.37 1999/12/15 22:28:15 thorpej Exp int dec_kn20aa_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_kn20aa_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_kn20aa_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_kn20aa_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_kn20aa_intr_disestablish __P((void *, void *)); @@ -94,6 +95,7 @@ pci_kn20aa_pickintr(ccp) pc->pc_intr_v = ccp; pc->pc_intr_map = dec_kn20aa_intr_map; pc->pc_intr_string = dec_kn20aa_intr_string; + pc->pc_intr_evcnt = dec_kn20aa_intr_evcnt; pc->pc_intr_establish = dec_kn20aa_intr_establish; pc->pc_intr_disestablish = dec_kn20aa_intr_disestablish; @@ -197,6 +199,19 @@ dec_kn20aa_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_kn20aa_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ +#if 0 + struct cia_config *ccp = ccv; +#endif + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_kn20aa_intr_establish(ccv, ih, level, func, arg) void *ccv, *arg; diff --git a/sys/arch/alpha/pci/pci_kn300.c b/sys/arch/alpha/pci/pci_kn300.c index 04888f3e24bc..fc9be2420ca1 100644 --- a/sys/arch/alpha/pci/pci_kn300.c +++ b/sys/arch/alpha/pci/pci_kn300.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_kn300.c,v 1.18 2000/02/10 07:45:43 mjacob Exp $ */ +/* $NetBSD: pci_kn300.c,v 1.19 2000/06/04 19:14:24 cgd Exp $ */ /* * Copyright (c) 1998 by Matthew Jacob @@ -32,7 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_kn300.c,v 1.18 2000/02/10 07:45:43 mjacob Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_kn300.c,v 1.19 2000/06/04 19:14:24 cgd Exp $"); #include #include @@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_kn300.c,v 1.18 2000/02/10 07:45:43 mjacob Exp $" int dec_kn300_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_kn300_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_kn300_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_kn300_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_kn300_intr_disestablish __P((void *, void *)); @@ -111,6 +112,7 @@ pci_kn300_pickintr(ccp, first) pc->pc_intr_v = ccp; pc->pc_intr_map = dec_kn300_intr_map; pc->pc_intr_string = dec_kn300_intr_string; + pc->pc_intr_evcnt = dec_kn300_intr_evcnt; pc->pc_intr_establish = dec_kn300_intr_establish; pc->pc_intr_disestablish = dec_kn300_intr_disestablish; @@ -193,6 +195,16 @@ dec_kn300_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_kn300_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_kn300_intr_establish(ccv, ih, level, func, arg) void *ccv; diff --git a/sys/arch/alpha/pci/pci_kn8ae.c b/sys/arch/alpha/pci/pci_kn8ae.c index 49601beb2512..bcad9a396d08 100644 --- a/sys/arch/alpha/pci/pci_kn8ae.c +++ b/sys/arch/alpha/pci/pci_kn8ae.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_kn8ae.c,v 1.14 1999/02/12 06:25:14 thorpej Exp $ */ +/* $NetBSD: pci_kn8ae.c,v 1.15 2000/06/04 19:14:25 cgd Exp $ */ /* * Copyright (c) 1997 by Matthew Jacob @@ -32,7 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_kn8ae.c,v 1.14 1999/02/12 06:25:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_kn8ae.c,v 1.15 2000/06/04 19:14:25 cgd Exp $"); #include #include @@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_kn8ae.c,v 1.14 1999/02/12 06:25:14 thorpej Exp $ int dec_kn8ae_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *dec_kn8ae_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *dec_kn8ae_intr_evcnt __P((void *, pci_intr_handle_t)); void *dec_kn8ae_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *)); void dec_kn8ae_intr_disestablish __P((void *, void *)); @@ -92,6 +93,7 @@ pci_kn8ae_pickintr(ccp, first) pc->pc_intr_v = ccp; pc->pc_intr_map = dec_kn8ae_intr_map; pc->pc_intr_string = dec_kn8ae_intr_string; + pc->pc_intr_evcnt = dec_kn8ae_intr_evcnt; pc->pc_intr_establish = dec_kn8ae_intr_establish; pc->pc_intr_disestablish = dec_kn8ae_intr_disestablish; @@ -165,6 +167,16 @@ dec_kn8ae_intr_string(ccv, ih) return (irqstr); } +const struct evcnt * +dec_kn8ae_intr_evcnt(ccv, ih) + void *ccv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * dec_kn8ae_intr_establish(ccv, ih, level, func, arg) void *ccv; diff --git a/sys/arch/alpha/pci/pci_up1000.c b/sys/arch/alpha/pci/pci_up1000.c index 96b91d1f6c17..ba9f56270fd7 100644 --- a/sys/arch/alpha/pci/pci_up1000.c +++ b/sys/arch/alpha/pci/pci_up1000.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_up1000.c,v 1.1 2000/06/01 20:30:31 thorpej Exp $ */ +/* $NetBSD: pci_up1000.c,v 1.2 2000/06/04 19:14:25 cgd Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_up1000.c,v 1.1 2000/06/01 20:30:31 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_up1000.c,v 1.2 2000/06/04 19:14:25 cgd Exp $"); #include #include @@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_up1000.c,v 1.1 2000/06/01 20:30:31 thorpej Exp $ 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); +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 *); void api_up1000_intr_disestablish(void *, void *); @@ -86,6 +87,7 @@ pci_up1000_pickintr(struct irongate_config *icp) pc->pc_intr_v = icp; pc->pc_intr_map = api_up1000_intr_map; pc->pc_intr_string = api_up1000_intr_string; + pc->pc_intr_evcnt = api_up1000_intr_evcnt; pc->pc_intr_establish = api_up1000_intr_establish; pc->pc_intr_disestablish = api_up1000_intr_disestablish; @@ -155,6 +157,16 @@ api_up1000_intr_string(void *icv, pci_intr_handle_t ih) return sio_intr_string(NULL /*XXX*/, ih); } +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); +} + void * api_up1000_intr_establish(void *icv, pci_intr_handle_t ih, int level, int (*func)(void *), void *arg) diff --git a/sys/arch/alpha/pci/sio.c b/sys/arch/alpha/pci/sio.c index f52c9d40db65..21de1a6dc0aa 100644 --- a/sys/arch/alpha/pci/sio.c +++ b/sys/arch/alpha/pci/sio.c @@ -1,4 +1,4 @@ -/* $NetBSD: sio.c,v 1.27 1999/11/12 22:07:28 lukem Exp $ */ +/* $NetBSD: sio.c,v 1.28 2000/06/04 19:14:25 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: sio.c,v 1.27 1999/11/12 22:07:28 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sio.c,v 1.28 2000/06/04 19:14:25 cgd Exp $"); #include #include @@ -155,7 +155,8 @@ sioattach(parent, self, aux) PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CONTAQ_82C693); #ifdef EVCNT_COUNTERS - evcnt_attach(&sc->sc_dv, "intr", &sio_intr_evcnt); + evcnt_attach_dynamic(&sio_intr_evcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dv.dv_xname, "intr"); #endif config_defer(self, sio_bridge_callback); @@ -175,6 +176,7 @@ sio_bridge_callback(self) ec.ec_maxslots = sio_eisa_maxslots; ec.ec_intr_map = sio_eisa_intr_map; ec.ec_intr_string = sio_intr_string; + ec.ec_intr_evcnt = sio_intr_evcnt; ec.ec_intr_establish = sio_intr_establish; ec.ec_intr_disestablish = sio_intr_disestablish; @@ -189,6 +191,7 @@ sio_bridge_callback(self) sc->sc_isa_chipset.ic_v = NULL; sc->sc_isa_chipset.ic_attach_hook = sio_isa_attach_hook; + sc->sc_isa_chipset.ic_intr_evcnt = sio_intr_evcnt; sc->sc_isa_chipset.ic_intr_establish = sio_intr_establish; sc->sc_isa_chipset.ic_intr_disestablish = sio_intr_disestablish; sc->sc_isa_chipset.ic_intr_alloc = sio_intr_alloc; diff --git a/sys/arch/alpha/pci/sio_pic.c b/sys/arch/alpha/pci/sio_pic.c index eb246e3a72c4..dc6db7f22091 100644 --- a/sys/arch/alpha/pci/sio_pic.c +++ b/sys/arch/alpha/pci/sio_pic.c @@ -1,4 +1,4 @@ -/* $NetBSD: sio_pic.c,v 1.25 2000/02/27 02:50:31 mycroft Exp $ */ +/* $NetBSD: sio_pic.c,v 1.26 2000/06/04 19:14:26 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.25 2000/02/27 02:50:31 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.26 2000/06/04 19:14:26 cgd Exp $"); #include #include @@ -444,6 +444,16 @@ sio_intr_string(v, irq) return (irqstr); } +const struct evcnt * +sio_intr_evcnt(v, irq) + void *v; + int irq; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void * sio_intr_establish(v, irq, type, level, fn, arg) void *v, *arg; diff --git a/sys/arch/alpha/pci/siovar.h b/sys/arch/alpha/pci/siovar.h index 33cb45b1cf44..3a601302e81a 100644 --- a/sys/arch/alpha/pci/siovar.h +++ b/sys/arch/alpha/pci/siovar.h @@ -1,4 +1,4 @@ -/* $NetBSD: siovar.h,v 1.8 1998/05/23 21:36:33 ross Exp $ */ +/* $NetBSD: siovar.h,v 1.9 2000/06/04 19:14:26 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -31,6 +31,7 @@ void sio_intr_setup __P((pci_chipset_tag_t, bus_space_tag_t)); void sio_iointr __P((void *framep, unsigned long vec)); const char *sio_intr_string __P((void *, int)); +const struct evcnt *sio_intr_evcnt __P((void *, int)); void *sio_intr_establish __P((void *, int, int, int, int (*)(void *), void *)); void sio_intr_disestablish __P((void *, void *)); diff --git a/sys/arch/alpha/tc/tc_3000_300.c b/sys/arch/alpha/tc/tc_3000_300.c index ed57191ec5b9..2f8c5302adfc 100644 --- a/sys/arch/alpha/tc/tc_3000_300.c +++ b/sys/arch/alpha/tc/tc_3000_300.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_3000_300.c,v 1.23 2000/03/26 10:32:52 nisimura Exp $ */ +/* $NetBSD: tc_3000_300.c,v 1.24 2000/06/04 19:14:28 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.23 2000/03/26 10:32:52 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.24 2000/06/04 19:14:28 cgd Exp $"); #include #include @@ -112,6 +112,16 @@ tc_3000_300_intr_setup() } } +const struct evcnt * +tc_3000_300_intr_evcnt(tcadev, cookie) + struct device *tcadev; + void *cookie; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void tc_3000_300_intr_establish(tcadev, cookie, level, func, arg) struct device *tcadev; diff --git a/sys/arch/alpha/tc/tc_3000_500.c b/sys/arch/alpha/tc/tc_3000_500.c index 2ab9a53c7c3b..86f6af8c532a 100644 --- a/sys/arch/alpha/tc/tc_3000_500.c +++ b/sys/arch/alpha/tc/tc_3000_500.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_3000_500.c,v 1.21 2000/03/26 10:32:52 nisimura Exp $ */ +/* $NetBSD: tc_3000_500.c,v 1.22 2000/06/04 19:14:29 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_3000_500.c,v 1.21 2000/03/26 10:32:52 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tc_3000_500.c,v 1.22 2000/06/04 19:14:29 cgd Exp $"); #include #include @@ -136,6 +136,16 @@ tc_3000_500_intr_setup() } } +const struct evcnt * +tc_3000_500_intr_evcnt(tcadev, cookie) + struct device *tcadev; + void *cookie; +{ + + /* XXX for now, no evcnt parent reported */ + return (NULL); +} + void tc_3000_500_intr_establish(tcadev, cookie, level, func, arg) struct device *tcadev; diff --git a/sys/arch/alpha/tc/tc_conf.h b/sys/arch/alpha/tc/tc_conf.h index 96ce912409e1..a646336016d1 100644 --- a/sys/arch/alpha/tc/tc_conf.h +++ b/sys/arch/alpha/tc/tc_conf.h @@ -1,4 +1,4 @@ -/* $NetBSD: tc_conf.h,v 1.9 1998/10/22 01:03:09 briggs Exp $ */ +/* $NetBSD: tc_conf.h,v 1.10 2000/06/04 19:14:29 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -40,6 +40,8 @@ extern void tc_3000_500_intr_setup __P((void)); extern void tc_3000_500_iointr __P((void *, unsigned long)); +extern const struct evcnt * + tc_3000_500_intr_evcnt __P((struct device *, void *)); extern void tc_3000_500_intr_establish __P((struct device *, void *, tc_intrlevel_t, int (*)(void *), void *)); extern void tc_3000_500_intr_disestablish __P((struct device *, void *)); @@ -58,6 +60,8 @@ extern struct tc_builtin tc_3000_500_nographics_builtins[]; extern void tc_3000_300_intr_setup __P((void)); extern void tc_3000_300_iointr __P((void *, unsigned long)); +extern const struct evcnt * + tc_3000_300_intr_evcnt __P((struct device *, void *)); extern void tc_3000_300_intr_establish __P((struct device *, void *, tc_intrlevel_t, int (*)(void *), void *)); extern void tc_3000_300_intr_disestablish __P((struct device *, void *)); diff --git a/sys/arch/alpha/tc/tcasic.c b/sys/arch/alpha/tc/tcasic.c index 818abcf19853..1c1a441bdf2c 100644 --- a/sys/arch/alpha/tc/tcasic.c +++ b/sys/arch/alpha/tc/tcasic.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcasic.c,v 1.28 2000/03/26 10:32:52 nisimura Exp $ */ +/* $NetBSD: tcasic.c,v 1.29 2000/06/04 19:14:30 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -32,7 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.28 2000/03/26 10:32:52 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.29 2000/06/04 19:14:30 cgd Exp $"); #include #include @@ -113,6 +113,7 @@ 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; @@ -133,6 +134,7 @@ 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/arch/arc/include/isa_machdep.h b/sys/arch/arc/include/isa_machdep.h index 829033d379e5..97b6e74b08be 100644 --- a/sys/arch/arc/include/isa_machdep.h +++ b/sys/arch/arc/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.3 2000/06/01 00:04:52 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.4 2000/06/04 19:14:30 cgd Exp $ */ /* $OpenBSD: isa_machdep.h,v 1.5 1997/04/19 17:20:00 pefo Exp $ */ /* @@ -49,6 +49,7 @@ struct arc_isa_bus { void (*ic_attach_hook)(struct device *, struct device *, struct isabus_attach_args *); + const struct evcnt *(*ic_intr_evcnt)(void *, int); void *(*ic_intr_establish)(isa_chipset_tag_t, int, int, int, int (*)(void *), void *); void (*ic_intr_disestablish)(isa_chipset_tag_t, void *); @@ -60,6 +61,8 @@ struct arc_isa_bus { */ #define isa_attach_hook(p, s, a) /* \ (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) */ +#define isa_intr_evcnt(c, i) \ + (*(c)->ic_intr_evcnt)((c)->ic_v, (i)) #define isa_intr_establish(c, i, t, l, f, a) \ (*(c)->ic_intr_establish)((c)->ic_data, (i), (t), (l), (f), (a)) #define isa_intr_disestablish(c, h) \ diff --git a/sys/arch/arc/isa/isabus.c b/sys/arch/arc/isa/isabus.c index 28abda21665e..6649f4fb7954 100644 --- a/sys/arch/arc/isa/isabus.c +++ b/sys/arch/arc/isa/isabus.c @@ -1,4 +1,4 @@ -/* $NetBSD: isabus.c,v 1.8 2000/03/23 06:34:25 thorpej Exp $ */ +/* $NetBSD: isabus.c,v 1.9 2000/06/04 19:14:31 cgd Exp $ */ /* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */ /* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */ @@ -136,6 +136,7 @@ struct cfattach isabr_ca = { }; extern struct cfdriver isabr_cd; +const struct evcnt *isabr_intr_evcnt __P((isa_chipset_tag_t, int)); void *isabr_intr_establish __P((isa_chipset_tag_t, int, int, int, int (*)(void *), void *)); void isabr_intr_disestablish __P((isa_chipset_tag_t, void*)); @@ -194,6 +195,7 @@ isabrattach(parent, self, aux) sc->sc_bus.ab_dv = (struct device *)sc; sc->sc_bus.ab_type = BUS_ISABR; + sc->arc_isa_cs.ic_intr_evcnt = isabr_intr_evcnt; sc->arc_isa_cs.ic_intr_establish = isabr_intr_establish; sc->arc_isa_cs.ic_intr_disestablish = isabr_intr_disestablish; @@ -305,6 +307,16 @@ intr_calculatemasks() } } +const struct evcnt * +isabr_intr_establish(ic, irq, type, level, ih_fun, ih_arg) + isa_chipset_tag_t ic; + int irq; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Establish a ISA bus interrupt. */ diff --git a/sys/arch/arm32/footbridge/footbridge_pci.c b/sys/arch/arm32/footbridge/footbridge_pci.c index 416ad283fd55..f4c901b3a83b 100644 --- a/sys/arch/arm32/footbridge/footbridge_pci.c +++ b/sys/arch/arm32/footbridge/footbridge_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: footbridge_pci.c,v 1.3 2000/03/06 03:15:48 mark Exp $ */ +/* $NetBSD: footbridge_pci.c,v 1.4 2000/06/04 19:14:31 cgd Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -69,6 +69,7 @@ void footbridge_pci_conf_write __P((void *, pcitag_t, int, int footbridge_pci_intr_map __P((void *, pcitag_t, int, int, pci_intr_handle_t *)); const char *footbridge_pci_intr_string __P((void *, pci_intr_handle_t)); +const struct evcnt *footbridge_pci_intr_evcnt __P((void *, pci_intr_handle_t)); void *footbridge_pci_intr_establish __P((void *, pci_intr_handle_t, int, int (*)(void *), void *)); void footbridge_pci_intr_disestablish __P((void *, void *)); @@ -85,6 +86,7 @@ struct arm32_pci_chipset footbridge_pci_chipset = { NULL, /* intr_v */ footbridge_pci_intr_map, footbridge_pci_intr_string, + footbridge_pci_intr_evcnt, footbridge_pci_intr_establish, footbridge_pci_intr_disestablish }; @@ -345,6 +347,16 @@ footbridge_pci_intr_string(pcv, ih) return(irqstr); } +const struct evcnt * +footbridge_pci_intr_evcnt(pcv, ih) + void *pcv; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * footbridge_pci_intr_establish(pcv, ih, level, func, arg) void *pcv; diff --git a/sys/arch/arm32/include/isa_machdep.h b/sys/arch/arm32/include/isa_machdep.h index ca5be30291e4..ad2ddb19cbe4 100644 --- a/sys/arch/arm32/include/isa_machdep.h +++ b/sys/arch/arm32/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.7 2000/06/01 00:04:52 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.8 2000/06/04 19:14:32 cgd Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -60,6 +60,7 @@ struct isabus_attach_args; /* XXX */ */ void isa_attach_hook(struct device *, struct device *, struct isabus_attach_args *); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_fun)(void *), void *ih_arg); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); diff --git a/sys/arch/arm32/include/pci_machdep.h b/sys/arch/arm32/include/pci_machdep.h index 1b17842ec304..7c97f9a60bfd 100644 --- a/sys/arch/arm32/include/pci_machdep.h +++ b/sys/arch/arm32/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.3 2000/06/01 00:04:52 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.4 2000/06/04 19:14:32 cgd Exp $ */ /* * Modified for arm32 by Mark Brinicombe @@ -66,6 +66,7 @@ struct arm32_pci_chipset { int (*pc_intr_map)(void *, pcitag_t, int, int, pci_intr_handle_t *); const char *(*pc_intr_string)(void *, pci_intr_handle_t); + const struct evcnt *(*pc_intr_string)(void *, pci_intr_handle_t); void *(*pc_intr_establish)(void *, pci_intr_handle_t, int, int (*)(void *), void *); void (*pc_intr_disestablish)(void *, void *); @@ -90,6 +91,8 @@ struct arm32_pci_chipset { (*(c)->pc_intr_map)((c)->pc_intr_v, (it), (ip), (il), (ihp)) #define pci_intr_string(c, ih) \ (*(c)->pc_intr_string)((c)->pc_intr_v, (ih)) +#define pci_intr_evcnt(c, ih) \ + (*(c)->pc_intr_evcnt)((c)->pc_intr_v, (ih)) #define pci_intr_establish(c, ih, l, h, a) \ (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a)) #define pci_intr_disestablish(c, iv) \ diff --git a/sys/arch/arm32/isa/isa_cats_machdep.c b/sys/arch/arm32/isa/isa_cats_machdep.c index c7834cf2ea26..691522b4926f 100644 --- a/sys/arch/arm32/isa/isa_cats_machdep.c +++ b/sys/arch/arm32/isa/isa_cats_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_cats_machdep.c,v 1.3 1999/03/19 04:58:45 cgd Exp $ */ +/* $NetBSD: isa_cats_machdep.c,v 1.4 2000/06/04 19:14:32 cgd Exp $ */ /*- * Copyright (c) 1996-1998 The NetBSD Foundation, Inc. @@ -360,6 +360,14 @@ isa_intr_alloc(ic, mask, type, irq) return (0); } +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Set up an interrupt handler to start being called. * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. diff --git a/sys/arch/arm32/isa/isa_shark_machdep.c b/sys/arch/arm32/isa/isa_shark_machdep.c index 4e6837cab884..cea44d0c8d52 100644 --- a/sys/arch/arm32/isa/isa_shark_machdep.c +++ b/sys/arch/arm32/isa/isa_shark_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_shark_machdep.c,v 1.5 1999/09/17 19:59:39 thorpej Exp $ */ +/* $NetBSD: isa_shark_machdep.c,v 1.6 2000/06/04 19:14:33 cgd Exp $ */ /* * Copyright 1997 @@ -135,6 +135,15 @@ isa_init8259s() } #define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2) + +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Set up an interrupt handler to start being called. */ diff --git a/sys/arch/atari/include/isa_machdep.h b/sys/arch/atari/include/isa_machdep.h index 4a6bd2648a6b..886c22c43a5b 100644 --- a/sys/arch/atari/include/isa_machdep.h +++ b/sys/arch/atari/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.8 2000/06/01 00:04:53 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.9 2000/06/04 19:14:33 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -96,6 +96,7 @@ typedef struct { void isa_attach_hook(struct device *, struct device *, struct isabus_attach_args *); int isa_intr_alloc(isa_chipset_tag_t, int, int, int *); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*)(void *), void *ih_arg); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); diff --git a/sys/arch/atari/include/pci_machdep.h b/sys/arch/atari/include/pci_machdep.h index ae91b3ba4ef1..c93ea370b215 100644 --- a/sys/arch/atari/include/pci_machdep.h +++ b/sys/arch/atari/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.5 2000/06/01 00:04:53 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.6 2000/06/04 19:14:33 cgd Exp $ */ /* * Copyright (c) 1996 Leo Weppelman. All rights reserved. @@ -63,6 +63,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/atari/isa/isa_machdep.c b/sys/arch/atari/isa/isa_machdep.c index 7fa8f8a1a9b9..5d600f4a1c62 100644 --- a/sys/arch/atari/isa/isa_machdep.c +++ b/sys/arch/atari/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.16 2000/01/19 13:13:14 leo Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.17 2000/06/04 19:14:34 cgd Exp $ */ /* * Copyright (c) 1997 Leo Weppelman. All rights reserved. @@ -224,6 +224,14 @@ isa_intr_alloc(ic, mask, type, irq) return (1); } +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg) isa_chipset_tag_t ic; diff --git a/sys/arch/atari/pci/pci_machdep.c b/sys/arch/atari/pci/pci_machdep.c index ebcd04cb0883..d1524e7d67be 100644 --- a/sys/arch/atari/pci/pci_machdep.c +++ b/sys/arch/atari/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.21 2000/01/19 13:13:16 leo Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.22 2000/06/04 19:14:35 cgd Exp $ */ /* * Copyright (c) 1996 Leo Weppelman. All rights reserved. @@ -642,6 +642,16 @@ pci_intr_string(pc, ih) } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * The interrupt stuff is rather ugly. On the Hades, all interrupt lines * for a slot are wired together and connected to IO 0,1,2 or 5 (slots: diff --git a/sys/arch/bebox/include/isa_machdep.h b/sys/arch/bebox/include/isa_machdep.h index 0d7c97a89e22..397c750b6710 100644 --- a/sys/arch/bebox/include/isa_machdep.h +++ b/sys/arch/bebox/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.10 2000/06/01 00:04:53 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.11 2000/06/04 19:14:36 cgd Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -111,6 +111,7 @@ struct isabus_attach_args; /* XXX */ */ void isa_attach_hook(struct device *, struct device *, struct isabus_attach_args *); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_fun)(void *), void *ih_arg); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); diff --git a/sys/arch/bebox/include/pci_machdep.h b/sys/arch/bebox/include/pci_machdep.h index e6976501c8bd..0ba490b3f97b 100644 --- a/sys/arch/bebox/include/pci_machdep.h +++ b/sys/arch/bebox/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.5 2000/06/01 00:04:53 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.6 2000/06/04 19:14:36 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -66,6 +66,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/bebox/isa/isa_machdep.c b/sys/arch/bebox/isa/isa_machdep.c index 527ffef9a3d2..728e12f488b8 100644 --- a/sys/arch/bebox/isa/isa_machdep.c +++ b/sys/arch/bebox/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.4 1999/03/19 04:58:46 cgd Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.5 2000/06/04 19:14:37 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -86,6 +86,14 @@ #include #include +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Set up an interrupt handler to start being called. * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. diff --git a/sys/arch/bebox/pci/pci_machdep.c b/sys/arch/bebox/pci/pci_machdep.c index ef5dfdd356a8..35d6249b54d6 100644 --- a/sys/arch/bebox/pci/pci_machdep.c +++ b/sys/arch/bebox/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.4 1998/08/15 03:02:37 mycroft Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.5 2000/06/04 19:14:37 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -213,6 +213,16 @@ pci_intr_string(pc, ih) } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * pci_intr_establish(pc, ih, level, func, arg) pci_chipset_tag_t pc; diff --git a/sys/arch/cobalt/include/pci_machdep.h b/sys/arch/cobalt/include/pci_machdep.h index 29f7b3b4674f..64bdb4bac091 100644 --- a/sys/arch/cobalt/include/pci_machdep.h +++ b/sys/arch/cobalt/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.1 2000/03/19 23:07:47 soren Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.2 2000/06/04 19:14:41 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -63,6 +63,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/cobalt/pci/pci_machdep.c b/sys/arch/cobalt/pci/pci_machdep.c index 6b2b6b6cbd80..2b1fb51ace99 100644 --- a/sys/arch/cobalt/pci/pci_machdep.c +++ b/sys/arch/cobalt/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.6 2000/05/29 15:45:15 soren Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.7 2000/06/04 19:14:41 cgd Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -190,6 +190,16 @@ pci_intr_string(pc, ih) return irqstr; } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * pci_intr_establish(pc, ih, level, func, arg) pci_chipset_tag_t pc; diff --git a/sys/arch/hpcmips/hpcmips/clock.c b/sys/arch/hpcmips/hpcmips/clock.c index 022d3d489144..fe039e883ef3 100644 --- a/sys/arch/hpcmips/hpcmips/clock.c +++ b/sys/arch/hpcmips/hpcmips/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.7 2000/04/24 12:58:32 uch Exp $ */ +/* $NetBSD: clock.c,v 1.8 2000/06/04 19:14:42 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -45,7 +45,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.7 2000/04/24 12:58:32 uch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.8 2000/06/04 19:14:42 cgd Exp $"); #include #include @@ -80,7 +80,8 @@ clockattach(dev, fns) clockdev = dev; clockfns = fns; #ifdef EVCNT_COUNTERS - evcnt_attach(dev, "intr", &clock_intr_evcnt); + evcnt_attach_dynamic(&clock_intr_evcnt, EVCNT_TYPE_INTR, NULL, + dev->dv_xname, "intr"); #endif } diff --git a/sys/arch/hpcmips/include/isa_machdep.h b/sys/arch/hpcmips/include/isa_machdep.h index 51216c7f084f..3a046dbf01b8 100644 --- a/sys/arch/hpcmips/include/isa_machdep.h +++ b/sys/arch/hpcmips/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.3 2000/06/01 00:04:54 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.4 2000/06/04 19:14:42 cgd Exp $ */ /* * Copyright (c) 1999, by UCHIYAMA Yasushi @@ -43,6 +43,7 @@ typedef struct hpcmips_isa_chipset *isa_chipset_tag_t; */ void isa_attach_hook(struct device*, struct device*, struct isabus_attach_args*); int isa_intr_alloc(isa_chipset_tag_t, int, int, int*); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t, int, int, int, int (*)(void *), void*); void isa_intr_disestablish(isa_chipset_tag_t, void*); diff --git a/sys/arch/hpcmips/isa/isa_machdep.c b/sys/arch/hpcmips/isa/isa_machdep.c index 6e207059d187..28cd89f49522 100644 --- a/sys/arch/hpcmips/isa/isa_machdep.c +++ b/sys/arch/hpcmips/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.5 2000/04/03 03:40:00 sato Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.6 2000/06/04 19:14:43 cgd Exp $ */ /* * Copyright (c) 1999, by UCHIYAMA Yasushi @@ -171,6 +171,14 @@ isa_attach_hook(parent, self, iba) { } +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * isa_intr_establish(ic, intr, type, level, ih_fun, ih_arg) isa_chipset_tag_t ic; diff --git a/sys/arch/i386/eisa/eisa_machdep.c b/sys/arch/i386/eisa/eisa_machdep.c index 6051d410da80..81ae118429ef 100644 --- a/sys/arch/i386/eisa/eisa_machdep.c +++ b/sys/arch/i386/eisa/eisa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: eisa_machdep.c,v 1.10 1998/06/03 06:35:49 thorpej Exp $ */ +/* $NetBSD: eisa_machdep.c,v 1.11 2000/06/04 19:14:43 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -171,6 +171,14 @@ eisa_intr_string(ec, ih) } +const struct evcnt * +eisa_intr_evcnt(eisa_chipset_tag_t ec, eisa_intr_handle_t ih) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * eisa_intr_establish(ec, ih, type, level, func, arg) eisa_chipset_tag_t ec; diff --git a/sys/arch/i386/include/eisa_machdep.h b/sys/arch/i386/include/eisa_machdep.h index 60f91a97c740..2cf41bae7743 100644 --- a/sys/arch/i386/include/eisa_machdep.h +++ b/sys/arch/i386/include/eisa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: eisa_machdep.h,v 1.6 2000/06/01 00:04:51 cgd Exp $ */ +/* $NetBSD: eisa_machdep.h,v 1.7 2000/06/04 19:14:44 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -59,6 +59,7 @@ int eisa_maxslots(eisa_chipset_tag_t); int eisa_intr_map(eisa_chipset_tag_t, u_int, eisa_intr_handle_t *); const char *eisa_intr_string(eisa_chipset_tag_t, eisa_intr_handle_t); +const struct evcnt *eisa_intr_evcnt(eisa_chipset_tag_t, eisa_intr_handle_t); void *eisa_intr_establish(eisa_chipset_tag_t, eisa_intr_handle_t, int, int, int (*)(void *), void *); void eisa_intr_disestablish(eisa_chipset_tag_t, void *); diff --git a/sys/arch/i386/include/isa_machdep.h b/sys/arch/i386/include/isa_machdep.h index 03a2c1dda017..3945a886190c 100644 --- a/sys/arch/i386/include/isa_machdep.h +++ b/sys/arch/i386/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.15 2000/06/01 00:04:51 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.16 2000/06/04 19:14:44 cgd Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -112,6 +112,7 @@ struct isabus_attach_args; /* XXX */ void isa_attach_hook(struct device *, struct device *, struct isabus_attach_args *); int isa_intr_alloc(isa_chipset_tag_t, int, int, int *); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_fun)(void *), void *ih_arg); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); diff --git a/sys/arch/i386/include/mca_machdep.h b/sys/arch/i386/include/mca_machdep.h index bc07c7cb09f3..dd00c3853df8 100644 --- a/sys/arch/i386/include/mca_machdep.h +++ b/sys/arch/i386/include/mca_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: mca_machdep.h,v 1.2 2000/06/01 00:04:51 cgd Exp $ */ +/* $NetBSD: mca_machdep.h,v 1.3 2000/06/04 19:14:45 cgd Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -58,6 +58,7 @@ struct mcabus_attach_args; void mca_attach_hook(struct device *, struct device *, struct mcabus_attach_args *); +const struct evcnt *mca_intr_evcnt(mca_chipset_tag_t, mca_intr_handle_t); void *mca_intr_establish(mca_chipset_tag_t, mca_intr_handle_t, int, int (*)(void *), void *); void mca_intr_disestablish(mca_chipset_tag_t, void *); diff --git a/sys/arch/i386/include/pci_machdep.h b/sys/arch/i386/include/pci_machdep.h index 0e200bbee795..0fca8cb89e93 100644 --- a/sys/arch/i386/include/pci_machdep.h +++ b/sys/arch/i386/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.13 2000/06/01 00:04:51 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.14 2000/06/04 19:14:45 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -94,6 +94,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 6a759508f5a7..6f9262791ee0 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.46 2000/05/11 16:38:13 jdolecek Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.47 2000/06/04 19:14:46 cgd Exp $ */ #define ISA_DMA_STATS @@ -440,6 +440,14 @@ isa_intr_alloc(ic, mask, type, irq) return (0); } +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Set up an interrupt handler to start being called. * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. diff --git a/sys/arch/i386/mca/mca_machdep.c b/sys/arch/i386/mca/mca_machdep.c index 848e223e1c3b..0408f3baf89a 100644 --- a/sys/arch/i386/mca/mca_machdep.c +++ b/sys/arch/i386/mca/mca_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: mca_machdep.c,v 1.1 2000/05/11 16:38:14 jdolecek Exp $ */ +/* $NetBSD: mca_machdep.c,v 1.2 2000/06/04 19:14:47 cgd Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -140,6 +140,14 @@ mca_conf_write(mc, slot, reg, data) #error mca_intr_(dis)establish: needs ISA to be configured into kernel #endif +const struct evcnt * +mca_intr_establish(mca_chipset_tag_t mc, mca_intr_handle_t ih) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * mca_intr_establish(mc, ih, level, func, arg) mca_chipset_tag_t mc; diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index 42e2e74a0da2..176f7f981431 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.35 1999/12/11 20:48:25 thorpej Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.36 2000/06/04 19:14:47 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -535,6 +535,16 @@ pci_intr_string(pc, ih) } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * pci_intr_establish(pc, ih, level, func, arg) pci_chipset_tag_t pc; diff --git a/sys/arch/macppc/include/pci_machdep.h b/sys/arch/macppc/include/pci_machdep.h index 3a3380f3ad2d..17058fbc75a9 100644 --- a/sys/arch/macppc/include/pci_machdep.h +++ b/sys/arch/macppc/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.11 2000/06/01 00:04:55 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.12 2000/06/04 19:14:48 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -79,6 +79,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/macppc/pci/pci_machdep.c b/sys/arch/macppc/pci/pci_machdep.c index a0cd07a2d538..dbdab9eec93e 100644 --- a/sys/arch/macppc/pci/pci_machdep.c +++ b/sys/arch/macppc/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.10 2000/02/03 19:27:46 tsubai Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.11 2000/06/04 19:14:49 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -245,6 +245,16 @@ pci_intr_string(pc, ih) } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + extern void * intr_establish(); extern void intr_disestablish(); diff --git a/sys/arch/mvme68k/dev/vme_pcc.c b/sys/arch/mvme68k/dev/vme_pcc.c index d869e8298d92..4ce9ab52378a 100644 --- a/sys/arch/mvme68k/dev/vme_pcc.c +++ b/sys/arch/mvme68k/dev/vme_pcc.c @@ -1,4 +1,4 @@ -/* $NetBSD: vme_pcc.c,v 1.7 2000/03/18 22:33:04 scw Exp $ */ +/* $NetBSD: vme_pcc.c,v 1.8 2000/06/04 19:14:49 cgd Exp $ */ /*- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc. @@ -182,6 +182,7 @@ vme_pcc_attach(parent, self, aux) sc->sc_vct.vct_map = _vme_pcc_map; sc->sc_vct.vct_unmap = _vme_pcc_unmap; sc->sc_vct.vct_int_map = _vme_pcc_intmap; + sc->sc_vct.vct_int_evcnt = _vme_pcc_intr_evcnt; sc->sc_vct.vct_int_establish = _vme_pcc_intr_establish; sc->sc_vct.vct_int_disestablish = _vme_pcc_intr_disestablish; sc->sc_vct.vct_dmamap_create = _vme_pcc_dmamap_create; @@ -383,6 +384,16 @@ _vme_pcc_intmap(vsc, level, vector, handlep) return (0); } +const struct evcnt * +_vme_pcc_intr_evcnt(vsc, handle) + void *vsc; + vme_intr_handle_t handle; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * _vme_pcc_intr_establish(vsc, handle, prior, func, arg) void *vsc; diff --git a/sys/arch/mvme68k/dev/vme_pccvar.h b/sys/arch/mvme68k/dev/vme_pccvar.h index 90cadd31cf6e..c3f280d8135c 100644 --- a/sys/arch/mvme68k/dev/vme_pccvar.h +++ b/sys/arch/mvme68k/dev/vme_pccvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: vme_pccvar.h,v 1.2 2000/03/18 22:33:04 scw Exp $ */ +/* $NetBSD: vme_pccvar.h,v 1.3 2000/06/04 19:14:50 cgd Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -70,6 +70,8 @@ int _vme_pcc_probe __P((void *, vme_addr_t, vme_size_t, vme_am_t,vme_datasize_t, int _vme_pcc_intmap __P((void *, int, int, vme_intr_handle_t *)); +const struct evcnt *_vme_pcc_intr_evcnt __P((void *, vme_intr_handle_t)); + void *_vme_pcc_intr_establish __P((void *, vme_intr_handle_t, int, int (*)(void *), void *)); diff --git a/sys/arch/mvme68k/dev/vme_two.c b/sys/arch/mvme68k/dev/vme_two.c index 59857f1f0eda..487d970d11bc 100644 --- a/sys/arch/mvme68k/dev/vme_two.c +++ b/sys/arch/mvme68k/dev/vme_two.c @@ -1,4 +1,4 @@ -/* $NetBSD: vme_two.c,v 1.2 2000/03/18 22:33:04 scw Exp $ */ +/* $NetBSD: vme_two.c,v 1.3 2000/06/04 19:14:50 cgd Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -89,6 +89,7 @@ static struct vmetwo_softc *vmetwo_sc; void vmetwo_master_range __P((struct vmetwo_softc *, int, struct vmetwo_range *)); int vmetwo_local_isr_trampoline __P((void *)); +const struct evcnt *vmetwo_intr_evcnt __P((struct vmetwo_softc *, int)); void vmetwo_intr_establish __P((struct vmetwo_softc *, int, int, int (*) (void *), void *)); void vmetwo_intr_disestablish __P((struct vmetwo_softc *, int, int)); @@ -297,6 +298,7 @@ vmetwo_attach(parent, self, aux) sc->sc_vct.vct_map = _vmetwo_map; sc->sc_vct.vct_unmap = _vmetwo_unmap; sc->sc_vct.vct_int_map = _vmetwo_intmap; + sc->sc_vct.vct_int_evcnt = _vmetwo_intr_evcnt; sc->sc_vct.vct_int_establish = _vmetwo_intr_establish; sc->sc_vct.vct_int_disestablish = _vmetwo_intr_disestablish; sc->sc_vct.vct_dmamap_create = _vmetwo_dmamap_create; @@ -562,6 +564,16 @@ _vmetwo_intmap(vsc, level, vector, handlep) return (0); } +const struct evcnt * +_vmetwo_intr_establish(vsc, handle, prior, func, arg) + void *vsc; + vme_intr_handle_t handle; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * _vmetwo_intr_establish(vsc, handle, prior, func, arg) void *vsc; diff --git a/sys/arch/mvme68k/dev/vme_twovar.h b/sys/arch/mvme68k/dev/vme_twovar.h index c7d12dbc6842..82d8f4488a19 100644 --- a/sys/arch/mvme68k/dev/vme_twovar.h +++ b/sys/arch/mvme68k/dev/vme_twovar.h @@ -1,4 +1,4 @@ -/* $NetBSD: vme_twovar.h,v 1.2 2000/03/18 22:33:04 scw Exp $ */ +/* $NetBSD: vme_twovar.h,v 1.3 2000/06/04 19:14:51 cgd Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -89,6 +89,8 @@ int _vmetwo_probe __P((void *, vme_addr_t, vme_size_t, vme_am_t,vme_datasize_t, int _vmetwo_intmap __P((void *, int, int, vme_intr_handle_t *)); +const struct evcnt *_vmetwo_intr_establish __P((void *, vme_intr_handle_t)); + void *_vmetwo_intr_establish __P((void *, vme_intr_handle_t, int, int (*)(void *), void *)); diff --git a/sys/arch/mvme68k/mvme68k/clock.c b/sys/arch/mvme68k/mvme68k/clock.c index 1de9742a775f..07394d3e8a5c 100644 --- a/sys/arch/mvme68k/mvme68k/clock.c +++ b/sys/arch/mvme68k/mvme68k/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.12 2000/03/18 22:33:06 scw Exp $ */ +/* $NetBSD: clock.c,v 1.13 2000/06/04 19:14:52 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -106,8 +106,10 @@ clock_config(dev, ca) /* Hook up that which we need. */ clock_args = ca; - evcnt_attach(dev, "profint", &clock_profcnt); - evcnt_attach(dev, "statint", &clock_statcnt); + evcnt_attach_dynamic(&clock_profcnt, EVCNT_TYPE_INTR, NULL, + dev->dv_xname, "profint"); + evcnt_attach_dynamic(&clock_statcnt, EVCNT_TYPE_INTR, NULL, + dev->dv_xname, "statint"); /* Print info about the clock. */ printf(": delay_divisor %d\n", delay_divisor); diff --git a/sys/arch/next68k/dev/esp.c b/sys/arch/next68k/dev/esp.c index ea85b73cdfc3..67dd8d4ff03f 100644 --- a/sys/arch/next68k/dev/esp.c +++ b/sys/arch/next68k/dev/esp.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp.c,v 1.25 1999/08/28 09:19:04 dbj Exp $ */ +/* $NetBSD: esp.c,v 1.26 2000/06/04 19:14:53 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -402,7 +402,8 @@ espattach_intio(parent, self, aux) INTR_ENABLE(NEXT_I_SCSI); /* register interrupt stats */ - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); /* Do the common parts of attachment. */ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd; diff --git a/sys/arch/pmax/pmax/clock.c b/sys/arch/pmax/pmax/clock.c index 80b5663530c6..d2c585ec957d 100644 --- a/sys/arch/pmax/pmax/clock.c +++ b/sys/arch/pmax/pmax/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.30 2000/01/10 03:24:36 simonb Exp $ */ +/* $NetBSD: clock.c,v 1.31 2000/06/04 19:14:54 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,7 +44,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2000/01/10 03:24:36 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.31 2000/06/04 19:14:54 cgd Exp $"); #include #include @@ -84,7 +84,8 @@ clockattach(dev, fns) clockdev = dev; clockfns = fns; #ifdef EVCNT_COUNTERS - evcnt_attach(dev, "intr", &clock_intr_evcnt); + evcnt_attach_dynamic(&clock_intr_evcnt, EVCNT_TYPE_INTR, NULL, + dev->dv_xname, "intr"); #endif } diff --git a/sys/arch/pmax/tc/ioasic.c b/sys/arch/pmax/tc/ioasic.c index 252601516c10..427ef0a21515 100644 --- a/sys/arch/pmax/tc/ioasic.c +++ b/sys/arch/pmax/tc/ioasic.c @@ -1,4 +1,4 @@ -/* $NetBSD: ioasic.c,v 1.12 2000/03/15 03:07:47 nisimura Exp $ */ +/* $NetBSD: ioasic.c,v 1.13 2000/06/04 19:14:55 cgd Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.12 2000/03/15 03:07:47 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.13 2000/06/04 19:14:55 cgd Exp $"); #include #include @@ -191,6 +191,16 @@ ioasicattach(parent, self, aux) ioasic_attach_devs(sc, ioasic_devs, builtin_ndevs); } +const struct evcnt * +ioasic_intr_evcnt(dev, cookie) + struct device *dev; + void *cookie; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + #if 1 /* XXX for now XXX */ void ioasic_intr_establish(dev, cookie, level, handler, val) diff --git a/sys/arch/pmax/tc/tc_3max.c b/sys/arch/pmax/tc/tc_3max.c index 286d28f5764f..5c00780c364d 100644 --- a/sys/arch/pmax/tc/tc_3max.c +++ b/sys/arch/pmax/tc/tc_3max.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_3max.c,v 1.6 2000/02/29 07:20:21 nisimura Exp $ */ +/* $NetBSD: tc_3max.c,v 1.7 2000/06/04 19:14:55 cgd Exp $ */ /* * Copyright (c) 1998 Jonathan Stone. All rights reserved. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_3max.c,v 1.6 2000/02/29 07:20:21 nisimura Exp $ "); +__KERNEL_RCSID(0, "$NetBSD: tc_3max.c,v 1.7 2000/06/04 19:14:55 cgd Exp $ "); #include #include @@ -69,6 +69,6 @@ struct tcbus_attach_args kn02_tc_desc = { TC_SPEED_25_MHZ, KN02_TC_NSLOTS, tc_kn02_slots, 3, tc_kn02_builtins, - NULL, NULL, + NULL, NULL, NULL, NULL, }; diff --git a/sys/arch/pmax/tc/tc_3maxplus.c b/sys/arch/pmax/tc/tc_3maxplus.c index 8df9dadb8034..b668819062bb 100644 --- a/sys/arch/pmax/tc/tc_3maxplus.c +++ b/sys/arch/pmax/tc/tc_3maxplus.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_3maxplus.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ */ +/* $NetBSD: tc_3maxplus.c,v 1.6 2000/06/04 19:14:56 cgd Exp $ */ /* * Copyright (c) 1998 Jonathan Stone. All rights reserved. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_3maxplus.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ "); +__KERNEL_RCSID(0, "$NetBSD: tc_3maxplus.c,v 1.6 2000/06/04 19:14:56 cgd Exp $ "); #include #include @@ -63,6 +63,6 @@ struct tcbus_attach_args kn03_tc_desc = { TC_SPEED_25_MHZ, KN03_TC_NSLOTS, tc_kn03_slots, 1, tc_kn03_builtins, - NULL, NULL, + NULL, NULL, NULL, NULL, }; diff --git a/sys/arch/pmax/tc/tc_3min.c b/sys/arch/pmax/tc/tc_3min.c index 6b2df0642703..12a5cbbee79e 100644 --- a/sys/arch/pmax/tc/tc_3min.c +++ b/sys/arch/pmax/tc/tc_3min.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_3min.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ */ +/* $NetBSD: tc_3min.c,v 1.6 2000/06/04 19:14:56 cgd Exp $ */ /* * Copyright (c) 1998 Jonathan Stone. All rights reserved. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_3min.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ "); +__KERNEL_RCSID(0, "$NetBSD: tc_3min.c,v 1.6 2000/06/04 19:14:56 cgd Exp $ "); #include #include @@ -64,6 +64,6 @@ struct tcbus_attach_args kmin_tc_desc = TC_SPEED_12_5_MHZ, KMIN_TC_NSLOTS, tc_kmin_slots, 1, tc_kn02ba_builtins, - NULL, NULL, + NULL, NULL, NULL, NULL, }; diff --git a/sys/arch/pmax/tc/tc_maxine.c b/sys/arch/pmax/tc/tc_maxine.c index 5fd099fc944c..39b4df7ddb43 100644 --- a/sys/arch/pmax/tc/tc_maxine.c +++ b/sys/arch/pmax/tc/tc_maxine.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc_maxine.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ */ +/* $NetBSD: tc_maxine.c,v 1.6 2000/06/04 19:14:57 cgd Exp $ */ /* * Copyright (c) 1998 Jonathan Stone. All rights reserved. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tc_maxine.c,v 1.5 2000/02/29 07:20:21 nisimura Exp $ "); +__KERNEL_RCSID(0, "$NetBSD: tc_maxine.c,v 1.6 2000/06/04 19:14:57 cgd Exp $ "); #include #include @@ -66,6 +66,6 @@ struct tcbus_attach_args xine_tc_desc = { TC_SPEED_12_5_MHZ, XINE_TC_NSLOTS, tc_xine_slots, 2, tc_xine_builtins, - NULL, NULL, + NULL, NULL, NULL, NULL, }; diff --git a/sys/arch/pmax/tc/tcbus.c b/sys/arch/pmax/tc/tcbus.c index ce6f9705e657..36ae4707e1cf 100644 --- a/sys/arch/pmax/tc/tcbus.c +++ b/sys/arch/pmax/tc/tcbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcbus.c,v 1.10 2000/02/29 09:03:30 nisimura Exp $ */ +/* $NetBSD: tcbus.c,v 1.11 2000/06/04 19:14:57 cgd Exp $ */ /* * Copyright (c) 1999, 2000 Tohru Nishimura. All rights reserved. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.10 2000/02/29 09:03:30 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.11 2000/06/04 19:14:57 cgd Exp $"); /* * Which system models were configured? @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.10 2000/02/29 09:03:30 nisimura Exp $"); #include #include +static const struct evcnt *tc_ds_intr_evcnt __P((struct device *, void *); static void tc_ds_intr_establish __P((struct device *, void *, int, int (*)(void *), void *)); static void tc_ds_intr_disestablish __P((struct device *, void *)); @@ -119,6 +120,7 @@ tcbus_attach(parent, self, aux) tba->tba_busname = "tc"; tba->tba_memt = 0; + tba->tba_intr_evcnt = tc_ds_intr_evcnt; tba->tba_intr_establish = tc_ds_intr_establish; tba->tba_intr_disestablish = tc_ds_intr_disestablish; tba->tba_get_dma_tag = tc_ds_get_dma_tag; @@ -126,6 +128,19 @@ tcbus_attach(parent, self, aux) tcattach(parent, self, tba); } +/* + * Dispatch to model specific interrupt line evcnt fetch rontine + */ +static void +tc_ds_intr_evcnt(dev, cookie) + struct device *dev; + void *cookie; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Dispatch to model specific interrupt establishing routine */ diff --git a/sys/arch/prep/include/isa_machdep.h b/sys/arch/prep/include/isa_machdep.h index 128a2d2e594d..02e6cfaf0949 100644 --- a/sys/arch/prep/include/isa_machdep.h +++ b/sys/arch/prep/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.h,v 1.2 2000/06/01 00:04:54 cgd Exp $ */ +/* $NetBSD: isa_machdep.h,v 1.3 2000/06/04 19:14:58 cgd Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -111,6 +111,7 @@ struct isabus_attach_args; /* XXX */ */ void isa_attach_hook(struct device *, struct device *, struct isabus_attach_args *); +const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_fun)(void *), void *ih_arg); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); diff --git a/sys/arch/prep/include/pci_machdep.h b/sys/arch/prep/include/pci_machdep.h index 0bba626bbf5c..ff76c02ce67a 100644 --- a/sys/arch/prep/include/pci_machdep.h +++ b/sys/arch/prep/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.2 2000/06/01 00:04:54 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.3 2000/06/04 19:14:58 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -67,6 +67,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t); int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/prep/isa/isa_machdep.c b/sys/arch/prep/isa/isa_machdep.c index 256d0f251c48..6e92ae5f4570 100644 --- a/sys/arch/prep/isa/isa_machdep.c +++ b/sys/arch/prep/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa_machdep.c,v 1.1 2000/02/29 15:21:42 nonaka Exp $ */ +/* $NetBSD: isa_machdep.c,v 1.2 2000/06/04 19:14:59 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -88,6 +88,14 @@ #define IO_ELCR1 0x4d0 #define IO_ELCR2 0x4d1 +const struct evcnt * +isa_intr_evcnt(isa_chipset_tag_t ic, int irq) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + /* * Set up an interrupt handler to start being called. * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. diff --git a/sys/arch/prep/pci/pci_machdep.c b/sys/arch/prep/pci/pci_machdep.c index 36e2cb5570ef..51daf2b86065 100644 --- a/sys/arch/prep/pci/pci_machdep.c +++ b/sys/arch/prep/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.2 2000/03/25 04:12:20 nonaka Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.3 2000/06/04 19:15:00 cgd Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -320,6 +320,16 @@ pci_intr_string(pc, ih) } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * pci_intr_establish(pc, ih, level, func, arg) pci_chipset_tag_t pc; diff --git a/sys/arch/sparc/dev/am7930_sparc.c b/sys/arch/sparc/dev/am7930_sparc.c index 2634b38249d2..185058dcdb40 100644 --- a/sys/arch/sparc/dev/am7930_sparc.c +++ b/sys/arch/sparc/dev/am7930_sparc.c @@ -1,4 +1,4 @@ -/* $NetBSD: am7930_sparc.c,v 1.45 1999/11/21 15:23:01 pk Exp $ */ +/* $NetBSD: am7930_sparc.c,v 1.46 2000/06/04 19:15:00 cgd Exp $ */ /* * Copyright (c) 1995 Rolf Grossmann @@ -246,7 +246,8 @@ am7930_sparc_attach(sc, pri) BUS_INTR_ESTABLISH_SOFTINTR, am7930swintr, sc); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); audio_attach_mi(&sa_hw_if, sc, &sc->sc_dev); } diff --git a/sys/arch/sparc/dev/audioamd.c b/sys/arch/sparc/dev/audioamd.c index 6bd08f4ac834..4dad2e3fa739 100644 --- a/sys/arch/sparc/dev/audioamd.c +++ b/sys/arch/sparc/dev/audioamd.c @@ -1,4 +1,4 @@ -/* $NetBSD: audioamd.c,v 1.3 2000/05/08 03:09:56 mycroft Exp $ */ +/* $NetBSD: audioamd.c,v 1.4 2000/06/04 19:15:01 cgd Exp $ */ /* NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp */ /* @@ -295,7 +295,8 @@ audioamd_attach(sc, pri) BUS_INTR_ESTABLISH_SOFTINTR, am7930swintr, sc); - evcnt_attach(&sc->sc_am7930.sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_am7930.sc_dev.dv_xname, "intr"); audio_attach_mi(&sa_hw_if, sc, &sc->sc_am7930.sc_dev); } diff --git a/sys/arch/sparc/dev/com_obio.c b/sys/arch/sparc/dev/com_obio.c index c482c3f15f06..61c01f091302 100644 --- a/sys/arch/sparc/dev/com_obio.c +++ b/sys/arch/sparc/dev/com_obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_obio.c,v 1.4 1999/11/21 15:23:01 pk Exp $ */ +/* $NetBSD: com_obio.c,v 1.5 2000/06/04 19:15:01 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -188,7 +188,8 @@ com_obio_attach(parent, self, aux) if (sa->sa_nintr != 0) { (void)bus_intr_establish(sc->sc_iot, sa->sa_pri, 0, comintr, sc); - evcnt_attach(&osc->osc_com.sc_dev, "intr", &osc->osc_intrcnt); + evcnt_attach_dynamic(&osc->osc_intrcnt, EVCNT_TYPE_INTR, NULL, + osc->osc_com.sc_dev.dv_xname, "intr"); } /* diff --git a/sys/arch/sparc/dev/esp_obio.c b/sys/arch/sparc/dev/esp_obio.c index 1faa0d3ceed7..f20ff036f67f 100644 --- a/sys/arch/sparc/dev/esp_obio.c +++ b/sys/arch/sparc/dev/esp_obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_obio.c,v 1.5 2000/01/11 12:59:45 pk Exp $ */ +/* $NetBSD: esp_obio.c,v 1.6 2000/06/04 19:15:01 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -266,7 +266,8 @@ espattach_obio(parent, self, aux) (int(*)__P((void*)))ncr53c9x_intr, sc); /* register interrupt stats */ - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); /* Do the common parts of attachment. */ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd; diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index f3f0d4035a42..aaef4abf6310 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.81 2000/05/16 05:45:49 thorpej Exp $ */ +/* $NetBSD: fd.c,v 1.82 2000/06/04 19:15:02 cgd Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -655,7 +655,8 @@ fdcattach(fdc, pri) BUS_INTR_ESTABLISH_SOFTINTR, fdcswintr, fdc); - evcnt_attach(&fdc->sc_dev, "intr", &fdc->sc_intrcnt); + evcnt_attach_dynamic(&fdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + fdc->sc_dev.dv_xname, "intr"); /* physical limit: four drives per controller. */ drive_attached = 0; diff --git a/sys/arch/sparc/dev/tctrl.c b/sys/arch/sparc/dev/tctrl.c index 4871607497be..2364172b41af 100644 --- a/sys/arch/sparc/dev/tctrl.c +++ b/sys/arch/sparc/dev/tctrl.c @@ -1,4 +1,4 @@ -/* $NetBSD: tctrl.c,v 1.9 2000/04/04 17:20:54 thorpej Exp $ */ +/* $NetBSD: tctrl.c,v 1.10 2000/06/04 19:15:03 cgd Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -212,7 +212,8 @@ tctrl_attach(parent, self, aux) if (sa->sa_nintr != 0) { (void)bus_intr_establish(sc->sc_memt, sa->sa_pri, 0, tctrl_intr, sc); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); } /* See what the external status is diff --git a/sys/arch/sparc/dev/vme_machdep.c b/sys/arch/sparc/dev/vme_machdep.c index 12cb5427fec3..705b58e3449d 100644 --- a/sys/arch/sparc/dev/vme_machdep.c +++ b/sys/arch/sparc/dev/vme_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vme_machdep.c,v 1.23 2000/05/09 22:39:36 pk Exp $ */ +/* $NetBSD: vme_machdep.c,v 1.24 2000/06/04 19:15:03 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -103,6 +103,8 @@ static int sparc_vme_map __P((void *, vme_addr_t, vme_size_t, vme_am_t, vme_mapresc_t *)); static void sparc_vme_unmap __P((void *, vme_mapresc_t)); static int sparc_vme_intr_map __P((void *, int, int, vme_intr_handle_t *)); +static const struct evcnt *sparc_vme_intr_evcnt __P((void *, + vme_intr_handle_t)); static void * sparc_vme_intr_establish __P((void *, vme_intr_handle_t, int, int (*) __P((void *)), void *)); static void sparc_vme_intr_disestablish __P((void *, void *)); @@ -193,6 +195,7 @@ struct vme_chipset_tag sparc_vme_chipset_tag = { sparc_vme_unmap, sparc_vme_probe, sparc_vme_intr_map, + sparc_vme_intr_evcnt, sparc_vme_intr_establish, sparc_vme_intr_disestablish, 0, 0, 0 /* bus specific DMA stuff */ @@ -737,6 +740,16 @@ sparc_vme_intr_map(cookie, level, vec, ihp) return (0); } +const struct evcnt * +sparc_vme_intr_evcnt(cookie, vih) + void *cookie; + vme_intr_handle_t vih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * sparc_vme_intr_establish(cookie, vih, pri, func, arg) void *cookie; diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c index 5c9d57d9f699..ca0c479a5af1 100644 --- a/sys/arch/sparc/dev/zs.c +++ b/sys/arch/sparc/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.78 2000/03/21 11:24:02 pk Exp $ */ +/* $NetBSD: zs.c,v 1.79 2000/06/04 19:15:03 cgd Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -456,7 +456,8 @@ zs_attach(zsc, zsd, pri) } else if (pri != prevpri) panic("broken zs interrupt scheme"); - evcnt_attach(&zsc->zsc_dev, "intr", &zsc->zsc_intrcnt); + evcnt_attach_dynamic(&zsc->zsc_intrcnt, EVCNT_TYPE_INTR, NULL, + zsc->zsc_dev.dv_xname, "intr"); /* * Set the master interrupt enable and interrupt vector. diff --git a/sys/arch/sparc64/dev/cs4231_ebus.c b/sys/arch/sparc64/dev/cs4231_ebus.c index c4870274ab29..5cc06c051a09 100644 --- a/sys/arch/sparc64/dev/cs4231_ebus.c +++ b/sys/arch/sparc64/dev/cs4231_ebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: cs4231_ebus.c,v 1.3 2000/04/15 03:08:13 mrg Exp $ */ +/* $NetBSD: cs4231_ebus.c,v 1.4 2000/06/04 19:15:04 cgd Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -145,7 +145,8 @@ cs4231_attach_ebus(parent, self, aux) ea->ea_intrs[i], 0, cs4231_intr, sc); - evcnt_attach(&sc->sc_ad1848.sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_ad1848.sc_dev.dv_xname, "intr"); audio_attach_mi(&audiocs_hw_if, sc, &sc->sc_ad1848.sc_dev); } #endif diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index dfaf4d76153b..7cf391732a15 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.16 2000/05/16 05:45:50 thorpej Exp $ */ +/* $NetBSD: fd.c,v 1.17 2000/06/04 19:15:04 cgd Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. @@ -442,7 +442,8 @@ fdcattach(parent, self, aux) printf(" CFGLOCK: unexpected response"); } - evcnt_attach(&fdc->sc_dev, "intr", &fdc->sc_intrcnt); + evcnt_attach_dynamic(&fdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + fdc->sc_dev.dv_xname, "intr"); printf(" pri %d, softpri %d: chip 8207%c\n", pri, PIL_FDSOFT, code); diff --git a/sys/arch/sparc64/dev/pci_machdep.c b/sys/arch/sparc64/dev/pci_machdep.c index de5e17e89bd3..6515ae5b099d 100644 --- a/sys/arch/sparc64/dev/pci_machdep.c +++ b/sys/arch/sparc64/dev/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.7 2000/05/24 20:27:52 eeh Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.8 2000/06/04 19:15:05 cgd Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -410,6 +410,16 @@ pci_intr_string(pc, ih) return (str); } +const struct evcnt * +pci_intr_evcnt(pc, ih) + pci_chipset_tag_t pc; + pci_intr_handle_t ih; +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * pci_intr_establish(pc, ih, level, func, arg) pci_chipset_tag_t pc; diff --git a/sys/arch/sparc64/dev/zs.c b/sys/arch/sparc64/dev/zs.c index 23009c02b7f2..62e8be6c2b35 100644 --- a/sys/arch/sparc64/dev/zs.c +++ b/sys/arch/sparc64/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.20 2000/05/19 05:26:17 eeh Exp $ */ +/* $NetBSD: zs.c,v 1.21 2000/06/04 19:15:05 cgd Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -371,7 +371,8 @@ zs_attach(zsc, zsd, pri) } else if (pri != prevpri) panic("broken zs interrupt scheme"); - evcnt_attach(&zsc->zsc_dev, "intr", &zsc->zsc_intrcnt); + evcnt_attach_dynamic(&zsc->zsc_intrcnt, EVCNT_TYPE_INTR, NULL, + zsc->zsc_dev.dv_xname, "intr"); /* * Set the master interrupt enable and interrupt vector. diff --git a/sys/arch/sparc64/include/pci_machdep.h b/sys/arch/sparc64/include/pci_machdep.h index 1fd037e3fef1..218a298ae049 100644 --- a/sys/arch/sparc64/include/pci_machdep.h +++ b/sys/arch/sparc64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.3 2000/06/01 00:04:55 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.4 2000/06/04 19:15:06 cgd Exp $ */ /* * Copyright (c) 1999 Matthew R. Green @@ -56,6 +56,7 @@ void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, int pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, pci_intr_handle_t *); const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); +const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *); void pci_intr_disestablish(pci_chipset_tag_t, void *); diff --git a/sys/arch/sun3/dev/esp.c b/sys/arch/sun3/dev/esp.c index 7abb6e7ad104..61b437b4613a 100644 --- a/sys/arch/sun3/dev/esp.c +++ b/sys/arch/sun3/dev/esp.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp.c,v 1.10 1999/04/08 04:46:41 gwr Exp $ */ +/* $NetBSD: esp.c,v 1.11 2000/06/04 19:15:06 cgd Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -243,7 +243,8 @@ espattach(parent, self, aux) /* and the interuppts */ isr_add_autovect((void*)ncr53c9x_intr, sc, ca->ca_intpri); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); /* Do the common parts of attachment. */ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd; diff --git a/sys/arch/sun3/dev/fd.c b/sys/arch/sun3/dev/fd.c index eb5d3e739302..d2c4a4b8f230 100644 --- a/sys/arch/sun3/dev/fd.c +++ b/sys/arch/sun3/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.19 2000/05/16 05:45:51 thorpej Exp $ */ +/* $NetBSD: fd.c,v 1.20 2000/06/04 19:15:07 cgd Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. @@ -426,7 +426,8 @@ fdcattach(parent, self, aux) fdc->sc_cfg = CFG_EIS|/*CFG_EFIFO|*/CFG_POLL|(8 & CFG_THRHLD_MASK); fdconf(fdc); - evcnt_attach(&fdc->sc_dev, "intr", &fdc->sc_intrcnt); + evcnt_attach_dynamic(&fdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + fdc->sc_dev.dv_xname, "intr"); /* physical limit: four drives per controller. */ for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) { diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c index 4cdd2143d4d0..f15f6139bb33 100644 --- a/sys/arch/sun3/dev/xd.c +++ b/sys/arch/sun3/dev/xd.c @@ -1,4 +1,4 @@ -/* $NetBSD: xd.c,v 1.29 2000/05/27 04:52:31 thorpej Exp $ */ +/* $NetBSD: xd.c,v 1.30 2000/06/04 19:15:07 cgd Exp $ */ /* * @@ -480,7 +480,8 @@ xdcattach(parent, self, aux) /* link in interrupt with higher level software */ isr_add_vectored(xdcintr, (void *)xdc, ca->ca_intpri, ca->ca_intvec); - evcnt_attach(&xdc->sc_dev, "intr", &xdc->sc_intrcnt); + evcnt_attach_dynamic(&xdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + xdc->sc_dev.dv_xname, "intr"); /* now we must look for disks using autoconfig */ xa.booting = 1; diff --git a/sys/arch/sun3/dev/xy.c b/sys/arch/sun3/dev/xy.c index 97125d1c6a0a..640b42cfd2ad 100644 --- a/sys/arch/sun3/dev/xy.c +++ b/sys/arch/sun3/dev/xy.c @@ -1,4 +1,4 @@ -/* $NetBSD: xy.c,v 1.30 2000/05/27 04:52:31 thorpej Exp $ */ +/* $NetBSD: xy.c,v 1.31 2000/06/04 19:15:11 cgd Exp $ */ /* * @@ -425,7 +425,8 @@ xycattach(parent, self, aux) /* link in interrupt with higher level software */ isr_add_vectored(xycintr, (void *)xyc, ca->ca_intpri, ca->ca_intvec); - evcnt_attach(&xyc->sc_dev, "intr", &xyc->sc_intrcnt); + evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + xyc->sc_dev.dv_xname, "intr"); callout_init(&xyc->sc_tick_ch); diff --git a/sys/dev/isa/isavar.h b/sys/dev/isa/isavar.h index c9564a7aae85..99b7b36b438a 100644 --- a/sys/dev/isa/isavar.h +++ b/sys/dev/isa/isavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: isavar.h,v 1.37 1999/03/19 05:13:18 cgd Exp $ */ +/* $NetBSD: isavar.h,v 1.38 2000/06/04 19:15:12 cgd Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -165,6 +165,10 @@ struct isa_softc { * * To remove an interrupt handler, the driver calls isa_intr_disestablish() * with the handle returned by isa_intr_establish() for that handler. + * + * The event counter (struct evcnt) associated with an interrupt line + * (to be used as 'parent' for an ISA device's interrupt handler's evcnt) + * can be obtained with isa_intr_evcnt(). */ /* ISA interrupt sharing types */ diff --git a/sys/dev/sbus/cs4231_sbus.c b/sys/dev/sbus/cs4231_sbus.c index 4b1bef5d178a..8390c036a3d7 100644 --- a/sys/dev/sbus/cs4231_sbus.c +++ b/sys/dev/sbus/cs4231_sbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: cs4231_sbus.c,v 1.13 2000/04/14 08:22:49 mrg Exp $ */ +/* $NetBSD: cs4231_sbus.c,v 1.14 2000/06/04 19:15:12 cgd Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -137,7 +137,8 @@ cs4231_attach_sbus(parent, self, aux) sa->sa_pri, 0, cs4231_intr, sc); - evcnt_attach(&sc->sc_ad1848.sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_ad1848.sc_dev.dv_xname, "intr"); audio_attach_mi(&audiocs_hw_if, sc, &sc->sc_ad1848.sc_dev); } #endif diff --git a/sys/dev/sbus/esp_sbus.c b/sys/dev/sbus/esp_sbus.c index 896d89942aa4..38f3a72ad74e 100644 --- a/sys/dev/sbus/esp_sbus.c +++ b/sys/dev/sbus/esp_sbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_sbus.c,v 1.8 2000/01/11 12:59:43 pk Exp $ */ +/* $NetBSD: esp_sbus.c,v 1.9 2000/06/04 19:15:13 cgd Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -396,7 +396,8 @@ espattach(esc, gluep) (int(*)__P((void*)))ncr53c9x_intr, sc); /* register interrupt stats */ - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->sc_dev.dv_xname, "intr"); /* Do the common parts of attachment. */ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd; diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 8404efeab46c..d203225dfdf2 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $NetBSD: magma.c,v 1.6 2000/03/23 07:01:43 thorpej Exp $ */ +/* $NetBSD: magma.c,v 1.7 2000/06/04 19:15:13 cgd Exp $ */ /* * magma.c * @@ -443,7 +443,8 @@ magma_attach(parent, self, aux) (void)bus_intr_establish(sa->sa_bustag, PIL_TTY, BUS_INTR_ESTABLISH_SOFTINTR, magma_soft, sc); - evcnt_attach(&sc->ms_dev, "intr", &sc->ms_intrcnt); + evcnt_attach_dynamic(&sc->ms_intrcnt, EVCNT_TYPE_INTR, NULL, + sc->ms_dev.dv_xname, "intr"); } /* diff --git a/sys/dev/tc/ioasicvar.h b/sys/dev/tc/ioasicvar.h index 9ceba58ba261..ca7a4be39acd 100644 --- a/sys/dev/tc/ioasicvar.h +++ b/sys/dev/tc/ioasicvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: ioasicvar.h,v 1.12 2000/03/15 03:07:44 nisimura Exp $ */ +/* $NetBSD: ioasicvar.h,v 1.13 2000/06/04 19:15:14 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -67,6 +67,7 @@ extern struct cfdriver ioasic_cd; */ extern tc_addr_t ioasic_base; +const struct evcnt *ioasic_intr_evcnt __P((struct device *, void *)); void ioasic_intr_establish __P((struct device *, void *, int, int (*)(void *), void *)); void ioasic_intr_disestablish __P((struct device *, void *)); diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c index 03d7242656a9..4e34f8599a0d 100644 --- a/sys/dev/tc/tc.c +++ b/sys/dev/tc/tc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc.c,v 1.27 1999/11/15 03:41:49 nisimura Exp $ */ +/* $NetBSD: tc.c,v 1.28 2000/06/04 19:15:14 cgd Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -89,6 +89,7 @@ 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; @@ -259,6 +260,14 @@ 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/tcvar.h b/sys/dev/tc/tcvar.h index a301a4af69b9..36bd9e9fcc68 100644 --- a/sys/dev/tc/tcvar.h +++ b/sys/dev/tc/tcvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcvar.h,v 1.16 2000/06/01 00:22:52 cgd Exp $ */ +/* $NetBSD: tcvar.h,v 1.17 2000/06/04 19:15:15 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -69,6 +69,7 @@ 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 *); @@ -91,6 +92,7 @@ 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 *); @@ -139,6 +141,7 @@ struct tc_builtin { int tc_checkslot(tc_addr_t, char *); void tc_devinfo(const char *, char *); 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 *); diff --git a/sys/dev/vme/vmevar.h b/sys/dev/vme/vmevar.h index 3c1bb676193c..ee22af4d1275 100644 --- a/sys/dev/vme/vmevar.h +++ b/sys/dev/vme/vmevar.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmevar.h,v 1.7 2000/02/25 10:33:12 drochner Exp $ */ +/* $NetBSD: vmevar.h,v 1.8 2000/06/04 19:15:16 cgd Exp $ */ /* * Copyright (c) 1999 @@ -71,6 +71,7 @@ typedef struct vme_chipset_tag { void *)); int (*vct_int_map) __P((void *, int, int, vme_intr_handle_t *)); + const struct evcnt *(*vct_int_evcnt) __P((void *, vme_intr_handle_t)); void *(*vct_int_establish) __P((void *, vme_intr_handle_t, int, int (*)(void *), void *)); void (*vct_int_disestablish) __P((void *, void *)); @@ -118,6 +119,8 @@ typedef struct vme_chipset_tag { */ #define vme_intr_map(vc, level, vector, handlep) \ (*((vc)->vct_int_map))((vc)->cookie, (level), (vector), (handlep)) +#define vme_intr_evcnt(vc, handle) \ + (*((vc)->vct_int_evcnt))((vc)->cookie, (handle)) #define vme_intr_establish(vc, handle, prio, func, arg) \ (*((vc)->vct_int_establish))((vc)->cookie, \ (handle), (prio), (func), (arg)) diff --git a/sys/dev/vme/xd.c b/sys/dev/vme/xd.c index fca83fabf67b..2f16524348b8 100644 --- a/sys/dev/vme/xd.c +++ b/sys/dev/vme/xd.c @@ -1,4 +1,4 @@ -/* $NetBSD: xd.c,v 1.25 2000/05/27 04:52:36 thorpej Exp $ */ +/* $NetBSD: xd.c,v 1.26 2000/06/04 19:15:17 cgd Exp $ */ /* * @@ -646,7 +646,8 @@ xdcattach(parent, self, aux) /* link in interrupt with higher level software */ vme_intr_map(ct, va->ivector, va->ilevel, &ih); vme_intr_establish(ct, ih, IPL_BIO, xdcintr, xdc); - evcnt_attach(&xdc->sc_dev, "intr", &xdc->sc_intrcnt); + evcnt_attach_dynamic(&xdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + xdc->sc_dev.dv_xname, "intr"); /* now we must look for disks using autoconfig */ diff --git a/sys/dev/vme/xy.c b/sys/dev/vme/xy.c index 9ce19872b216..5f8eca592761 100644 --- a/sys/dev/vme/xy.c +++ b/sys/dev/vme/xy.c @@ -1,4 +1,4 @@ -/* $NetBSD: xy.c,v 1.23 2000/05/27 04:52:36 thorpej Exp $ */ +/* $NetBSD: xy.c,v 1.24 2000/06/04 19:15:18 cgd Exp $ */ /* * @@ -543,7 +543,8 @@ xycattach(parent, self, aux) /* link in interrupt with higher level software */ vme_intr_map(ct, va->ivector, va->ilevel, &ih); vme_intr_establish(ct, ih, IPL_BIO, xycintr, xyc); - evcnt_attach(&xyc->sc_dev, "intr", &xyc->sc_intrcnt); + evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, + xyc->sc_dev.dv_xname, "intr"); callout_init(&xyc->sc_tick_ch); diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 7f3ad8ff3cc8..9f7e8e7af4ec 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,35 @@ -/* $NetBSD: subr_autoconf.c,v 1.52 2000/06/02 01:48:50 cgd Exp $ */ +/* $NetBSD: subr_autoconf.c,v 1.53 2000/06/04 19:15:19 cgd Exp $ */ + +/* + * Copyright (c) 1996, 2000 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ /* * Copyright (c) 1992, 1993 @@ -48,7 +79,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.52 2000/06/02 01:48:50 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.53 2000/06/04 19:15:19 cgd Exp $"); #include #include @@ -678,23 +709,46 @@ config_pending_decr(void) } /* - * Attach an event. These must come from initially-zero space (see - * commented-out assignments below), but that occurs naturally for - * device instance variables. + * Attach a statically-initialized event. The type and string pointers + * are already set up. */ void -evcnt_attach(struct device *dev, const char *name, struct evcnt *ev) +evcnt_attach_static(struct evcnt *ev) +{ + int len; + + len = strlen(ev->ev_group); +#ifdef DIAGNOSTIC + if (len >= EVCNT_STRING_MAX) /* ..._MAX includes NUL */ + panic("evcnt_attach_static: group length (%s)", ev->ev_group); +#endif + ev->ev_grouplen = len; + + len = strlen(ev->ev_name); +#ifdef DIAGNOSTIC + if (len >= EVCNT_STRING_MAX) /* ..._MAX includes NUL */ + panic("evcnt_attach_static: name length (%s)", ev->ev_name); +#endif + ev->ev_namelen = len; + + TAILQ_INSERT_TAIL(&allevents, ev, ev_list); +} + +/* + * Attach a dynamically-initialized event. Zero it, set up the type + * and string pointers and then act like it was statically initialized. + */ +void +evcnt_attach_dynamic(struct evcnt *ev, int type, const struct evcnt *parent, + const char *group, const char *name) { -#ifdef DIAGNOSTIC - if (strlen(name) >= sizeof(ev->ev_name)) - panic("evcnt_attach"); -#endif - /* ev->ev_next = NULL; */ - ev->ev_dev = dev; - /* ev->ev_count = 0; */ - strcpy(ev->ev_name, name); - TAILQ_INSERT_TAIL(&allevents, ev, ev_list); + memset(ev, 0, sizeof *ev); + ev->ev_type = type; + ev->ev_parent = parent; + ev->ev_group = group; + ev->ev_name = name; + evcnt_attach_static(ev); } /* diff --git a/sys/sys/device.h b/sys/sys/device.h index e23e9d619d6c..9a7f1246522c 100644 --- a/sys/sys/device.h +++ b/sys/sys/device.h @@ -1,4 +1,35 @@ -/* $NetBSD: device.h,v 1.40 2000/06/02 01:48:52 cgd Exp $ */ +/* $NetBSD: device.h,v 1.41 2000/06/04 19:15:20 cgd Exp $ */ + +/* + * Copyright (c) 1996, 2000 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ /* * Copyright (c) 1992, 1993 @@ -85,15 +116,47 @@ struct device { TAILQ_HEAD(devicelist, device); -/* `event' counters (use zero or more per device instance, as needed) */ +/* + * `event' counters (use zero or more per device instance, as needed) + */ + struct evcnt { + u_int64_t ev_count; /* how many have occurred */ TAILQ_ENTRY(evcnt) ev_list; /* entry on list of all counters */ - struct device *ev_dev; /* associated device */ - int ev_count; /* how many have occurred */ - char ev_name[8]; /* what to call them (systat display) */ + unsigned char ev_type; /* counter type; see below */ + unsigned char ev_grouplen; /* 'group' len, excluding NUL */ + unsigned char ev_namelen; /* 'name' len, excluding NUL */ + char ev_pad1; /* reserved (for now); 0 */ + const struct evcnt *ev_parent; /* parent, for hierarchical ctrs */ + const char *ev_group; /* name of group */ + const char *ev_name; /* name of specific event */ }; TAILQ_HEAD(evcntlist, evcnt); +/* maximum group/name lengths, including trailing NUL */ +#define EVCNT_STRING_MAX 256 + +/* ev_type values */ +#define EVCNT_TYPE_MISC 0 /* miscellaneous; catch all */ +#define EVCNT_TYPE_INTR 1 /* interrupt; count with vmstat -i */ + +/* + * initializer for an event count structure. the lengths are initted and + * it is added to the evcnt list at attach time. + */ +#define EVCNT_INITIALIZER(type, parent, group, name) \ + { \ + 0, /* ev_count */ \ + { }, /* ev_list */ \ + type, /* ev_type */ \ + 0, /* ev_grouplen */ \ + 0, /* ev_namelen */ \ + 0, /* ev_pad1 */ \ + parent, /* ev_parent */ \ + group, /* ev_group */ \ + name, /* ev_name */ \ + } + /* * Configuration data (i.e., data placed in ioconf.c). */ @@ -191,11 +254,15 @@ void config_pending_decr(void); #ifdef __HAVE_DEVICE_REGISTER void device_register(struct device *, void *); #endif -void evcnt_attach(struct device *, const char *, struct evcnt *); -void evcnt_detach(struct evcnt *); + +void evcnt_attach_static(struct evcnt *); +void evcnt_attach_dynamic(struct evcnt *, int, const struct evcnt *, + const char *, const char *); +void evcnt_detach(struct evcnt *); /* compatibility definitions */ #define config_found(d, a, p) config_found_sm((d), (a), (p), NULL) + #endif /* _KERNEL */ #endif /* !_SYS_DEVICE_H_ */ diff --git a/usr.bin/vmstat/vmstat.8 b/usr.bin/vmstat/vmstat.8 index 1ad89cdf81e9..5741c0071f2e 100644 --- a/usr.bin/vmstat/vmstat.8 +++ b/usr.bin/vmstat/vmstat.8 @@ -1,4 +1,35 @@ -.\" $NetBSD: vmstat.8,v 1.17 2000/05/17 09:49:32 fair Exp $ +.\" $NetBSD: vmstat.8,v 1.18 2000/06/04 19:15:21 cgd Exp $ +.\" +.\" Copyright (c) 2000 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. .\" .\" Copyright (c) 1986, 1993 .\" The Regents of the University of California. All rights reserved. @@ -40,7 +71,7 @@ vmstat \- report virtual memory statistics .SH SYNOPSIS .nf .ft B -vmstat [ \-fHilms ] [ \-h histname ] [ \-c count ] [ \-M core ] +vmstat [ \-efHilmsv ] [ \-h histname ] [ \-c count ] [ \-M core ] .ti +5 [ \-N system ] [ \-w wait ] [ disks ] .ft R @@ -62,12 +93,14 @@ If no .I wait interval is specified, the default is 1 second. .TP +\-e +Report the values of system event counters. +.TP \-f Report fork statistics. .TP \-i -Report on the number of interrupts taken by each device since system -startup. +Report the values of system interrupt counters. .TP \-M Extract values associated with the name list from the specified core @@ -87,6 +120,11 @@ Display the contents of the structure, giving the total number of several kinds of paging related events which have occurred since system startup. .TP +\-v +Print more verbose information. When used with the +\-i or \-e flags, prints out all interrupts or event counters, +not just those with non-zero values. +.TP \-w Pause .I wait diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 38af8e806ec5..b8a6d4b49090 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1,7 +1,7 @@ -/* $NetBSD: vmstat.c,v 1.65 2000/06/04 08:07:36 itojun Exp $ */ +/* $NetBSD: vmstat.c,v 1.66 2000/06/04 19:15:21 cgd Exp $ */ /*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. + * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -80,7 +80,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.65 2000/06/04 08:07:36 itojun Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.66 2000/06/04 19:15:21 cgd Exp $"); #endif #endif /* not lint */ @@ -169,13 +169,15 @@ kvm_t *kd; #define INTRSTAT 0x02 #define MEMSTAT 0x04 #define SUMSTAT 0x08 +#define EVCNTSTAT 0x10 #define VMSTAT 0x20 #define HISTLIST 0x40 #define HISTDUMP 0x80 void cpustats __P((void)); void dkstats __P((void)); -void dointr __P((void)); +void doevcnt __P((int verbose)); +void dointr __P((int verbose)); void domem __P((void)); void dopool __P((void)); void dosum __P((void)); @@ -209,7 +211,7 @@ main(argc, argv) int argc; char **argv; { - int c, todo; + int c, todo, verbose; u_int interval; int reps; char errbuf[_POSIX2_LINE_MAX]; @@ -218,12 +220,15 @@ main(argc, argv) (void)setegid(getgid()); memf = nlistf = NULL; - interval = reps = todo = 0; - while ((c = getopt(argc, argv, "c:fh:HilM:mN:sw:")) != -1) { + interval = reps = todo = verbose = 0; + while ((c = getopt(argc, argv, "c:efh:HilM:mN:svw:")) != -1) { switch (c) { case 'c': reps = atoi(optarg); break; + case 'e': + todo |= EVCNTSTAT; + break; case 'f': todo |= FORKSTAT; break; @@ -251,6 +256,9 @@ main(argc, argv) case 's': todo |= SUMSTAT; break; + case 'v': + verbose = 1; + break; case 'w': interval = atoi(optarg); break; @@ -346,7 +354,9 @@ main(argc, argv) if (todo & SUMSTAT) dosum(); if (todo & INTRSTAT) - dointr(); + dointr(verbose); + if (todo & EVCNTSTAT) + doevcnt(verbose); if (todo & VMSTAT) dovmstat(interval, reps); exit(0); @@ -691,7 +701,7 @@ cpustats() #include #undef _KERNEL void -dointr() +dointr(int verbose) { long i, j, inttotal, uptime; static char iname[64]; @@ -706,7 +716,8 @@ dointr() (void)printf("interrupt total rate\n"); inttotal = 0; for (j = 0; j < 16; j++, ivp++) { - if (ivp->iv_vec && ivp->iv_use && ivp->iv_cnt) { + if (ivp->iv_vec && ivp->iv_use && + (ivp->iv_cnt || verbose)) { if (kvm_read(kd, (u_long)ivp->iv_use, iname, 63) != 63) { (void)fprintf(stderr, "vmstat: iv_use: %s\n", kvm_geterr(kd)); @@ -723,14 +734,15 @@ dointr() } #else void -dointr() +dointr(int verbose) { - long *intrcnt, inttotal, uptime; + long *intrcnt; + long long inttotal, uptime; int nintr, inamlen; char *intrname; struct evcntlist allevents; struct evcnt evcnt, *evptr; - struct device dev; + char evgroup[EVCNT_STRING_MAX], evname[EVCNT_STRING_MAX]; uptime = getuptime(); nintr = namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value; @@ -744,42 +756,96 @@ dointr() } kread(X_INTRCNT, intrcnt, (size_t)nintr); kread(X_INTRNAMES, intrname, (size_t)inamlen); - (void)printf("interrupt total rate\n"); + (void)printf("%-24s %16s %8s\n", "interrupt", "total", "rate"); inttotal = 0; nintr /= sizeof(long); while (--nintr >= 0) { - if (*intrcnt) - (void)printf("%-14s %8ld %8ld\n", intrname, - *intrcnt, *intrcnt / uptime); + if (*intrcnt || verbose) + (void)printf("%-24s %16lld %8lld\n", intrname, + (long long)*intrcnt, + (long long)(*intrcnt / uptime)); intrname += strlen(intrname) + 1; inttotal += *intrcnt++; } kread(X_ALLEVENTS, &allevents, sizeof allevents); evptr = allevents.tqh_first; while (evptr) { - if (kvm_read(kd, (long)evptr, (void *)&evcnt, - sizeof evcnt) != sizeof evcnt) { + if (kvm_read(kd, (long)evptr, &evcnt, sizeof evcnt) != sizeof evcnt) { +event_chain_trashed: (void)fprintf(stderr, "vmstat: event chain trashed: %s\n", kvm_geterr(kd)); exit(1); } - if (kvm_read(kd, (long)evcnt.ev_dev, (void *)&dev, - sizeof dev) != sizeof dev) { - (void)fprintf(stderr, "vmstat: event chain trashed: %s\n", - kvm_geterr(kd)); - exit(1); - } - if (evcnt.ev_count) - (void)printf("%-14s %8ld %8ld\n", dev.dv_xname, - (long)evcnt.ev_count, evcnt.ev_count / uptime); - inttotal += evcnt.ev_count++; evptr = evcnt.ev_list.tqe_next; + if (evcnt.ev_type != EVCNT_TYPE_INTR) + continue; + + if (evcnt.ev_count == 0 && !verbose) + continue; + + if (kvm_read(kd, (long)evcnt.ev_group, evgroup, + evcnt.ev_grouplen + 1) != evcnt.ev_grouplen + 1) + goto event_chain_trashed; + if (kvm_read(kd, (long)evcnt.ev_name, evname, + evcnt.ev_namelen + 1) != evcnt.ev_namelen + 1) + goto event_chain_trashed; + + (void)printf("%s %s%*s %16lld %8lld\n", evgroup, evname, + 24 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "", + (long long)evcnt.ev_count, + (long long)(evcnt.ev_count / uptime)); + + inttotal += evcnt.ev_count++; } - (void)printf("Total %8ld %8ld\n", inttotal, inttotal / uptime); + (void)printf("%-24s %16lld %8lld\n", "Total", inttotal, + (long long)(inttotal / uptime)); } #endif +void +doevcnt(int verbose) +{ + long long uptime; + struct evcntlist allevents; + struct evcnt evcnt, *evptr; + char evgroup[EVCNT_STRING_MAX], evname[EVCNT_STRING_MAX]; + + /* XXX should print type! */ + + uptime = getuptime(); + (void)printf("%-24s %16s %8s %s\n", "event", "total", "rate", "type"); + kread(X_ALLEVENTS, &allevents, sizeof allevents); + evptr = allevents.tqh_first; + while (evptr) { + if (kvm_read(kd, (long)evptr, &evcnt, sizeof evcnt) != sizeof evcnt) { +event_chain_trashed: + (void)fprintf(stderr, "vmstat: event chain trashed: %s\n", + kvm_geterr(kd)); + exit(1); + } + + evptr = evcnt.ev_list.tqe_next; + if (evcnt.ev_count == 0 && !verbose) + continue; + + if (kvm_read(kd, (long)evcnt.ev_group, evgroup, + evcnt.ev_grouplen + 1) != evcnt.ev_grouplen + 1) + goto event_chain_trashed; + if (kvm_read(kd, (long)evcnt.ev_name, evname, + evcnt.ev_namelen + 1) != evcnt.ev_namelen + 1) + goto event_chain_trashed; + + (void)printf("%s %s%*s %16lld %8lld %s\n", evgroup, evname, + 24 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "", + (long long)evcnt.ev_count, + (long long)(evcnt.ev_count / uptime), + /* XXX do the following with an array lookup XXX */ + (evcnt.ev_type == EVCNT_TYPE_MISC) ? "misc" : + ((evcnt.ev_type == EVCNT_TYPE_INTR) ? "intr" : "?")); + } +} + /* * These names are defined in . */ @@ -1166,7 +1232,7 @@ usage() { (void)fprintf(stderr, - "usage: vmstat [-fHilms] [-h histname] [-c count] [-M core] \ + "usage: vmstat [-efHilmsv] [-h histname] [-c count] [-M core] \ [-N system] [-w wait] [disks]\n"); exit(1); }