summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvme88k/dev/bussw.c12
-rw-r--r--sys/arch/mvme88k/dev/cl.c47
-rw-r--r--sys/arch/mvme88k/dev/clock.c26
-rw-r--r--sys/arch/mvme88k/dev/dart.c10
-rw-r--r--sys/arch/mvme88k/dev/if_ie.c15
-rw-r--r--sys/arch/mvme88k/dev/if_le.c8
-rw-r--r--sys/arch/mvme88k/dev/if_levar.h3
-rw-r--r--sys/arch/mvme88k/dev/memc.c4
-rw-r--r--sys/arch/mvme88k/dev/osiop_pcctwo.c12
-rw-r--r--sys/arch/mvme88k/dev/pcctwo.c8
-rw-r--r--sys/arch/mvme88k/dev/pcctwovar.h4
-rw-r--r--sys/arch/mvme88k/dev/syscon.c16
-rw-r--r--sys/arch/mvme88k/dev/sysconreg.h4
-rw-r--r--sys/arch/mvme88k/dev/vme.c10
-rw-r--r--sys/arch/mvme88k/dev/vme.h4
-rw-r--r--sys/arch/mvme88k/dev/vs.c14
-rw-r--r--sys/arch/mvme88k/dev/vsvar.h4
-rw-r--r--sys/arch/mvme88k/dev/vx.c10
-rw-r--r--sys/arch/mvme88k/include/cpu.h12
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c75
20 files changed, 121 insertions, 177 deletions
diff --git a/sys/arch/mvme88k/dev/bussw.c b/sys/arch/mvme88k/dev/bussw.c
index a466f296a24..67adc2d4667 100644
--- a/sys/arch/mvme88k/dev/bussw.c
+++ b/sys/arch/mvme88k/dev/bussw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bussw.c,v 1.14 2004/05/07 18:10:28 miod Exp $ */
+/* $OpenBSD: bussw.c,v 1.15 2004/07/30 19:02:05 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
*
@@ -60,7 +60,7 @@ struct cfdriver bussw_cd = {
int bussw_print(void *, const char *);
int bussw_scan(struct device *, void *, void *);
int busswabort(void *);
-int busswintr_establish(int, struct intrhand *);
+int busswintr_establish(int, struct intrhand *, const char *);
int
bussw_match(parent, vcf, args)
@@ -123,7 +123,7 @@ bussw_attach(parent, self, args)
sc->sc_abih.ih_wantframe = 1;
sc->sc_abih.ih_ipl = IPL_NMI;
- busswintr_establish(BS_ABORTIRQ, &sc->sc_abih);
+ busswintr_establish(BS_ABORTIRQ, &sc->sc_abih, "abort");
bus_space_write_1(sc->sc_iot, ioh, BS_ABORT,
bus_space_read_4(sc->sc_iot, ioh, BS_ABORT) | BS_ABORT_IEN);
@@ -174,16 +174,14 @@ bussw_scan(parent, child, args)
}
int
-busswintr_establish(vec, ih)
- int vec;
- struct intrhand *ih;
+busswintr_establish(int vec, struct intrhand *ih, const char *name)
{
#ifdef DIAGNOSTIC
if (vec < 0 || vec >= BS_NVEC)
panic("busswintr_establish: illegal vector 0x%x\n", vec);
#endif
- return (intr_establish(BS_VECBASE + vec, ih));
+ return intr_establish(BS_VECBASE + vec, ih, name);
}
int
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index 428be1b605f..9788d57cab8 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.47 2004/07/02 14:00:42 miod Exp $ */
+/* $OpenBSD: cl.c,v 1.48 2004/07/30 19:02:05 miod Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -35,7 +35,6 @@
#include <sys/time.h>
#include <sys/device.h>
#include <sys/syslog.h>
-#include <sys/evcount.h>
#include <machine/autoconf.h>
#include <machine/conf.h>
@@ -110,18 +109,16 @@ struct clsoftc {
struct device sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
- struct evcount sc_txintrcnt;
- char sc_txintrname[16 + 3];
- struct evcount sc_rxintrcnt;
- char sc_rxintrname[16 + 3];
- struct evcount sc_mxintrcnt;
- char sc_mxintrname[16 + 3];
time_t sc_fotime; /* time of last fifo overrun */
struct cl_info sc_cl[CLCD_PORTS_PER_CHIP];
struct intrhand sc_ih_e;
struct intrhand sc_ih_m;
struct intrhand sc_ih_t;
struct intrhand sc_ih_r;
+ char sc_errintrname[16 + 4];
+ char sc_mxintrname[16 + 3];
+ char sc_rxintrname[16 + 3];
+ char sc_txintrname[16 + 3];
struct pcctwosoftc *sc_pcctwo;
};
@@ -361,10 +358,19 @@ clattach(parent, self, aux)
sc->sc_ih_r.ih_wantframe = 0;
sc->sc_ih_r.ih_ipl = ca->ca_ipl;
- pcctwointr_establish(PCC2V_SCC_RXE, &sc->sc_ih_e);
- pcctwointr_establish(PCC2V_SCC_M, &sc->sc_ih_m);
- pcctwointr_establish(PCC2V_SCC_TX, &sc->sc_ih_t);
- pcctwointr_establish(PCC2V_SCC_RX, &sc->sc_ih_r);
+ snprintf(sc->sc_errintrname, sizeof sc->sc_errintrname,
+ "%s_err", self->dv_xname);
+ snprintf(sc->sc_mxintrname, sizeof sc->sc_mxintrname,
+ "%s_mx", self->dv_xname);
+ snprintf(sc->sc_rxintrname, sizeof sc->sc_rxintrname,
+ "%s_rx", self->dv_xname);
+ snprintf(sc->sc_txintrname, sizeof sc->sc_txintrname,
+ "%s_tx", self->dv_xname);
+
+ pcctwointr_establish(PCC2V_SCC_RXE, &sc->sc_ih_e, sc->sc_errintrname);
+ pcctwointr_establish(PCC2V_SCC_M, &sc->sc_ih_m, sc->sc_mxintrname);
+ pcctwointr_establish(PCC2V_SCC_TX, &sc->sc_ih_t, sc->sc_txintrname);
+ pcctwointr_establish(PCC2V_SCC_RX, &sc->sc_ih_r, sc->sc_rxintrname);
bus_space_write_1(sc->sc_pcctwo->sc_iot, sc->sc_pcctwo->sc_ioh,
PCCTWO_SCCICR, PCC2_IRQ_IEN | (ca->ca_ipl & PCC2_IRQ_IPL));
@@ -373,19 +379,6 @@ clattach(parent, self, aux)
bus_space_write_1(sc->sc_pcctwo->sc_iot, sc->sc_pcctwo->sc_ioh,
PCCTWO_SCCRX, PCC2_IRQ_IEN | (ca->ca_ipl & PCC2_IRQ_IPL));
- snprintf(sc->sc_txintrname, sizeof sc->sc_txintrname,
- "%s_tx", self->dv_xname);
- evcount_attach(&sc->sc_txintrcnt, sc->sc_txintrname,
- (void *)&sc->sc_ih_t.ih_ipl, &evcount_intr);
- snprintf(sc->sc_rxintrname, sizeof sc->sc_rxintrname,
- "%s_rx", self->dv_xname);
- evcount_attach(&sc->sc_rxintrcnt, sc->sc_rxintrname,
- (void *)&sc->sc_ih_r.ih_ipl, &evcount_intr);
- snprintf(sc->sc_mxintrname, sizeof sc->sc_mxintrname,
- "%s_mx", self->dv_xname);
- evcount_attach(&sc->sc_mxintrcnt, sc->sc_mxintrname,
- (void *)&sc->sc_ih_m.ih_ipl, &evcount_intr);
-
printf("\n");
}
@@ -1315,7 +1308,6 @@ cl_mintr(arg)
log(LOG_WARNING, "cl_mintr extra intr\n");
return 0;
}
- sc->sc_mxintrcnt.ec_count++;
channel = mir & 0x03;
misr = bus_space_read_1(iot, ioh, CL_MISR);
@@ -1378,7 +1370,6 @@ cl_txintr(arg)
log(LOG_WARNING, "cl_txintr extra intr\n");
return 0;
}
- sc->sc_txintrcnt.ec_count++;
channel = tir & 0x03;
sc->sc_cl[channel].txcnt ++;
@@ -1513,7 +1504,7 @@ cl_rxintr(arg)
log(LOG_WARNING, "cl_rxintr extra intr\n");
return 0;
}
- sc->sc_rxintrcnt.ec_count++;
+
channel = rir & 0x3;
cmr = bus_space_read_1(iot, ioh, CL_CMR);
diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c
index cb2e4061e38..b193c5ad6f0 100644
--- a/sys/arch/mvme88k/dev/clock.c
+++ b/sys/arch/mvme88k/dev/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.32 2004/07/23 21:00:09 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.33 2004/07/30 19:02:05 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -75,7 +75,6 @@
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/systm.h>
-#include <sys/evcount.h>
#include <machine/asm.h>
#include <machine/board.h> /* for register defines */
@@ -118,9 +117,7 @@ void write_cio(int, u_int8_t);
struct clocksoftc {
struct device sc_dev;
struct intrhand sc_profih;
- struct evcount sc_profcnt;
struct intrhand sc_statih;
- struct evcount sc_statcnt;
};
struct cfattach clock_ca = {
@@ -194,14 +191,14 @@ clockattach(struct device *parent, struct device *self, void *args)
sc->sc_profih.ih_wantframe = 1;
sc->sc_profih.ih_ipl = ca->ca_ipl;
prof_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR;
- pcctwointr_establish(PCC2V_TIMER1, &sc->sc_profih);
+ pcctwointr_establish(PCC2V_TIMER1, &sc->sc_profih, "clock");
md.clock_init_func = sbc_initclock;
sc->sc_statih.ih_fn = sbc_statintr;
sc->sc_statih.ih_arg = 0;
sc->sc_statih.ih_wantframe = 1;
sc->sc_statih.ih_ipl = ca->ca_ipl;
stat_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR;
- pcctwointr_establish(PCC2V_TIMER2, &sc->sc_statih);
+ pcctwointr_establish(PCC2V_TIMER2, &sc->sc_statih, "stat");
md.statclock_init_func = sbc_initstatclock;
break;
#endif /* NPCCTWO */
@@ -211,22 +208,18 @@ clockattach(struct device *parent, struct device *self, void *args)
sc->sc_profih.ih_arg = 0;
sc->sc_profih.ih_wantframe = 1;
sc->sc_profih.ih_ipl = ca->ca_ipl;
- sysconintr_establish(SYSCV_TIMER1, &sc->sc_profih);
+ sysconintr_establish(SYSCV_TIMER1, &sc->sc_profih, "clock");
md.clock_init_func = m188_initclock;
sc->sc_statih.ih_fn = m188_statintr;
sc->sc_statih.ih_arg = 0;
sc->sc_statih.ih_wantframe = 1;
sc->sc_statih.ih_ipl = ca->ca_ipl;
- sysconintr_establish(SYSCV_TIMER2, &sc->sc_statih);
+ sysconintr_establish(SYSCV_TIMER2, &sc->sc_statih, "stat");
md.statclock_init_func = m188_initstatclock;
break;
#endif /* NSYSCON */
}
- evcount_attach(&sc->sc_statcnt, "stat", (void *)&sc->sc_statih.ih_ipl,
- &evcount_intr);
- evcount_attach(&sc->sc_profcnt, "clock", (void *)&sc->sc_profih.ih_ipl,
- &evcount_intr);
printf("\n");
}
@@ -262,13 +255,10 @@ sbc_initclock(void)
int
sbc_clockintr(void *eframe)
{
- struct clocksoftc *sc = clock_cd.cd_devs[0];
-
*(volatile u_int8_t *)(OBIO_START + PCC2_BASE + PCCTWO_T1ICR) =
prof_reset;
intrcnt[M88K_CLK_IRQ]++;
- sc->sc_profcnt.ec_count++;
hardclock(eframe);
#if NBUGTTY > 0
@@ -315,14 +305,12 @@ sbc_initstatclock(void)
int
sbc_statintr(void *eframe)
{
- struct clocksoftc *sc = clock_cd.cd_devs[0];
u_long newint, r, var;
*(volatile u_int8_t *)(OBIO_START + PCC2_BASE + PCCTWO_T2ICR) =
stat_reset;
intrcnt[M88K_SCLK_IRQ]++;
- sc->sc_statcnt.ec_count++;
statclock((struct clockframe *)eframe);
@@ -354,7 +342,6 @@ sbc_statintr(void *eframe)
int
m188_clockintr(void *eframe)
{
- struct clocksoftc *sc = clock_cd.cd_devs[0];
volatile int tmp;
/* acknowledge the timer interrupt */
@@ -364,7 +351,6 @@ m188_clockintr(void *eframe)
tmp = *(int *volatile)DART_STOPC;
intrcnt[M88K_CLK_IRQ]++;
- sc->sc_profcnt.ec_count++;
hardclock(eframe);
#if NBUGTTY > 0
@@ -438,13 +424,11 @@ m188_timer_init(unsigned period)
int
m188_statintr(void *eframe)
{
- struct clocksoftc *sc = clock_cd.cd_devs[0];
u_long newint, r, var;
CIO_LOCK;
intrcnt[M88K_SCLK_IRQ]++;
- sc->sc_statcnt.ec_count++;
statclock((struct clockframe *)eframe);
write_cio(CIO_CSR1, CIO_GCB | CIO_CIP); /* Ack the interrupt */
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index 1a72ec183c9..48e28be4448 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dart.c,v 1.36 2004/07/23 23:15:49 miod Exp $ */
+/* $OpenBSD: dart.c,v 1.37 2004/07/30 19:02:05 miod Exp $ */
/*
* Mach Operating System
@@ -36,7 +36,6 @@
#include <sys/device.h>
#include <sys/simplelock.h>
#include <sys/syslog.h>
-#include <sys/evcount.h>
#include <machine/asm_macro.h> /* enable/disable interrupts */
#include <machine/autoconf.h>
@@ -74,7 +73,6 @@ struct dart_info {
struct dartsoftc {
struct device sc_dev;
- struct evcount sc_intrcnt;
union dartreg *dart_reg;
union dart_pt_io *port_reg[NDARTPORTS];
struct dart_info sc_dart[NDARTPORTS];
@@ -307,9 +305,7 @@ dartattach(parent, self, aux)
sc->sc_ih.ih_wantframe = 0;
sc->sc_ih.ih_ipl = ca->ca_ipl;
- sysconintr_establish(SYSCV_SCC, &sc->sc_ih);
- evcount_attach(&sc->sc_intrcnt, self->dv_xname,
- (void *)&sc->sc_ih.ih_ipl, &evcount_intr);
+ sysconintr_establish(SYSCV_SCC, &sc->sc_ih, self->dv_xname);
printf("\n");
}
@@ -1103,8 +1099,6 @@ dartintr(arg)
if (isr == 0) /* not interrupt from this duart */
return 0;
- sc->sc_intrcnt.ec_count++;
-
if (isr & IIPCHG) {
unsigned int ip = addr->read.rd_ip;
unsigned int ipcr = addr->read.rd_ipcr;
diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c
index 9478f6516dc..e93398a3a83 100644
--- a/sys/arch/mvme88k/dev/if_ie.c
+++ b/sys/arch/mvme88k/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.29 2004/07/02 14:00:43 miod Exp $ */
+/* $OpenBSD: if_ie.c,v 1.30 2004/07/30 19:02:05 miod Exp $ */
/*-
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -105,7 +105,6 @@ Mode of operation:
#include <sys/errno.h>
#include <sys/syslog.h>
#include <sys/device.h>
-#include <sys/evcount.h>
#include <net/if.h>
#include <net/if_types.h>
@@ -164,7 +163,7 @@ struct vm_map *ie_map; /* for obio */
struct ie_softc {
struct device sc_dev; /* device structure */
struct intrhand sc_ih, sc_failih; /* interrupt info */
- struct evcount sc_intrcnt; /* # of interrupts, per ie */
+ char sc_failintrname[16 + 4];
caddr_t sc_iobase; /* KVA of base of 24 bit addr space */
caddr_t sc_maddr; /* KVA of base of chip's RAM (16bit addr sp.)*/
@@ -484,8 +483,10 @@ ieattach(parent, self, aux)
sc->sc_failih.ih_wantframe = 0;
sc->sc_failih.ih_ipl = ca->ca_ipl;
- pcctwointr_establish(PCC2V_IE, &sc->sc_ih);
- pcctwointr_establish(PCC2V_IEFAIL, &sc->sc_failih);
+ pcctwointr_establish(PCC2V_IE, &sc->sc_ih, self->dv_xname);
+ snprintf(sc->sc_failintrname, sizeof sc->sc_failintrname, "%s_err",
+ self->dv_xname);
+ pcctwointr_establish(PCC2V_IEFAIL, &sc->sc_failih, sc->sc_failintrname);
/* enable device interrupts */
bus_space_write_1(sc->sc_pcctwo->sc_iot, sc->sc_pcctwo->sc_ioh,
@@ -494,9 +495,6 @@ ieattach(parent, self, aux)
bus_space_write_1(sc->sc_pcctwo->sc_iot, sc->sc_pcctwo->sc_ioh,
PCCTWO_IEBERR, PCC2_IRQ_IEN | PCC2_IRQ_ICLR |
(ca->ca_ipl & PCC2_IRQ_IPL));
-
- evcount_attach(&sc->sc_intrcnt, self->dv_xname,
- (void *)&sc->sc_ih.ih_ipl, &evcount_intr);
}
/*
@@ -598,7 +596,6 @@ loop:
if ((status = sc->scb->ie_status) & IE_ST_WHENCE)
goto loop;
- sc->sc_intrcnt.ec_count++;
return 1;
}
diff --git a/sys/arch/mvme88k/dev/if_le.c b/sys/arch/mvme88k/dev/if_le.c
index c1275d9b0f7..50fd152a751 100644
--- a/sys/arch/mvme88k/dev/if_le.c
+++ b/sys/arch/mvme88k/dev/if_le.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le.c,v 1.9 2004/07/02 14:00:43 miod Exp $ */
+/* $OpenBSD: if_le.c,v 1.10 2004/07/30 19:02:05 miod Exp $ */
/*-
* Copyright (c) 1982, 1992, 1993
@@ -41,7 +41,6 @@
#include <sys/socket.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/evcount.h>
#include <net/if.h>
@@ -210,7 +209,6 @@ vle_intr(sc)
struct vlereg1 *reg1 = (struct vlereg1 *)lesc->sc_r1;
int rc;
- lesc->sc_intrcnt.ec_count++;
rc = am7990_intr(sc);
ENABLE_INTR;
return (rc);
@@ -366,7 +364,5 @@ leattach(parent, self, aux)
lesc->sc_ih.ih_arg = sc;
lesc->sc_ih.ih_wantframe = 0;
lesc->sc_ih.ih_ipl = ca->ca_ipl;
- vmeintr_establish(ca->ca_vec, &lesc->sc_ih);
- evcount_attach(&lesc->sc_intrcnt, self->dv_xname,
- (void *)&lesc->sc_ih.ih_ipl, &evcount_intr);
+ vmeintr_establish(ca->ca_vec, &lesc->sc_ih, self->dv_xname);
}
diff --git a/sys/arch/mvme88k/dev/if_levar.h b/sys/arch/mvme88k/dev/if_levar.h
index bb2da7dc373..534709fb992 100644
--- a/sys/arch/mvme88k/dev/if_levar.h
+++ b/sys/arch/mvme88k/dev/if_levar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_levar.h,v 1.3 2004/07/02 14:00:43 miod Exp $ */
+/* $OpenBSD: if_levar.h,v 1.4 2004/07/30 19:02:05 miod Exp $ */
/* $NetBSD: if_levar.h,v 1.5 1996/05/07 01:27:32 thorpej Exp $ */
/*-
@@ -47,7 +47,6 @@ struct le_softc {
struct intrhand sc_ih; /* interrupt vectoring */
u_int16_t sc_csr; /* CSR image */
void *sc_r1; /* LANCE registers */
- struct evcount sc_intrcnt;
u_char sc_ipl;
u_char sc_vec;
};
diff --git a/sys/arch/mvme88k/dev/memc.c b/sys/arch/mvme88k/dev/memc.c
index 822585dbfa6..ec762b816a3 100644
--- a/sys/arch/mvme88k/dev/memc.c
+++ b/sys/arch/mvme88k/dev/memc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memc.c,v 1.10 2004/04/24 19:51:48 miod Exp $ */
+/* $OpenBSD: memc.c,v 1.11 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -105,7 +105,7 @@ memcattach(parent, self, args)
sc->sc_ih.ih_arg = 0;
sc->sc_ih.ih_wantframe = 1;
sc->sc_ih.ih_ipl = 7;
- mcintr_establish(xxx, &sc->sc_ih);
+ mcintr_establish(xxx, &sc->sc_ih, self->dv_xname);
#endif
switch (sc->sc_memc->memc_chipid) {
diff --git a/sys/arch/mvme88k/dev/osiop_pcctwo.c b/sys/arch/mvme88k/dev/osiop_pcctwo.c
index 8d2eabc4be4..518a5dd24ff 100644
--- a/sys/arch/mvme88k/dev/osiop_pcctwo.c
+++ b/sys/arch/mvme88k/dev/osiop_pcctwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiop_pcctwo.c,v 1.2 2004/07/02 14:00:43 miod Exp $ */
+/* $OpenBSD: osiop_pcctwo.c,v 1.3 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
*
@@ -29,7 +29,6 @@
#include <sys/device.h>
#include <sys/disklabel.h>
#include <sys/dkstat.h>
-#include <sys/evcount.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -54,7 +53,6 @@ int osiop_pcctwo_match(struct device *, void *, void *);
struct osiop_pcctwo_softc {
struct osiop_softc sc_osiop;
struct intrhand sc_ih;
- struct evcount sc_intrcnt;
};
struct cfattach osiop_pcctwo_ca = {
@@ -160,18 +158,14 @@ osiop_pcctwo_attach(struct device *parent, struct device *self, void *aux)
psc->sc_ih.ih_ipl = ca->ca_ipl;
/* enable device interrupts */
- pcctwointr_establish(PCC2V_SCSI, &psc->sc_ih);
+ pcctwointr_establish(PCC2V_SCSI, &psc->sc_ih, self->dv_xname);
bus_space_write_1(pcctwo->sc_iot, pcctwo->sc_ioh,
PCCTWO_SCSIICR, PCC2_IRQ_IEN | (ca->ca_ipl & PCC2_IRQ_IPL));
-
- evcount_attach(&psc->sc_intrcnt, self->dv_xname,
- (void *)&psc->sc_ih.ih_ipl, &evcount_intr);
}
int
osiop_pcctwo_intr(void *arg)
{
- struct osiop_pcctwo_softc *psc = arg;
struct osiop_softc *sc = arg;
u_int8_t istat;
@@ -182,8 +176,6 @@ osiop_pcctwo_intr(void *arg)
if ((istat & (OSIOP_ISTAT_SIP | OSIOP_ISTAT_DIP)) == 0)
return 0;
- psc->sc_intrcnt.ec_count++;
-
/*
* 53c710 manual recommends reading dstat and sstat0 at least
* 12 clk cycles apart if reading as bytes (which is what
diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c
index 5dd819704ec..1666c8e2009 100644
--- a/sys/arch/mvme88k/dev/pcctwo.c
+++ b/sys/arch/mvme88k/dev/pcctwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcctwo.c,v 1.25 2004/05/07 18:10:28 miod Exp $ */
+/* $OpenBSD: pcctwo.c,v 1.26 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
* All rights reserved.
@@ -184,14 +184,12 @@ pcctwo_scan(parent, child, args)
* PCC2 interrupts land in a PCC2_NVEC sized hole starting at PCC2_VECBASE
*/
int
-pcctwointr_establish(vec, ih)
- int vec;
- struct intrhand *ih;
+pcctwointr_establish(int vec, struct intrhand *ih, const char *name)
{
#ifdef DIAGNOSTIC
if (vec < 0 || vec >= PCC2_NVEC)
panic("pcctwo_establish: illegal vector 0x%x\n", vec);
#endif
- return (intr_establish(PCC2_VECBASE + vec, ih));
+ return intr_establish(PCC2_VECBASE + vec, ih, name);
}
diff --git a/sys/arch/mvme88k/dev/pcctwovar.h b/sys/arch/mvme88k/dev/pcctwovar.h
index 7e4f57fcf7d..70e4a38f17e 100644
--- a/sys/arch/mvme88k/dev/pcctwovar.h
+++ b/sys/arch/mvme88k/dev/pcctwovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcctwovar.h,v 1.1 2004/04/24 19:51:48 miod Exp $ */
+/* $OpenBSD: pcctwovar.h,v 1.2 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
*
@@ -36,6 +36,6 @@ struct pcctwosoftc {
bus_space_handle_t sc_ioh;
};
-int pcctwointr_establish(int vec, struct intrhand *ih);
+int pcctwointr_establish(int, struct intrhand *, const char *);
#endif /* _MVME88K_PCCTWOVAR_H_ */
diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c
index 739c4f1bb55..2864afe0466 100644
--- a/sys/arch/mvme88k/dev/syscon.c
+++ b/sys/arch/mvme88k/dev/syscon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscon.c,v 1.20 2004/05/07 18:10:28 miod Exp $ */
+/* $OpenBSD: syscon.c,v 1.21 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -152,25 +152,23 @@ sysconattach(parent, self, args)
sc->sc_m188ih.ih_wantframe = 1;
sc->sc_m188ih.ih_ipl = IPL_ABORT;
- sysconintr_establish(SYSCV_ABRT, &sc->sc_abih);
- sysconintr_establish(SYSCV_ACF, &sc->sc_acih);
- sysconintr_establish(SYSCV_SYSF, &sc->sc_sfih);
- intr_establish(M188_IVEC, &sc->sc_m188ih);
+ sysconintr_establish(SYSCV_ABRT, &sc->sc_abih, "abort");
+ sysconintr_establish(SYSCV_ACF, &sc->sc_acih, "acfail");
+ sysconintr_establish(SYSCV_SYSF, &sc->sc_sfih, "sysfail");
+ intr_establish(M188_IVEC, &sc->sc_m188ih, self->dv_xname);
config_search(syscon_scan, self, args);
}
int
-sysconintr_establish(vec, ih)
- int vec;
- struct intrhand *ih;
+sysconintr_establish(int vec, struct intrhand *ih, const char *name)
{
#ifdef DIAGNOSTIC
if (vec < 0 || vec >= SYSCON_NVEC)
panic("sysconintr_establish: illegal vector 0x%x\n", vec);
#endif
- return (intr_establish(SYSCON_VECT + vec, ih));
+ return intr_establish(SYSCON_VECT + vec, ih, name);
}
int
diff --git a/sys/arch/mvme88k/dev/sysconreg.h b/sys/arch/mvme88k/dev/sysconreg.h
index 385a486a6ba..b93f2d9d538 100644
--- a/sys/arch/mvme88k/dev/sysconreg.h
+++ b/sys/arch/mvme88k/dev/sysconreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysconreg.h,v 1.6 2004/04/24 19:51:48 miod Exp $ */
+/* $OpenBSD: sysconreg.h,v 1.7 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
@@ -42,4 +42,4 @@
#define SYSCV_TIMER2 0x08
#define SYSCV_TIMER1 0x09
-int sysconintr_establish(int, struct intrhand *);
+int sysconintr_establish(int, struct intrhand *, const char *);
diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c
index 5f61cd87caa..cc1f4136944 100644
--- a/sys/arch/mvme88k/dev/vme.c
+++ b/sys/arch/mvme88k/dev/vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.c,v 1.37 2004/07/23 22:19:07 miod Exp $ */
+/* $OpenBSD: vme.c,v 1.38 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -464,9 +464,7 @@ vmerw(sc, uio, flags, bus)
*/
int
-vmeintr_establish(vec, ih)
- int vec;
- struct intrhand *ih;
+vmeintr_establish(int vec, struct intrhand *ih, const char *name)
{
struct vmesoftc *sc = (struct vmesoftc *) vme_cd.cd_devs[0];
@@ -480,7 +478,7 @@ vmeintr_establish(vec, ih)
#endif
}
- return intr_establish(vec, ih);
+ return intr_establish(vec, ih, name);
}
#if NPCCTWO > 0
@@ -565,7 +563,7 @@ vme2chip_init(sc)
sc->sc_abih.ih_arg = 0;
sc->sc_abih.ih_wantframe = 1;
sc->sc_abih.ih_ipl = IPL_NMI;
- intr_establish(110, &sc->sc_abih);
+ intr_establish(110, &sc->sc_abih, sc->sc_dev.dv_xname);
irqen = bus_space_read_4(sc->sc_iot, sc->sc_ioh, VME2_IRQEN);
irqen |= VME2_IRQ_AB;
diff --git a/sys/arch/mvme88k/dev/vme.h b/sys/arch/mvme88k/dev/vme.h
index 455a94d8a96..040731c3aeb 100644
--- a/sys/arch/mvme88k/dev/vme.h
+++ b/sys/arch/mvme88k/dev/vme.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.h,v 1.15 2004/04/24 19:51:48 miod Exp $ */
+/* $OpenBSD: vme.h,v 1.16 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -282,7 +282,7 @@ struct vmesoftc {
void *vmepmap(struct device *sc, off_t vmeaddr, int bustype);
int vmerw(struct device *sc, struct uio *uio, int flags, int bus);
-int vmeintr_establish(int vec, struct intrhand *ih);
+int vmeintr_establish(int, struct intrhand *, const char *);
int vme_findvec(int);
int vmescan(struct device *, void *, void *, int);
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c
index 8402ce355f5..2873e22acc5 100644
--- a/sys/arch/mvme88k/dev/vs.c
+++ b/sys/arch/mvme88k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.51 2004/07/20 23:07:06 miod Exp $ */
+/* $OpenBSD: vs.c,v 1.52 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
@@ -48,7 +48,6 @@
#include <sys/dkstat.h>
#include <sys/buf.h>
#include <sys/malloc.h>
-#include <sys/evcount.h>
#include <uvm/uvm.h>
@@ -177,15 +176,10 @@ vsattach(struct device *parent, struct device *self, void *args)
sc->sc_ih_e.ih_wantframe = 0;
sc->sc_ih_e.ih_ipl = ca->ca_ipl;
- vmeintr_establish(sc->sc_nvec, &sc->sc_ih_n);
- vmeintr_establish(sc->sc_evec, &sc->sc_ih_e);
-
- evcount_attach(&sc->sc_intrcnt_n, self->dv_xname,
- (void *)&sc->sc_ih_n.ih_ipl, &evcount_intr);
+ vmeintr_establish(sc->sc_nvec, &sc->sc_ih_n, self->dv_xname);
snprintf(sc->sc_intrname_e, sizeof sc->sc_intrname_e,
"%s_err", self->dv_xname);
- evcount_attach(&sc->sc_intrcnt_e, sc->sc_intrname_e,
- (void *)&sc->sc_ih_e.ih_ipl, &evcount_intr);
+ vmeintr_establish(sc->sc_evec, &sc->sc_ih_e, sc->sc_intrname_e);
printf("SCSI ID");
@@ -776,7 +770,6 @@ vs_nintr(void *vsc)
/* Got a valid interrupt on this device */
s = splbio();
- sc->sc_intrcnt_n.ec_count++;
m328_cmd = (void *)crb_read(4, CRB_CTAG);
/*
@@ -821,7 +814,6 @@ vs_eintr(void *vsc)
/* Got a valid interrupt on this device */
s = splbio();
- sc->sc_intrcnt_e.ec_count++;
crsw = vs_read(2, sh_CEVSB + CEVSB_CRSW);
ecode = vs_read(1, sh_CEVSB + CEVSB_ERROR);
diff --git a/sys/arch/mvme88k/dev/vsvar.h b/sys/arch/mvme88k/dev/vsvar.h
index 7c606636f6d..3cac7e42ce9 100644
--- a/sys/arch/mvme88k/dev/vsvar.h
+++ b/sys/arch/mvme88k/dev/vsvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsvar.h,v 1.15 2004/07/20 20:32:02 miod Exp $ */
+/* $OpenBSD: vsvar.h,v 1.16 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -95,8 +95,6 @@ struct vs_softc {
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct intrhand sc_ih_e, sc_ih_n;
- struct evcount sc_intrcnt_e;
- struct evcount sc_intrcnt_n;
char sc_intrname_e[16 + 4];
int sc_ipl;
int sc_evec, sc_nvec;
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index 069cd8f8b96..8551cf47184 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vx.c,v 1.35 2004/07/02 14:00:43 miod Exp $ */
+/* $OpenBSD: vx.c,v 1.36 2004/07/30 19:02:06 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -38,7 +38,6 @@
#include <sys/time.h>
#include <sys/device.h>
#include <sys/syslog.h>
-#include <sys/evcount.h>
#include <machine/autoconf.h>
#include <machine/conf.h>
@@ -66,7 +65,6 @@ struct vx_info {
struct vxsoftc {
struct device sc_dev;
- struct evcount sc_intrcnt;
struct vx_info sc_info[NVXPORTS];
struct vxreg *vx_reg;
vaddr_t board_vaddr;
@@ -227,9 +225,7 @@ vxattach(struct device *parent, struct device *self, void *aux)
sc->sc_ih.ih_wantframe = 0;
sc->sc_ih.ih_ipl = IPL_TTY;
- vmeintr_establish(ca->ca_vec, &sc->sc_ih);
- evcount_attach(&sc->sc_intrcnt, self->dv_xname,
- (void *)&sc->sc_ih.ih_ipl, &evcount_intr);
+ vmeintr_establish(ca->ca_vec, &sc->sc_ih, self->dv_xname);
}
short
@@ -975,8 +971,6 @@ vx_intr(void *arg)
short cmd;
u_char port;
- sc->sc_intrcnt.ec_count++;
-
while (env_isvalid(get_status_head(sc))) {
pktp = get_packet(sc, get_status_head(sc));
valid = env_isvalid(get_status_head(sc));
diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h
index fa413df93ea..f01aa0cdf40 100644
--- a/sys/arch/mvme88k/include/cpu.h
+++ b/sys/arch/mvme88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.28 2004/07/24 15:05:07 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.29 2004/07/30 19:02:08 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -40,17 +40,19 @@
#ifndef _MVME88K_CPU_H_
#define _MVME88K_CPU_H_
+#include <sys/evcount.h>
#include <m88k/cpu.h>
struct intrhand {
+ SLIST_ENTRY(intrhand) ih_link;
int (*ih_fn)(void *);
void *ih_arg;
int ih_ipl;
int ih_wantframe;
- struct intrhand *ih_next;
+ struct evcount ih_count;
};
-int intr_establish(int vec, struct intrhand *);
+int intr_establish(int, struct intrhand *, const char *);
/*
* There are 256 possible vectors on a mvme88k platform (including
@@ -58,6 +60,8 @@ int intr_establish(int vec, struct intrhand *);
* handler for the given vector. vector number is used to index
* into the intr_handlers[] table.
*/
-extern struct intrhand *intr_handlers[256];
+#define NVMEINTR 256
+typedef SLIST_HEAD(, intrhand) intrhand_t;
+extern intrhand_t intr_handlers[NVMEINTR];
#endif
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 46bfb069380..887b7fbcc4f 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.148 2004/07/29 10:17:21 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.149 2004/07/30 19:02:08 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -104,7 +104,7 @@
#include <ddb/db_interface.h>
#endif /* DDB */
-struct intrhand *intr_handlers[256];
+intrhand_t intr_handlers[NVMEINTR];
vaddr_t interrupt_stack[MAX_CPUS];
/* machine dependent function pointers. */
@@ -676,9 +676,10 @@ cpu_startup()
bufinit();
/*
- * zero out intr_handlers
+ * Set up interrupt handlers.
*/
- bzero((void *)intr_handlers, 256 * sizeof(struct intrhand *));
+ for (i = 0; i < NVMEINTR; i++)
+ SLIST_INIT(&intr_handlers[i]);
setupiackvectors();
/*
@@ -1390,32 +1391,33 @@ intr_findvec(int start, int end, int skip)
int vec;
#ifdef DEBUG
- if (start < 0 || end > 255 || start > end)
+ if (start < 0 || end >= NVMEINTR || start > end)
panic("intr_findvec(%d,%d): bad parameters", start, end);
#endif
for (vec = start; vec <= end; vec++) {
if (vec == skip)
continue;
- if (intr_handlers[vec] == NULL)
- return (vec);
+ if (SLIST_EMPTY(&intr_handlers[vec]))
+ return vec;
}
#ifdef DIAGNOSTIC
printf("intr_findvec(%d,%d,%d): no vector available\n",
start, end, skip);
#endif
- return (-1);
+ return -1;
}
/*
* Try to insert ihand in the list of handlers for vector vec.
*/
int
-intr_establish(int vec, struct intrhand *ihand)
+intr_establish(int vec, struct intrhand *ihand, const char *name)
{
struct intrhand *intr;
+ intrhand_t *list;
- if (vec < 0 || vec > 255) {
+ if (vec < 0 || vec >= NVMEINTR) {
#if DIAGNOSTIC
panic("intr_establish: vec (0x%x) not between 0x00 and 0xff",
vec);
@@ -1423,9 +1425,9 @@ intr_establish(int vec, struct intrhand *ihand)
return (EINVAL);
}
- ihand->ih_next = NULL;
-
- if ((intr = intr_handlers[vec]) != NULL) {
+ list = &intr_handlers[vec];
+ if (!SLIST_EMPTY(list)) {
+ intr = SLIST_FIRST(list);
if (intr->ih_ipl != ihand->ih_ipl) {
#if DIAGNOSTIC
panic("intr_establish: there are other handlers with "
@@ -1434,13 +1436,11 @@ intr_establish(int vec, struct intrhand *ihand)
#endif /* DIAGNOSTIC */
return (EINVAL);
}
+ }
- while (intr->ih_next)
- intr = intr->ih_next;
- intr->ih_next = ihand;
- } else
- intr_handlers[vec] = ihand;
-
+ evcount_attach(&ihand->ih_count, name, (void *)&ihand->ih_ipl,
+ &evcount_intr);
+ SLIST_INSERT_HEAD(list, ihand, ih_link);
return (0);
}
@@ -1474,6 +1474,7 @@ m188_ext_int(u_int v, struct trapframe *eframe)
unsigned int cur_mask;
unsigned int level, old_spl;
struct intrhand *intr;
+ intrhand_t *list;
int ret, intbit;
unsigned vec;
@@ -1580,7 +1581,8 @@ m188_ext_int(u_int v, struct trapframe *eframe)
level, intbit, 1 << intbit, IST_STRING);
}
- if ((intr = intr_handlers[vec]) == NULL) {
+ list = &intr_handlers[vec];
+ if (SLIST_EMPTY(list)) {
/* increment intr counter */
intrcnt[M88K_SPUR_IRQ]++;
printf("Spurious interrupt: level = %d vec = 0x%x, "
@@ -1592,14 +1594,15 @@ m188_ext_int(u_int v, struct trapframe *eframe)
* for the given vector, calling each handler in turn,
* till some handler returns a value != 0.
*/
- for (ret = 0; intr; intr = intr->ih_next) {
+ ret = 0;
+ SLIST_FOREACH(intr, list, ih_link) {
if (intr->ih_wantframe != 0)
ret = (*intr->ih_fn)((void *)eframe);
else
ret = (*intr->ih_fn)(intr->ih_arg);
if (ret != 0) {
- /* increment intr counter */
intrcnt[level]++;
+ intr->ih_count.ec_count++;
break;
}
}
@@ -1646,6 +1649,7 @@ m187_ext_int(u_int v, struct trapframe *eframe)
{
int mask, level;
struct intrhand *intr;
+ intrhand_t *list;
int ret;
u_char vec;
@@ -1691,14 +1695,16 @@ m187_ext_int(u_int v, struct trapframe *eframe)
enable_interrupt();
- if ((intr = intr_handlers[vec]) == NULL) {
+ list = &intr_handlers[vec];
+ if (SLIST_EMPTY(list)) {
/* increment intr counter */
intrcnt[M88K_SPUR_IRQ]++;
printf("Spurious interrupt (level %x and vec %x)\n",
level, vec);
} else {
#ifdef DIAGNOSTIC
- if (intr && intr->ih_ipl != level) {
+ intr = SLIST_FIRST(list);
+ if (intr->ih_ipl != level) {
panic("Handler ipl %x not the same as level %x. "
"vec = 0x%x",
intr->ih_ipl, level, vec);
@@ -1711,14 +1717,15 @@ m187_ext_int(u_int v, struct trapframe *eframe)
* returns a value != 0.
*/
- for (ret = 0; intr; intr = intr->ih_next) {
- if (intr->ih_wantframe != 0) {
+ ret = 0;
+ SLIST_FOREACH(intr, list, ih_link) {
+ if (intr->ih_wantframe != 0)
ret = (*intr->ih_fn)((void *)eframe);
- } else
+ else
ret = (*intr->ih_fn)(intr->ih_arg);
if (ret != 0) {
- /* increment intr counter */
intrcnt[level]++;
+ intr->ih_count.ec_count++;
break;
}
}
@@ -1751,6 +1758,7 @@ m197_ext_int(u_int v, struct trapframe *eframe)
{
int mask, level, src;
struct intrhand *intr;
+ intrhand_t *list;
int ret;
u_char vec;
@@ -1798,14 +1806,16 @@ m197_ext_int(u_int v, struct trapframe *eframe)
enable_interrupt();
}
- if ((intr = intr_handlers[vec]) == NULL) {
+ list = &intr_handlers[vec];
+ if (SLIST_EMPTY(list)) {
/* increment intr counter */
intrcnt[M88K_SPUR_IRQ]++;
printf("Spurious interrupt (level %x and vec %x)\n",
level, vec);
} else {
#ifdef DIAGNOSTIC
- if (intr && intr->ih_ipl != level) {
+ intr = SLIST_FIRST(list);
+ if (intr->ih_ipl != level) {
panic("Handler ipl %x not the same as level %x. "
"vec = 0x%x",
intr->ih_ipl, level, vec);
@@ -1818,14 +1828,15 @@ m197_ext_int(u_int v, struct trapframe *eframe)
* returns a value != 0.
*/
- for (ret = 0; intr; intr = intr->ih_next) {
+ ret = 0;
+ SLIST_FOREACH(intr, list, ih_link) {
if (intr->ih_wantframe != 0)
ret = (*intr->ih_fn)((void *)eframe);
else
ret = (*intr->ih_fn)(intr->ih_arg);
if (ret != 0) {
- /* increment intr counter */
intrcnt[level]++;
+ intr->ih_count.ec_count++;
break;
}
}