diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-30 09:50:19 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-30 09:50:19 +0000 |
commit | 6d24776ed0ad83ce600312ba8e20432f4e1375df (patch) | |
tree | eaa403b9cca910c4c39844924752e280fc2ba4d1 /sys/arch | |
parent | de8cb3b68a25be958f20b7f4f7bde69697567347 (diff) |
Switch mvme68k to evcount interrupt counters.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme68k/dev/cl.c | 35 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_ie.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_le.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_levar.h | 5 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/ssh.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sshdma.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sshvar.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vs.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vsdma.c | 25 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vsvar.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/wl.c | 33 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/zs.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme68k/include/types.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/genassym.cf | 6 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/locore.s | 38 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/machdep.c | 21 |
16 files changed, 136 insertions, 96 deletions
diff --git a/sys/arch/mvme68k/dev/cl.c b/sys/arch/mvme68k/dev/cl.c index 722d365241b..16031058d30 100644 --- a/sys/arch/mvme68k/dev/cl.c +++ b/sys/arch/mvme68k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.36 2004/07/02 18:01:15 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.37 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -35,7 +35,7 @@ #include <sys/time.h> #include <sys/device.h> #include <sys/syslog.h> -/* #include <sys/queue.h> */ +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/conf.h> @@ -115,9 +115,12 @@ char cl_dmabuf [CLCD_PORTS_PER_CHIP * CL_BUFSIZE * 4]; struct clsoftc { struct device sc_dev; - struct evcnt sc_txintrcnt; - struct evcnt sc_rxintrcnt; - struct evcnt sc_mxintrcnt; + 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_rotime; /* time of last ring overrun */ time_t sc_fotime; /* time of last fifo overrun */ u_char *pbase; @@ -375,9 +378,19 @@ clattach(parent, self, aux) break; } - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_txintrcnt); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_rxintrcnt); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_mxintrcnt); + 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"); } @@ -1433,7 +1446,7 @@ cl_mintr(arg) log(LOG_WARNING, "cl_mintr extra intr\n"); return 0; } - sc->sc_mxintrcnt.ev_count++; + sc->sc_mxintrcnt.ec_count++; channel = mir & 0x03; misr = sc->cl_reg->cl_misr; @@ -1495,7 +1508,7 @@ cl_txintr(arg) log(LOG_WARNING, "cl_txintr extra intr\n"); return 0; } - sc->sc_txintrcnt.ev_count++; + sc->sc_txintrcnt.ec_count++; channel = tir & 0x03; cmr = sc->cl_reg->cl_cmr; @@ -1619,7 +1632,7 @@ cl_rxintr(arg) log(LOG_WARNING, "cl_rxintr extra intr\n"); return 0; } - sc->sc_rxintrcnt.ev_count++; + sc->sc_rxintrcnt.ec_count++; channel = rir & 0x3; cmr = sc->cl_reg->cl_cmr; reoir = 0x08; diff --git a/sys/arch/mvme68k/dev/if_ie.c b/sys/arch/mvme68k/dev/if_ie.c index d58984791cf..cd4eb5239fe 100644 --- a/sys/arch/mvme68k/dev/if_ie.c +++ b/sys/arch/mvme68k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.25 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.26 2004/07/30 09:50:15 miod Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. @@ -105,6 +105,7 @@ 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> @@ -169,7 +170,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 evcnt sc_intrcnt; /* # of interrupts, per ie */ + struct evcount sc_intrcnt; /* # of interrupts, per ie */ 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.)*/ @@ -514,7 +515,8 @@ ieattach(parent, self, aux) #endif } - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcount_attach(&sc->sc_intrcnt, self->dv_xname, + (void *)&sc->sc_ih.ih_ipl, &evcount_intr); } /* @@ -627,7 +629,7 @@ loop: if ((status = sc->scb->ie_status) & IE_ST_WHENCE) goto loop; - sc->sc_intrcnt.ev_count++; + sc->sc_intrcnt.ec_count++; return 1; } diff --git a/sys/arch/mvme68k/dev/if_le.c b/sys/arch/mvme68k/dev/if_le.c index e08b1f059a6..0fc0da89488 100644 --- a/sys/arch/mvme68k/dev/if_le.c +++ b/sys/arch/mvme68k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.27 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.28 2004/07/30 09:50:15 miod Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -40,6 +40,7 @@ #include <sys/socket.h> #include <sys/device.h> #include <sys/malloc.h> +#include <sys/evcount.h> #include <net/if.h> @@ -392,13 +393,6 @@ leattach(parent, self, aux) printf(": unknown bus type\n"); return; } - evcnt_attach(&sc->sc_dev, "intr", &lesc->sc_intrcnt); - evcnt_attach(&sc->sc_dev, "errs", &lesc->sc_errcnt); - - /* - if (lebustype == BUS_VMES) - vleinit(sc); - */ am7990_config(sc); @@ -420,4 +414,7 @@ leattach(parent, self, aux) break; #endif } + + evcount_attach(&lesc->sc_intrcnt, self->dv_xname, + (void *)&lesc->sc_ih.ih_ipl, &evcount_intr); } diff --git a/sys/arch/mvme68k/dev/if_levar.h b/sys/arch/mvme68k/dev/if_levar.h index c293507713c..465e840b0b8 100644 --- a/sys/arch/mvme68k/dev/if_levar.h +++ b/sys/arch/mvme68k/dev/if_levar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_levar.h,v 1.5 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: if_levar.h,v 1.6 2004/07/30 09:50:15 miod Exp $ */ /* $NetBSD: if_levar.h,v 1.5 1996/05/07 01:27:32 thorpej Exp $ */ /*- @@ -48,8 +48,7 @@ struct le_softc { struct intrhand sc_ih; /* interrupt vectoring */ void *sc_r1; /* LANCE registers */ u_short csr; /* Control/Status reg image */ - struct evcnt sc_intrcnt; - struct evcnt sc_errcnt; + struct evcount sc_intrcnt; u_char sc_ipl; u_char sc_vec; }; diff --git a/sys/arch/mvme68k/dev/ssh.c b/sys/arch/mvme68k/dev/ssh.c index 87e09680194..8e37c655a9a 100644 --- a/sys/arch/mvme68k/dev/ssh.c +++ b/sys/arch/mvme68k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.9 2004/03/26 00:04:49 miod Exp $ */ +/* $OpenBSD: ssh.c,v 1.10 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -46,6 +46,7 @@ #include <sys/dkstat.h> #include <sys/buf.h> #include <sys/malloc.h> +#include <sys/evcount.h> #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> diff --git a/sys/arch/mvme68k/dev/sshdma.c b/sys/arch/mvme68k/dev/sshdma.c index 5658f87b702..1279a3040fe 100644 --- a/sys/arch/mvme68k/dev/sshdma.c +++ b/sys/arch/mvme68k/dev/sshdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshdma.c,v 1.9 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: sshdma.c,v 1.10 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -37,8 +37,11 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/evcount.h> + #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> + #include <machine/autoconf.h> #include <mvme68k/dev/sshreg.h> #include <mvme68k/dev/sshvar.h> @@ -167,7 +170,8 @@ void *auxp; #endif } - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcount_attach(&sc->sc_intrcnt, self->dv_xname, + (void *)&sc->sc_ih.ih_ipl, &evcount_intr); /* * attach all scsi units on us, watching for boot device @@ -204,7 +208,7 @@ afsc_dmaintr(arg) sc->sc_dstat = rp->ssh_dstat; sc->sc_sstat0 = rp->ssh_sstat0; sshintr(sc); - sc->sc_intrcnt.ev_count++; + sc->sc_intrcnt.ec_count++; return (1); } diff --git a/sys/arch/mvme68k/dev/sshvar.h b/sys/arch/mvme68k/dev/sshvar.h index 75939720a90..87cff1a2c1b 100644 --- a/sys/arch/mvme68k/dev/sshvar.h +++ b/sys/arch/mvme68k/dev/sshvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sshvar.h,v 1.3 2003/06/02 23:27:50 millert Exp $ */ +/* $OpenBSD: sshvar.h,v 1.4 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -121,7 +121,7 @@ struct ssh_tinfo { struct ssh_softc { struct device sc_dev; struct intrhand sc_ih; - struct evcnt sc_intrcnt; + struct evcount sc_intrcnt; u_char sc_istat; u_char sc_dstat; diff --git a/sys/arch/mvme68k/dev/vs.c b/sys/arch/mvme68k/dev/vs.c index b4aeabfb565..64ddb0b89ce 100644 --- a/sys/arch/mvme68k/dev/vs.c +++ b/sys/arch/mvme68k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.16 2004/05/20 16:43:51 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.17 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -44,6 +44,7 @@ #include <sys/dkstat.h> #include <sys/buf.h> #include <sys/malloc.h> +#include <sys/evcount.h> #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> diff --git a/sys/arch/mvme68k/dev/vsdma.c b/sys/arch/mvme68k/dev/vsdma.c index ee4767ffc95..8c7586584e4 100644 --- a/sys/arch/mvme68k/dev/vsdma.c +++ b/sys/arch/mvme68k/dev/vsdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsdma.c,v 1.7 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: vsdma.c,v 1.8 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -42,20 +42,16 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/evcount.h> + #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> + #include <machine/autoconf.h> -#ifdef mvme88k -#include <mvme88k/dev/vsreg.h> -#include <mvme88k/dev/vsvar.h> -#include <mvme88k/dev/vme.h> -#include <machine/mmu.h> -#else #include <mvme68k/dev/vsreg.h> #include <mvme68k/dev/vsvar.h> #include <mvme68k/dev/vme.h> -#endif int vsmatch(struct device *, void *, void *); void vsattach(struct device *, struct device *, void *); @@ -130,8 +126,13 @@ vsattach(parent, self, auxp) vmeintr_establish(sc->sc_nvec, &sc->sc_ih_n); vmeintr_establish(sc->sc_evec, &sc->sc_ih_e); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt_n); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt_e); + + evcount_attach(&sc->sc_intrcnt_n, self->dv_xname, + (void *)&sc->sc_ih_n.ih_ipl, &evcount_intr); + snprintf(sc->sc_intrname_e, sizeof sc->sc_intrname_e, + "%s_err", self->dv_xname); + evcount_attach(&sc->sc_intrcnt_e, self->dv_xname, + (void *)&sc->sc_ih_e.ih_ipl, &evcount_intr); /* * attach all scsi units on us, watching for boot device @@ -168,7 +169,7 @@ vs_nintr(arg) printf("Normal Interrupt!!!\n"); #endif vs_intr(sc); - sc->sc_intrcnt_n.ev_count++; + sc->sc_intrcnt_n.ec_count++; return (1); } @@ -183,7 +184,7 @@ vs_eintr(arg) printf("Error Interrupt!!!\n"); #endif vs_intr(sc); - sc->sc_intrcnt_e.ev_count++; + sc->sc_intrcnt_e.ec_count++; return (1); } diff --git a/sys/arch/mvme68k/dev/vsvar.h b/sys/arch/mvme68k/dev/vsvar.h index a4c4fb44fb6..719b7664d2c 100644 --- a/sys/arch/mvme68k/dev/vsvar.h +++ b/sys/arch/mvme68k/dev/vsvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vsvar.h,v 1.4 2003/06/02 23:27:50 millert Exp $ */ +/* $OpenBSD: vsvar.h,v 1.5 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1990 The Regents of the University of California. @@ -60,10 +60,9 @@ struct vs_tinfo { struct vs_softc { struct device sc_dev; - struct intrhand sc_ih_e; - struct intrhand sc_ih_n; - struct evcnt sc_intrcnt_e; - struct evcnt sc_intrcnt_n; + struct intrhand sc_ih_e, sc_ih_n; + struct evcount sc_intrcnt_e, sc_intrcnt_n; + char sc_intrname_e[16 + 4]; u_short sc_ipl; u_short sc_evec; u_short sc_nvec; diff --git a/sys/arch/mvme68k/dev/wl.c b/sys/arch/mvme68k/dev/wl.c index ce4b62b0f3e..a4026a66b04 100644 --- a/sys/arch/mvme68k/dev/wl.c +++ b/sys/arch/mvme68k/dev/wl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wl.c,v 1.15 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: wl.c,v 1.16 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -33,6 +33,7 @@ #include <sys/time.h> #include <sys/device.h> #include <sys/syslog.h> +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/conf.h> @@ -113,9 +114,12 @@ struct cl_info { struct wlsoftc { struct device sc_dev; - struct evcnt sc_txintrcnt; - struct evcnt sc_rxintrcnt; - struct evcnt sc_mxintrcnt; + 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_rotime; /* time of last ring overrun */ time_t sc_fotime; /* time of last fifo overrun */ @@ -331,9 +335,18 @@ wlattach(parent, self, aux) vmeintr_establish(ca->ca_vec + 2, &sc->sc_ih_t); vmeintr_establish(ca->ca_vec + 3, &sc->sc_ih_r); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_txintrcnt); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_rxintrcnt); - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_mxintrcnt); + 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); p = sc->sc_memkv; s = splhigh(); @@ -1123,7 +1136,7 @@ cl_mintr(sc) printf("stk 0x%x mir 0x%x chan 0x%x\n", sc->cl_reg->cl_stk, mir, channel); - sc->sc_mxintrcnt.ev_count++; + sc->sc_mxintrcnt.ec_count++; if (misr & MISR_TIMER1) { /* timers are not currently used?? */ @@ -1181,7 +1194,7 @@ cl_txintr(sc) printf("stk 0x%x tir 0x%x chan 0x%x cmr 0x%x tisr 0x%x tftc 0x%x\n", sc->cl_reg->cl_stk, tir, chan, cmr, tisr, tftc); - sc->sc_txintrcnt.ev_count++; + sc->sc_txintrcnt.ec_count++; sc->sc_cl[chan].txcnt++; tp = sc->sc_cl[chan].tty; @@ -1256,7 +1269,7 @@ cl_rxintr(sc) /*printf("stk 0x%x rir 0x%x chan 0x%x cmr 0x%x risrl 0x%x\n", sc->cl_reg->cl_stk, rir, chan, cmr, risrl);*/ - sc->sc_rxintrcnt.ev_count++; + sc->sc_rxintrcnt.ec_count++; sc->sc_cl[chan].rxcnt++; if (risrl & RISRL_TIMEOUT) { diff --git a/sys/arch/mvme68k/dev/zs.c b/sys/arch/mvme68k/dev/zs.c index 307feccb7a1..e9ee1e689b7 100644 --- a/sys/arch/mvme68k/dev/zs.c +++ b/sys/arch/mvme68k/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.16 2004/07/02 17:57:29 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.17 2004/07/30 09:50:15 miod Exp $ */ /* * Copyright (c) 2000 Steve Murphree, Jr. @@ -40,12 +40,14 @@ #include <sys/syslog.h> #include <sys/fcntl.h> #include <sys/device.h> +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/conf.h> #include <machine/cpu.h> #include <dev/cons.h> + #include <mvme68k/dev/scc.h> #include "pcc.h" @@ -107,7 +109,7 @@ struct zs { struct zssoftc { struct device sc_dev; struct zs sc_zs[2]; - struct evcnt sc_intrcnt; + struct evcount sc_intrcnt; struct intrhand sc_ih; int sc_flags; }; @@ -209,6 +211,8 @@ zsattach(parent, self, args) sc->sc_ih.ih_fn = zsirq; sc->sc_ih.ih_arg = (void *)self->dv_unit; sc->sc_ih.ih_ipl = zs_level; + sc->sc_ih.ih_wantframe = 0; + switch (ca->ca_bustype) { #if NPCC > 0 case BUS_PCC: @@ -300,7 +304,8 @@ zsattach(parent, self, args) } initirq = 1; - evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt); + evcount_attach(&sc->sc_intrcnt, self->dv_xname, + (void *)&sc->sc_ih.ih_ipl, &evcount_intr); } void @@ -775,7 +780,7 @@ zsirq(arg) zs_extint(zp); ZWRITE0(&zp->scc, 0x38); /* reset highest IUS */ - sc->sc_intrcnt.ev_count++; + sc->sc_intrcnt.ec_count++; return (1); } diff --git a/sys/arch/mvme68k/include/types.h b/sys/arch/mvme68k/include/types.h index 7d2317f5aac..be742115858 100644 --- a/sys/arch/mvme68k/include/types.h +++ b/sys/arch/mvme68k/include/types.h @@ -1,3 +1,5 @@ -/* $OpenBSD: types.h,v 1.5 2001/08/06 20:47:03 miod Exp $ */ +/* $OpenBSD: types.h,v 1.6 2004/07/30 09:50:17 miod Exp $ */ #include <m68k/types.h> + +#define __HAVE_EVCOUNT diff --git a/sys/arch/mvme68k/mvme68k/genassym.cf b/sys/arch/mvme68k/mvme68k/genassym.cf index 800b28ef486..d347edcf688 100644 --- a/sys/arch/mvme68k/mvme68k/genassym.cf +++ b/sys/arch/mvme68k/mvme68k/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.18 2003/06/02 23:27:51 millert Exp $ +# $OpenBSD: genassym.cf,v 1.19 2004/07/30 09:50:17 miod Exp $ # # Copyright (c) 1995 Theo de Raadt @@ -62,6 +62,7 @@ include <sys/msgbuf.h> include <sys/syscall.h> include <sys/types.h> include <sys/user.h> +include <sys/evcount.h> include <uvm/uvm_extern.h> @@ -129,3 +130,6 @@ member ctrl member cmd member addr member len + +struct evcount +member ec_count32 diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s index bdead900dce..f08a90184e6 100644 --- a/sys/arch/mvme68k/mvme68k/locore.s +++ b/sys/arch/mvme68k/mvme68k/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.42 2004/07/02 17:33:43 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.43 2004/07/30 09:50:17 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -69,7 +69,7 @@ #include <machine/trap.h> /* - * Macro to relocate a symbol, used before MMU is enabled. + * Relocate a symbol, used before MMU is enabled. */ #define _RELOC(var, ar) \ lea var,ar @@ -78,7 +78,7 @@ #define ASRELOC(var, ar) _RELOC(_ASM_LABEL(var), ar) /* - * Macro to invoke a BUG routine. + * Invoke a BUG routine. */ #define BUGCALL(id) \ trap #15; \ @@ -675,7 +675,7 @@ ENTRY_NOPROFILE(buserr60) orl #IC60_CABC,d2 | clear all branch cache entries movc d2,cacr movl d0,d1 - addql #1,L60bpe + addql #1, _C_LABEL(ec_60bpe) + EC_COUNT32 andl #0x7ffd,d1 jeq _ASM_LABEL(faultstkadjnotrap2) Lnobpe: @@ -1889,18 +1889,18 @@ not147: 3: BUGCALL(MVMEPROM_EXIT) | return to m68kbug /*NOTREACHED*/ -#ifdef M68060 +#if defined(M68060) && defined(M060SP) GLOBAL(intemu60) - addql #1,L60iem + addql #1, _C_LABEL(ec_60iem) + EC_COUNT32 jra _I_CALL_TOP+128+0x00 GLOBAL(fpiemu60) - addql #1,L60fpiem + addql #1, _C_LABEL(ec_60fpiem) + EC_COUNT32 jra _FP_CALL_TOP+128+0x30 GLOBAL(fpdemu60) - addql #1,L60fpdem + addql #1, _C_LABEL(ec_60fpdem) + EC_COUNT32 jra _FP_CALL_TOP+128+0x38 GLOBAL(fpeaemu60) - addql #1,L60fpeaem + addql #1, _C_LABEL(ec_60fpeaem) + EC_COUNT32 jra _FP_CALL_TOP+128+0x40 #endif @@ -1944,31 +1944,11 @@ GLOBAL(intrnames) .asciz "lev6" .asciz "nmi" .asciz "statclock" -#ifdef M68060 - .asciz "60intemu" - .asciz "60fpiemu" - .asciz "60fpdemu" - .asciz "60fpeaemu" - .asciz "60bpe" -#endif -#ifdef FPU_EMULATE - .asciz "fpe" -#endif GLOBAL(eintrnames) .even GLOBAL(intrcnt) .long 0,0,0,0,0,0,0,0,0,0 -#ifdef M68060 -L60iem: .long 0 -L60fpiem: .long 0 -L60fpdem: .long 0 -L60fpeaem: .long 0 -L60bpe: .long 0 -#endif -#ifdef FPU_EMULATE -Lfpecnt: .long 0 -#endif GLOBAL(eintrcnt) #include <mvme68k/mvme68k/vectors.s> diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 890ca2346e4..921a2b8579b 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.84 2004/04/18 17:34:17 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.85 2004/07/30 09:50:18 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -88,6 +88,7 @@ #ifdef SYSVMSG #include <sys/msg.h> #endif +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/bugio.h> @@ -158,6 +159,13 @@ extern struct emul emul_hpux; extern struct emul emul_sunos; #endif +/* 68060-specific event counters */ +#if defined(M68060) +struct evcount ec_60bpe; +#if defined(M060SP) +struct evcount ec_60iem, ec_60fpiem, ec_60fpdem, ec_60fpeaem; +#endif +#endif /* * XXX this is to fake out the console routines, while * booting. New and improved! :-) smurph @@ -601,6 +609,17 @@ identifycpu() #endif } printf("%s\n", cpu_model); + + /* No better place to put these... */ +#if defined(M68060) + evcount_attach(&ec_60bpe, "68060bpe", NULL, &evcount_intr); +#if defined(M060SP) + evcount_attach(&ec_60iem, "68060iem", NULL, &evcount_intr); + evcount_attach(&ec_60fpiem, "68060fpiem", NULL, &evcount_intr); + evcount_attach(&ec_60fpdem, "68060fpdem", NULL, &evcount_intr); + evcount_attach(&ec_60fpeaem, "68060fpeaem", NULL, &evcount_intr); +#endif +#endif } /* |