diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 40060283bd1d..04d945cc1e4a 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $Id: interrupt.c,v 1.6 1998/11/15 18:25:15 dfr Exp $ */ +/* $Id: interrupt.c,v 1.7 1998/11/18 23:51:40 dfr Exp $ */ /* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */ /* @@ -50,14 +50,12 @@ #include #include -#if 0 #ifdef EVCNT_COUNTERS #include struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */ #else #include #endif -#endif volatile int mc_expected, mc_received; @@ -84,12 +82,10 @@ interrupt(a0, a1, a2, framep) case ALPHA_INTR_CLOCK: /* clock interrupt */ cnt.v_intr++; -#if 0 #ifdef EVCNT_COUNTERS clock_intr_evcnt.ev_count++; #else intrcnt[INTRCNT_CLOCK]++; -#endif #endif if (platform.clockintr) (*platform.clockintr)(framep); @@ -287,12 +283,13 @@ struct alpha_intr { int vector; /* vector to match */ driver_intr_t *intr; /* handler function */ void *arg; /* argument to handler */ + volatile long *cntp; /* interrupt counter */ }; static struct alpha_intr_list alpha_intr_hash[31]; int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg, - void **cookiep) + void **cookiep, volatile long *cntp) { int h = HASHVEC(vector); struct alpha_intr *i; @@ -304,6 +301,10 @@ int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg, i->vector = vector; i->intr = intr; i->arg = arg; + if (cntp) + i->cntp = cntp; + else + i->cntp = NULL; s = splhigh(); LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list); @@ -331,8 +332,13 @@ void alpha_dispatch_intr(void *frame, unsigned long vector) { struct alpha_intr *i; + volatile long *cntp; + int h = HASHVEC(vector); for (i = LIST_FIRST(&alpha_intr_hash[h]); i; i = LIST_NEXT(i, list)) - if (i->vector == vector) + if (i->vector == vector) { + if (cntp = i->cntp) + (*cntp) ++; i->intr(i->arg); + } } diff --git a/sys/alpha/alpha/locore.s b/sys/alpha/alpha/locore.s index bcacc2aac0fe..9a3acd6b79a7 100644 --- a/sys/alpha/alpha/locore.s +++ b/sys/alpha/alpha/locore.s @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locore.s,v 1.4 1998/11/09 10:47:19 dima Exp $ + * $Id: locore.s,v 1.5 1998/11/15 00:50:59 dima Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -56,6 +56,11 @@ #include #include +#ifndef EVCNT_COUNTERS +#define _LOCORE +#include +#endif + /* * PTmap is recursive pagemap at top of virtual address space. * Within PTmap, the lev1 and lev0 page tables can be found. @@ -296,10 +301,17 @@ LEAF(restorefpstate, 1) /* XXX: make systat/vmstat happy */ .data EXPORT(intrnames) - ASCIZ "foobar" + .asciz "clock" +intr_n = 0 +.rept INTRCNT_COUNT + .ascii "intr " + .byte intr_n / 10 + '0, intr_n % 10 + '0 + .asciz " " # space for platform-specific rewrite + intr_n = intr_n + 1 +.endr EXPORT(eintrnames) - .align 3 + .align 3 EXPORT(intrcnt) - .quad 0 + .fill INTRCNT_COUNT + 1, 8, 0 EXPORT(eintrcnt) .text diff --git a/sys/alpha/include/intr.h b/sys/alpha/include/intr.h index 3f4c79dcd62d..ea5408920b88 100644 --- a/sys/alpha/include/intr.h +++ b/sys/alpha/include/intr.h @@ -23,14 +23,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: intr.h,v 1.3 1998/08/10 07:53:58 dfr Exp $ + * $Id: intr.h,v 1.4 1998/11/15 18:25:16 dfr Exp $ */ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg, - void **cookiep); + void **cookiep, volatile long *cntp); int alpha_teardown_intr(void *cookie); void alpha_dispatch_intr(void *frame, unsigned long vector); diff --git a/sys/alpha/include/intrcnt.h b/sys/alpha/include/intrcnt.h new file mode 100644 index 000000000000..cd9e70173156 --- /dev/null +++ b/sys/alpha/include/intrcnt.h @@ -0,0 +1,79 @@ +/* $Id$ */ +/* $NetBSD: intrcnt.h,v 1.17 1998/11/19 01:48:04 ross Exp $ */ + +/* + * Copyright (c) 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#define INTRCNT_CLOCK 0 +#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1) +#define INTRCNT_ISA_IRQ_LEN 16 +#define INTRCNT_OTHER_BASE (INTRCNT_ISA_IRQ + INTRCNT_ISA_IRQ_LEN) +#define INTRCNT_OTHER_LEN 48 +#define INTRCNT_COUNT (INTRCNT_OTHER_BASE + INTRCNT_OTHER_LEN) + +#define INTRCNT_A12_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_DEC_1000A_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_DEC_1000_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_DEC_2100_A500_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_DEC_550_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_EB164_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_EB64PLUS_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_EB66_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_IOASIC INTRCNT_OTHER_BASE +#define INTRCNT_KN15 INTRCNT_OTHER_BASE +#define INTRCNT_KN16 INTRCNT_OTHER_BASE +#define INTRCNT_KN20AA_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_KN300_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_KN8AE_IRQ INTRCNT_OTHER_BASE +#define INTRCNT_TCDS INTRCNT_OTHER_BASE + +#define INTRCNT_A12_IRQ_LEN 10 +#define INTRCNT_DEC_1000A_IRQ_LEN 32 +#define INTRCNT_DEC_1000_IRQ_LEN 16 +#define INTRCNT_DEC_2100_A500_IRQ_LEN 16 +#define INTRCNT_DEC_550_IRQ_LEN 48 +#define INTRCNT_EB164_IRQ_LEN 24 +#define INTRCNT_EB64PLUS_IRQ_LEN 32 +#define INTRCNT_EB66_IRQ_LEN 32 +#define INTRCNT_IOASIC_LEN 4 +#define INTRCNT_ISA_IRQ_LEN 16 +#define INTRCNT_KN15_LEN 9 +#define INTRCNT_KN16_LEN 5 +#define INTRCNT_KN20AA_IRQ_LEN 32 +#define INTRCNT_KN300_LEN 19 +#define INTRCNT_KN8AE_IRQ_LEN 2 +#define INTRCNT_TCDS_LEN 2 + +# define INTRCNT_KN300_NCR810 INTRCNT_KN300_IRQ + 16 +# define INTRCNT_KN300_I2C_CTRL INTRCNT_KN300_IRQ + 17 +# define INTRCNT_KN300_I2C_BUS INTRCNT_KN300_IRQ + 18 + +#ifdef KERNEL +#ifndef _LOCORE +extern volatile long intrcnt[]; +#endif +#endif diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c index 84ef87b334a6..32894e614448 100644 --- a/sys/alpha/isa/isa.c +++ b/sys/alpha/isa/isa.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: isa.c,v 1.6 1998/11/15 18:25:16 dfr Exp $ + * $Id: isa.c,v 1.7 1998/11/18 23:53:11 dfr Exp $ */ #include @@ -37,6 +37,7 @@ #include #include #include +#include #include MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device"); @@ -654,7 +655,8 @@ isa_setup_intr(device_t dev, device_t child, ii->irq = irq->r_start; error = alpha_setup_intr(0x800 + (irq->r_start << 4), - isa_handle_intr, ii, &ii->ih); + isa_handle_intr, ii, &ii->ih, + &intrcnt[INTRCNT_ISA_IRQ + irq->r_start]); if (error) { free(ii, M_DEVBUF); return error; diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c index 09b8ac7f1e72..b64bdb33c39a 100644 --- a/sys/alpha/pci/cia.c +++ b/sys/alpha/pci/cia.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cia.c,v 1.10 1998/10/06 14:18:40 dfr Exp $ + * $Id: cia.c,v 1.11 1998/11/15 18:25:16 dfr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -104,6 +104,7 @@ #include #include #include +#include #include #include #include @@ -718,8 +719,9 @@ cia_init() chipset = cia_bwx_chipset; cia_hae_mem = REGVAL(CIA_CSR_HAE_MEM); -#if 0 +#if 1 chipset = cia_swiz_chipset; /* XXX */ + cia_ispyxis = 0; #endif if (platform.pci_intr_init) @@ -825,7 +827,6 @@ cia_setup_intr(device_t dev, device_t child, struct resource *irq, driver_intr_t *intr, void *arg, void **cookiep) { - struct alpha_intr *i; int error; error = rman_activate_resource(irq); @@ -833,7 +834,8 @@ cia_setup_intr(device_t dev, device_t child, return error; error = alpha_setup_intr(0x900 + (irq->r_start << 4), - intr, arg, cookiep); + intr, arg, cookiep, + &intrcnt[INTRCNT_EB164_IRQ + irq->r_start]); if (error) return error;