diff options
Diffstat (limited to 'sys/arch/mvme88k/dev/clock.c')
-rw-r--r-- | sys/arch/mvme88k/dev/clock.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c index 0cb3f3fdf07..0cf6d10a38c 100644 --- a/sys/arch/mvme88k/dev/clock.c +++ b/sys/arch/mvme88k/dev/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.30 2004/04/24 19:51:47 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.31 2004/07/02 14:00:42 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -75,6 +75,7 @@ #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 */ @@ -117,7 +118,9 @@ 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 = { @@ -219,6 +222,11 @@ clockattach(struct device *parent, struct device *self, void *args) 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"); } @@ -254,10 +262,14 @@ 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 bugtty_chkinput(); @@ -303,13 +315,14 @@ 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; - /* increment intr counter */ intrcnt[M88K_SCLK_IRQ]++; + sc->sc_statcnt.ec_count++; statclock((struct clockframe *)eframe); @@ -341,6 +354,7 @@ sbc_statintr(void *eframe) int m188_clockintr(void *eframe) { + struct clocksoftc *sc = clock_cd.cd_devs[0]; volatile int tmp; /* acknowledge the timer interrupt */ @@ -350,6 +364,8 @@ m188_clockintr(void *eframe) tmp = *(int *volatile)DART_STOPC; intrcnt[M88K_CLK_IRQ]++; + sc->sc_profcnt.ec_count++; + hardclock(eframe); #if NBUGTTY > 0 bugtty_chkinput(); @@ -422,12 +438,13 @@ 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; - /* increment intr counter */ intrcnt[M88K_SCLK_IRQ]++; + sc->sc_statcnt.ec_count++; statclock((struct clockframe *)eframe); write_cio(CIO_CSR1, CIO_GCB | CIO_CIP); /* Ack the interrupt */ |