Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/uba Count adapter, stray and device interrupts ...



details:   https://anonhg.NetBSD.org/src/rev/2a0f33f775fd
branches:  trunk
changeset: 534410:2a0f33f775fd
user:      ragge <ragge%NetBSD.org@localhost>
date:      Thu Jul 25 12:02:00 2002 +0000

description:
Count adapter, stray and device interrupts separately.
>From Johnny Billquist.

diffstat:

 sys/arch/vax/uba/uba_sbi.c |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (61 lines):

diff -r 532d990a0b83 -r 2a0f33f775fd sys/arch/vax/uba/uba_sbi.c
--- a/sys/arch/vax/uba/uba_sbi.c        Thu Jul 25 10:44:25 2002 +0000
+++ b/sys/arch/vax/uba/uba_sbi.c        Thu Jul 25 12:02:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uba_sbi.c,v 1.14 2002/06/06 11:40:53 ragge Exp $          */
+/*     $NetBSD: uba_sbi.c,v 1.15 2002/07/25 12:02:00 ragge Exp $          */
 /*
  * Copyright (c) 1996 Jonathan Stone.
  * Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
@@ -103,6 +103,9 @@
        sizeof(struct uba_vsoftc), dw780_match, dw780_attach
 };
 
+static struct evcnt strayint = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "uba","stray intr");
+static int strayinit = 0;
+
 extern struct vax_bus_space vax_mem_bus_space;
 
 int
@@ -148,6 +151,10 @@
        sc->uh_ibase = VAX_NBPG + ubaddr * VAX_NBPG;
        sc->uv_sc.uh_type = UBA_UBA;
 
+       if (strayinit++ == 0) evcnt_attach_static(&strayint); /* Setup stray
+                                                                interrupt
+                                                                counter. */
+
        /*
         * Set up dispatch vectors for DW780.
         */
@@ -208,9 +215,11 @@
        struct  uba_vsoftc *vc = arg;
        struct  uba_regs *ur = vc->uv_uba;
        struct  ivec_dsp *ivec;
+       struct  evcnt *uvec;
        int     br, vec;
 
        br = mfpr(PR_IPL);
+       uvec = &vc->uv_sc.uh_intrcnt;
        vec = ur->uba_brrvr[br - 0x14];
        if (vec <= 0) {
                ubaerror(&vc->uv_sc, &br, &vec);
@@ -218,10 +227,16 @@
                        return;
        }
 
-       if (cold && scb_vec[(vc->uh_ibase + vec)/4].hoppaddr == scb_stray) {
+       uvec->ev_count--;       /* This interrupt should not be counted against
+                                  the uba. */
+       ivec = &scb_vec[(vc->uh_ibase + vec)/4];
+       if (cold && *ivec->hoppaddr == scb_stray) {
                scb_fake(vec + vc->uh_ibase, br);
        } else {
-               ivec = &scb_vec[(vc->uh_ibase + vec)/4];
+               if (*ivec->hoppaddr == scb_stray)
+                       strayint.ev_count++; /* Count against stray int */
+               else
+                       ivec->ev->ev_count++; /* Count against device */
                (*ivec->hoppaddr)(ivec->pushlarg);
        }
 }



Home | Main Index | Thread Index | Old Index