Switch from intrcnt interrupt account to event counters.
This commit is contained in:
parent
d977618dcf
commit
f645983fc7
|
@ -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 @@ extern struct splvec splvec;
|
|||
#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_clock_evcnt;
|
|||
extern struct evcnt pmax_fpu_evcnt;
|
||||
extern struct evcnt pmax_memerr_evcnt;
|
||||
|
||||
void intr_init(void);
|
||||
#endif /* !_LOCORE */
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
|
|
@ -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 @@ dec_3100_cons_init()
|
|||
#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)
|
||||
|
|
|
@ -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 @@ found:
|
|||
|
||||
#define CALLINTR(vvv) \
|
||||
do { \
|
||||
intrcnt[vvv] += 1; \
|
||||
intrtab[vvv].ih_count.ev_count++; \
|
||||
(*intrtab[vvv].ih_func)(intrtab[vvv].ih_arg); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
@ -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 @@ dec_3maxplus_intr_establish(dev, cookie, level, handler, arg)
|
|||
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)
|
||||
|
|
|
@ -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 @@ dec_3min_intr_establish(dev, cookie, level, handler, arg)
|
|||
#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 @@ dec_3min_intr(status, cause, pc, ipending)
|
|||
}
|
||||
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:
|
||||
|
|
|
@ -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 @@ dec_5100_intr_establish(dev, cookie, level, handler, arg)
|
|||
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)
|
||||
|
||||
|
|
|
@ -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 @@ dec_maxine_intr_establish(dev, cookie, level, handler, arg)
|
|||
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)
|
||||
|
|
|
@ -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 @@ struct evcnt pmax_memerr_evcnt =
|
|||
|
||||
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.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locore_machdep.S,v 1.20 2003/08/07 16:29:14 agc Exp $ */
|
||||
/* $NetBSD: locore_machdep.S,v 1.21 2005/01/11 08:05:14 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -164,24 +164,13 @@ END(dec_mips1_wbflush)
|
|||
#endif /* defined(DEC_5100) || defined(DEC_5400) */
|
||||
|
||||
/*
|
||||
* Interrupt counters for vmstat.
|
||||
* Place holders for old interrupt counter code.
|
||||
* Still needed by vmstat for now...
|
||||
*/
|
||||
.data
|
||||
EXPORT(intrnames)
|
||||
.asciiz "serial0"
|
||||
.asciiz "serial1"
|
||||
.asciiz "ether"
|
||||
.asciiz "scsi"
|
||||
.asciiz "optslot0"
|
||||
.asciiz "optslot1"
|
||||
.asciiz "optslot2"
|
||||
.asciiz "dtop"
|
||||
.asciiz "isdn"
|
||||
.asciiz "floppy"
|
||||
EXPORT(eintrnames)
|
||||
|
||||
.align 2
|
||||
EXPORT(intrcnt)
|
||||
.word 0,0,0,0, 0,0,0,0, 0,0,0,0
|
||||
EXPORT(eintrcnt)
|
||||
.word 0 # This shouldn't be needed but with 4.4bsd's as, the eintrcnt
|
||||
# label ends end up in a different section otherwise.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.208 2003/12/30 12:33:18 pk Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.209 2005/01/11 08:05:14 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -77,7 +77,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.208 2003/12/30 12:33:18 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.209 2005/01/11 08:05:14 simonb Exp $");
|
||||
|
||||
#include "fs_mfs.h"
|
||||
#include "opt_ddb.h"
|
||||
|
@ -370,6 +370,9 @@ mach_init(argc, argv, code, cv, bim, bip)
|
|||
/* Machine specific initialization. */
|
||||
(*sysinit[systype].init)();
|
||||
|
||||
/* Interrupt initialization. */
|
||||
intr_init();
|
||||
|
||||
/* Find out how much memory is available. */
|
||||
physmem = (*platform.memsize)(kernend);
|
||||
|
||||
|
|
Loading…
Reference in New Issue