Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Replace intrcnts by evcnts. XXX - n...



details:   https://anonhg.NetBSD.org/src/rev/2da44221157b
branches:  trunk
changeset: 559731:2da44221157b
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 23 00:17:12 2004 +0000

description:
Replace intrcnts by evcnts. XXX - needs slight tweaking for MULTIPROCESSOR.

diffstat:

 sys/arch/sparc64/sparc64/autoconf.c  |  31 +++++++++++++++++++++++--
 sys/arch/sparc64/sparc64/genassym.cf |   5 +++-
 sys/arch/sparc64/sparc64/locore.s    |  43 +++++++++++++----------------------
 3 files changed, 48 insertions(+), 31 deletions(-)

diffs (160 lines):

diff -r c4bca106fbff -r 2da44221157b sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Tue Mar 23 00:00:49 2004 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Tue Mar 23 00:17:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.95 2004/03/21 14:10:08 pk Exp $ */
+/*     $NetBSD: autoconf.c,v 1.96 2004/03/23 00:17:12 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.95 2004/03/21 14:10:08 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.96 2004/03/23 00:17:12 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -95,6 +95,25 @@
 
 #include "ksyms.h"
 
+struct evcnt intr_evcnts[] = {
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "spur"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev1"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev2"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev3"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev4"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev5"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev6"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev7"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr",  "lev8"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev9"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "clock"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev11"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev12"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev13"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "prof"),
+       EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr",  "lev15")
+};
+
 int printspl = 0;
 
 #ifdef KGDB
@@ -580,7 +599,7 @@
        struct mainbus_attach_args ma;
        char buf[32];
        const char *const *ssp, *sp = NULL;
-       int node0, node, rv;
+       int node0, node, rv, i;
 
        static const char *const openboot_special[] = {
                /* ignore these (end with NULL) */
@@ -611,6 +630,12 @@
        if (ncpus == 0)
                panic("None of the CPUs found");
 
+       /*
+        * Init static interrupt eventcounters
+        */
+       for (i = 0; i < sizeof(intr_evcnts)/sizeof(intr_evcnts[0]); i++)
+               evcnt_attach_static(&intr_evcnts[i]);
+
        node = findroot();
 
        /* Establish the first component of the boot path */
diff -r c4bca106fbff -r 2da44221157b sys/arch/sparc64/sparc64/genassym.cf
--- a/sys/arch/sparc64/sparc64/genassym.cf      Tue Mar 23 00:00:49 2004 +0000
+++ b/sys/arch/sparc64/sparc64/genassym.cf      Tue Mar 23 00:17:12 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.34 2004/03/14 18:18:54 chs Exp $
+#      $NetBSD: genassym.cf,v 1.35 2004/03/23 00:17:12 martin Exp $
 
 #
 # Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -265,6 +265,9 @@
 define M_DATA          offsetof(struct mbuf, m_data)
 define M_LEN           offsetof(struct mbuf, m_len)
 
+# event counters
+define EVC_SIZE                sizeof(struct evcnt)
+
 ifdef notyet
 # floppy trap handler fields
 define FDC_REG_MSR     offsetof(struct fdcio, fdcio_reg_msr)
diff -r c4bca106fbff -r 2da44221157b sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Tue Mar 23 00:00:49 2004 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Tue Mar 23 00:17:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.194 2004/03/14 18:18:54 chs Exp $ */
+/*     $NetBSD: locore.s,v 1.195 2004/03/23 00:17:12 martin Exp $      */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -4463,18 +4463,18 @@
        stx     %l2, [%sp + CC64FSZ + STKB + TF_NPC]
        
        sub     %l5, 0x40, %l6                  ! Convert to interrupt level
-       sethi   %hi(_C_LABEL(intrcnt)), %l4
+       sethi   %hi(_C_LABEL(intr_evcnts)), %l4
        stb     %l6, [%sp + CC64FSZ + STKB + TF_PIL]    ! set up intrframe/clockframe
        rdpr    %pil, %o1
-       sll     %l6, LNGSHFT, %l3
-       or      %l4, %lo(_C_LABEL(intrcnt)), %l4        ! intrcnt[intlev]++;
+       mulx    %l6, EVC_SIZE, %l3
+       or      %l4, %lo(_C_LABEL(intr_evcnts)), %l4    ! intrcnt[intlev]++;
        stb     %o1, [%sp + CC64FSZ + STKB + TF_OLDPIL] ! old %pil
-       LDULNG  [%l4 + %l3], %o0
+       ldx     [%l4 + %l3], %o0
        add     %l4, %l3, %l4
        clr     %l5                     ! Zero handled count
+       inc     %o0     
        mov     1, %l3                  ! Ack softint
-       inc     %o0     
-       STULNG  %o0, [%l4]
+       stx     %o0, [%l4]
        sll     %l3, %l6, %l3           ! Generate IRQ mask
        
        wrpr    %l6, %pil
@@ -12133,31 +12133,20 @@
 _C_LABEL(proc0paddr):
        POINTER _C_LABEL(u0)            ! KVA of proc0 uarea
 
-/* interrupt counters  XXX THESE BELONG ELSEWHERE (if anywhere) */
-       .globl  _C_LABEL(intrcnt), _C_LABEL(eintrcnt), _C_LABEL(intrnames), _C_LABEL(eintrnames)
+/*
+ * Symbols that vmstat -i wants, even though they're not used.
+ */
+.globl _C_LABEL(intrnames)
 _C_LABEL(intrnames):
-       .asciz  "spur"
-       .asciz  "lev1"
-       .asciz  "lev2"
-       .asciz  "lev3"
-       .asciz  "lev4"
-       .asciz  "lev5"
-       .asciz  "lev6"
-       .asciz  "lev7"
-       .asciz  "lev8"
-       .asciz  "lev9"
-       .asciz  "clock"
-       .asciz  "lev11"
-       .asciz  "lev12"
-       .asciz  "lev13"
-       .asciz  "prof"
-       .asciz  "lev15"
+.globl _C_LABEL(eintrnames)
 _C_LABEL(eintrnames):
-       _ALIGN
+
+.globl _C_LABEL(intrcnt)
 _C_LABEL(intrcnt):
-       .space  16 * LNGSZ
+.globl _C_LABEL(eintrcnt)
 _C_LABEL(eintrcnt):
 
+
 #if !defined(MULTIPROCESSOR)
        .comm   _C_LABEL(curlwp), PTRSZ
 #endif



Home | Main Index | Thread Index | Old Index