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

This commit is contained in:
martin 2004-03-23 00:17:12 +00:00
parent 3cc8ffbdb7
commit dfd6258259
3 changed files with 48 additions and 31 deletions

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.95 2004/03/21 14:10:08 pk Exp $");
#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 @@ extern struct sparc_bus_space_tag mainbus_space_tag;
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 @@ extern struct sparc_bus_space_tag mainbus_space_tag;
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 */

View File

@ -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_NEXT offsetof(struct mbuf, m_next)
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)

View File

@ -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 @@ _C_LABEL(sparc_interrupt):
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
mov 1, %l3 ! Ack softint
inc %o0
STULNG %o0, [%l4]
mov 1, %l3 ! Ack softint
stx %o0, [%l4]
sll %l3, %l6, %l3 ! Generate IRQ mask
wrpr %l6, %pil
@ -12133,31 +12133,20 @@ _C_LABEL(ssym):
_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