Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax Switch from intrcnt interrupt account to event...



details:   https://anonhg.NetBSD.org/src/rev/1749099bd26b
branches:  trunk
changeset: 572740:1749099bd26b
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Jan 11 08:05:13 2005 +0000

description:
Switch from intrcnt interrupt account to event counters.

diffstat:

 sys/arch/pmax/include/intr.h        |  40 ++++++++++++------------------------
 sys/arch/pmax/pmax/dec_3100.c       |   6 ++--
 sys/arch/pmax/pmax/dec_3max.c       |   6 ++--
 sys/arch/pmax/pmax/dec_3maxplus.c   |   6 ++--
 sys/arch/pmax/pmax/dec_3min.c       |  12 +++++-----
 sys/arch/pmax/pmax/dec_5100.c       |   6 ++--
 sys/arch/pmax/pmax/dec_maxine.c     |   6 ++--
 sys/arch/pmax/pmax/interrupt.c      |  27 +++++++++++++++++++++++-
 sys/arch/pmax/pmax/locore_machdep.S |  19 +++-------------
 sys/arch/pmax/pmax/machdep.c        |   7 ++++-
 10 files changed, 68 insertions(+), 67 deletions(-)

diffs (truncated from 362 to 300 lines):

diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/include/intr.h
--- a/sys/arch/pmax/include/intr.h      Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/include/intr.h      Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.24 2003/05/25 14:04:45 tsutsui Exp $        */
+/*     $NetBSD: intr.h,v 1.25 2005/01/11 08:05:13 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -120,38 +120,23 @@
 #define MIPS_SPL_0_1_3  (MIPS_INT_MASK_3|MIPS_SPL_0_1)
 #define MIPS_SPL_0_1_2_3 (MIPS_INT_MASK_3|MIPS_SPL_0_1_2)
 
-/*
- * Index into intrcnt[], which is defined in locore
- */
-extern u_long intrcnt[];
-
-#define        SERIAL0_INTR    0
-#define        SERIAL1_INTR    1
-#define        LANCE_INTR      2
-#define        SCSI_INTR       3
-#define        SLOT0_INTR      4
-#define        SLOT1_INTR      5
-#define        SLOT2_INTR      6
-#define        DTOP_INTR       7
-#define        ISDN_INTR       8
-#define        FLOPPY_INTR     9
-
 struct intrhand {
        int     (*ih_func) __P((void *));
        void    *ih_arg;
+       struct evcnt ih_count;
 };
 extern struct intrhand intrtab[];
 
-#define SYS_DEV_SCSI   SCSI_INTR
-#define SYS_DEV_LANCE  LANCE_INTR
-#define SYS_DEV_SCC0   SERIAL0_INTR
-#define SYS_DEV_SCC1   SERIAL1_INTR
-#define SYS_DEV_DTOP   DTOP_INTR
-#define SYS_DEV_FDC    FLOPPY_INTR
-#define SYS_DEV_ISDN   ISDN_INTR
-#define SYS_DEV_OPT0   SLOT0_INTR
-#define SYS_DEV_OPT1   SLOT1_INTR
-#define SYS_DEV_OPT2   SLOT2_INTR
+#define SYS_DEV_SCC0   0
+#define SYS_DEV_SCC1   1
+#define SYS_DEV_LANCE  2
+#define SYS_DEV_SCSI   3
+#define SYS_DEV_OPT0   4
+#define SYS_DEV_OPT1   5
+#define SYS_DEV_OPT2   6
+#define SYS_DEV_DTOP   7
+#define SYS_DEV_ISDN   8
+#define SYS_DEV_FDC    9
 #define SYS_DEV_BOGUS  -1
 #define MAX_DEV_NCOOKIES 10
 
@@ -168,6 +153,7 @@
 extern struct evcnt pmax_fpu_evcnt;
 extern struct evcnt pmax_memerr_evcnt;
 
+void intr_init(void);
 #endif /* !_LOCORE */
 #endif /* _KERNEL */
 
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_3100.c
--- a/sys/arch/pmax/pmax/dec_3100.c     Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_3100.c     Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3100.c,v 1.38 2003/12/13 23:04:38 ad Exp $ */
+/* $NetBSD: dec_3100.c,v 1.39 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dec_3100.c,v 1.38 2003/12/13 23:04:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3100.c,v 1.39 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -231,7 +231,7 @@
 #define CALLINTR(vvv, cp0)                                     \
     do {                                                       \
        if (ipending & (cp0)) {                                 \
-               intrcnt[vvv] += 1;                              \
+               intrtab[vvv].ih_count.ev_count++;               \
                (*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg);   \
        }                                                       \
     } while (0)
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_3max.c
--- a/sys/arch/pmax/pmax/dec_3max.c     Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_3max.c     Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3max.c,v 1.39 2003/12/13 23:04:38 ad Exp $ */
+/* $NetBSD: dec_3max.c,v 1.40 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -106,7 +106,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3max.c,v 1.39 2003/12/13 23:04:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3max.c,v 1.40 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -288,7 +288,7 @@
 
 #define CALLINTR(vvv)                                          \
        do {                                                    \
-               intrcnt[vvv] += 1;                              \
+               intrtab[vvv].ih_count.ev_count++;               \
                (*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg);   \
        } while (0)
 
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_3maxplus.c
--- a/sys/arch/pmax/pmax/dec_3maxplus.c Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_3maxplus.c Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3maxplus.c,v 1.50 2004/02/13 11:36:16 wiz Exp $ */
+/* $NetBSD: dec_3maxplus.c,v 1.51 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -106,7 +106,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.50 2004/02/13 11:36:16 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.51 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -324,7 +324,7 @@
     do {                                                       \
        if (can_serve & (bits)) {                               \
                ifound = 1;                                     \
-               intrcnt[vvv] += 1;                              \
+               intrtab[vvv].ih_count.ev_count++;               \
                (*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg);   \
        }                                                       \
     } while (0)
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_3min.c
--- a/sys/arch/pmax/pmax/dec_3min.c     Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_3min.c     Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3min.c,v 1.51 2003/12/13 23:04:38 ad Exp $ */
+/* $NetBSD: dec_3min.c,v 1.52 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -106,7 +106,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3min.c,v 1.51 2003/12/13 23:04:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3min.c,v 1.52 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -364,7 +364,7 @@
 #define CHECKINTR(slot, bits)                                  \
     do {                                                       \
        if (can_serve & (bits)) {                               \
-               intrcnt[slot] += 1;                             \
+               intrtab[slot].ih_count.ev_count++;              \
                (*intrtab[slot].ih_func)(intrtab[slot].ih_arg); \
        }                                                       \
     } while (0)
@@ -478,16 +478,16 @@
        }
        if ((ipending & MIPS_INT_MASK_0) && intrtab[SYS_DEV_OPT0].ih_func) {
                (*intrtab[SYS_DEV_OPT0].ih_func)(intrtab[SYS_DEV_OPT0].ih_arg);
-               intrcnt[SYS_DEV_OPT0]++;
+               intrtab[SYS_DEV_OPT0].ih_count.ev_count++;
        }
 
        if ((ipending & MIPS_INT_MASK_1) && intrtab[SYS_DEV_OPT1].ih_func) {
                (*intrtab[SYS_DEV_OPT1].ih_func)(intrtab[SYS_DEV_OPT1].ih_arg);
-               intrcnt[SYS_DEV_OPT1]++;
+               intrtab[SYS_DEV_OPT1].ih_count.ev_count++;
        }
        if ((ipending & MIPS_INT_MASK_2) && intrtab[SYS_DEV_OPT2].ih_func) {
                (*intrtab[SYS_DEV_OPT2].ih_func)(intrtab[SYS_DEV_OPT2].ih_arg);
-               intrcnt[SYS_DEV_OPT2]++;
+               intrtab[SYS_DEV_OPT2].ih_count.ev_count++;
        }
 
 done:
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_5100.c
--- a/sys/arch/pmax/pmax/dec_5100.c     Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_5100.c     Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_5100.c,v 1.34 2003/12/13 23:04:38 ad Exp $ */
+/* $NetBSD: dec_5100.c,v 1.35 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_5100.c,v 1.34 2003/12/13 23:04:38 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_5100.c,v 1.35 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -147,7 +147,7 @@
     do {                                                               \
        if ((icsr & (ibit)) && intrtab[vvv].ih_func) {                  \
                (*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg);           \
-               intrcnt[vvv]++;                                         \
+               intrtab[vvv].ih_count.ev_count++;                       \
        }                                                               \
     } while (0)
 
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/dec_maxine.c
--- a/sys/arch/pmax/pmax/dec_maxine.c   Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/dec_maxine.c   Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_maxine.c,v 1.44 2005/01/02 22:36:34 mhitch Exp $ */
+/* $NetBSD: dec_maxine.c,v 1.45 2005/01/11 08:05:14 simonb Exp $ */
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -106,7 +106,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_maxine.c,v 1.44 2005/01/02 22:36:34 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_maxine.c,v 1.45 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -332,7 +332,7 @@
     do {                                                       \
        if (can_serve & (bits)) {                               \
                ifound = 1;                                     \
-               intrcnt[vvv] += 1;                              \
+               intrtab[vvv].ih_count.ev_count++;               \
                (*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg);   \
        }                                                       \
     } while (0)
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/interrupt.c
--- a/sys/arch/pmax/pmax/interrupt.c    Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/interrupt.c    Tue Jan 11 08:05:13 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.9 2005/01/11 07:01:38 simonb Exp $     */
+/*     $NetBSD: interrupt.c,v 1.10 2005/01/11 08:05:14 simonb Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.9 2005/01/11 07:01:38 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.10 2005/01/11 08:05:14 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -67,6 +67,29 @@
 
 extern void MachFPInterrupt(unsigned, unsigned, unsigned, struct frame *);
 
+static const char * const intrnames[] = {
+       "serial0",
+       "serial1",
+       "ether",
+       "scsi",
+       "optslot0",
+       "optslot1",
+       "optslot2",
+       "dtop",
+       "isdn",
+       "floppy"
+};
+
+void
+intr_init(void)
+{
+       int i;
+
+       for (i = 0; i < MAX_DEV_NCOOKIES; i++)
+               evcnt_attach_dynamic(&intrtab[i].ih_count, EVCNT_TYPE_INTR,
+                   NULL, "pmax", intrnames[i]);
+}
+
 /*
  * pmax uses standard mips1 convention, wiring FPU to hard interrupt 5.
  */
diff -r 1450818377f1 -r 1749099bd26b sys/arch/pmax/pmax/locore_machdep.S
--- a/sys/arch/pmax/pmax/locore_machdep.S       Tue Jan 11 07:47:37 2005 +0000
+++ b/sys/arch/pmax/pmax/locore_machdep.S       Tue Jan 11 08:05:13 2005 +0000



Home | Main Index | Thread Index | Old Index