diff options
author | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2004-08-18 13:29:47 +0000 |
---|---|---|
committer | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2004-08-18 13:29:47 +0000 |
commit | fca33ff8ad9b0806f18ec0ecfd0415aede2532fe (patch) | |
tree | b796049671894b93f10a4506a0c99524a0d2eff7 | |
parent | 7746d52cabfe0f51488db9ef0277c0ed50e6c6d4 (diff) |
Add 'irq6/clock0' to evcount on luna88k.
ok miod@
-rw-r--r-- | sys/arch/luna88k/dev/timekeeper.c | 9 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/clock.c | 31 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/clockvar.h | 5 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/mainbus.c | 4 |
5 files changed, 39 insertions, 24 deletions
diff --git a/sys/arch/luna88k/dev/timekeeper.c b/sys/arch/luna88k/dev/timekeeper.c index 8e49266aabb..da6674ca02c 100644 --- a/sys/arch/luna88k/dev/timekeeper.c +++ b/sys/arch/luna88k/dev/timekeeper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timekeeper.c,v 1.2 2004/05/07 14:11:05 aoyama Exp $ */ +/* $OpenBSD: timekeeper.c,v 1.3 2004/08/18 13:29:46 aoyama Exp $ */ /* $NetBSD: timekeeper.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */ /*- @@ -41,6 +41,7 @@ #include <sys/systm.h> #include <sys/device.h> #include <sys/kernel.h> +#include <sys/evcount.h> #include <machine/autoconf.h> #include <machine/board.h> /* machtype value */ @@ -58,6 +59,7 @@ struct timekeeper_softc { struct device sc_dev; void *sc_clock, *sc_nvram; int sc_nvramsize; + struct evcount sc_count; }; /* @@ -130,7 +132,10 @@ clock_attach(parent, self, aux) printf(": DS1397\n"); break; } - clockattach(&sc->sc_dev, clockwork); + + evcount_attach(&sc->sc_count, self->dv_xname, (void *)&ma->ma_ilvl, &evcount_intr); + + clockattach(&sc->sc_dev, clockwork, &sc->sc_count); } /* diff --git a/sys/arch/luna88k/luna88k/clock.c b/sys/arch/luna88k/luna88k/clock.c index 475d0865b99..4fe62d17ac4 100644 --- a/sys/arch/luna88k/luna88k/clock.c +++ b/sys/arch/luna88k/luna88k/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.1 2004/04/21 15:23:58 aoyama Exp $ */ +/* $OpenBSD: clock.c,v 1.2 2004/08/18 13:29:46 aoyama Exp $ */ /* $NetBSD: clock.c,v 1.2 2000/01/11 10:29:35 nisimura Exp $ */ /* @@ -49,25 +49,24 @@ #include <sys/systm.h> #include <sys/device.h> #include <sys/kernel.h> +#include <sys/evcount.h> #include <machine/cpu.h> +#include <machine/cpu_number.h> #include <dev/clock_subr.h> #include <luna88k/luna88k/clockvar.h> -#if 0 /* aoyama */ -#define CLOCK_LEVEL 5 -#include <luna68k/luna68k/isr.h> -#endif /* aoyama */ - struct device *clockdev; const struct clockfns *clockfns; +struct evcount *clockevc; int clockinitted; void -clockattach(dev, fns) +clockattach(dev, fns, evc) struct device *dev; const struct clockfns *fns; + struct evcount *evc; { /* * Just bookkeeping. @@ -76,6 +75,7 @@ clockattach(dev, fns) panic("clockattach: multiple clocks"); clockdev = dev; clockfns = fns; + clockevc = evc; } /* @@ -216,3 +216,20 @@ resettodr() clock_secs_to_ymdhms(time.tv_sec, &dt); (*clockfns->cf_set)(clockdev, &dt); } + +/* + * Clock interrupt routine + */ +int +clockintr(void *eframe) +{ + extern unsigned int *clock_reg[]; + int cpu = cpu_number(); + + intrcnt[M88K_CLK_IRQ]++; + clockevc->ec_count++; + + *clock_reg[cpu] = 0xffffffff; + hardclock(eframe); + return 1; +} diff --git a/sys/arch/luna88k/luna88k/clockvar.h b/sys/arch/luna88k/luna88k/clockvar.h index 128d809d4af..0e9fa24079e 100644 --- a/sys/arch/luna88k/luna88k/clockvar.h +++ b/sys/arch/luna88k/luna88k/clockvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: clockvar.h,v 1.1 2004/04/21 15:23:58 aoyama Exp $ */ +/* $OpenBSD: clockvar.h,v 1.2 2004/08/18 13:29:46 aoyama Exp $ */ /* $NetBSD: clockvar.h,v 1.1 2000/01/05 08:49:02 nisimura Exp $ */ /*- @@ -51,4 +51,5 @@ struct clockfns { void (*cf_set)(struct device *, struct clock_ymdhms *); }; -void clockattach(struct device *, const struct clockfns *); +void clockattach(struct device *, const struct clockfns *, struct evcount *); +int clockintr(void *); diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index 43e6dbdd6aa..fb77726cc16 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.8 2004/07/28 12:28:48 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.9 2004/08/18 13:29:46 aoyama Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -122,6 +122,7 @@ void get_fuse_rom_data(void); void get_nvram_data(void); char *nvram_by_symbol(char *); void get_autoboot_device(void); /* in disksubr.c */ +int clockintr(void *); /* in clock.c */ /* * *int_mask_reg[CPU] @@ -1284,16 +1285,7 @@ luna88k_ext_int(u_int v, struct trapframe *eframe) switch(cur_int) { case CLOCK_INT_LEVEL: - /* increment intr counter */ - intrcnt[M88K_CLK_IRQ]++; - - *clock_reg[cpu] = 0xFFFFFFFFU; /* reset clock */ - - /* - if (clock_enabled[cpu]) - sys_clock_interrupt(USERMODE(eframe[EF_EPSR])); - */ - hardclock((void *)eframe); + clockintr((void *)eframe); break; case 5: case 4: diff --git a/sys/arch/luna88k/luna88k/mainbus.c b/sys/arch/luna88k/luna88k/mainbus.c index 0b8c0eb8f6d..b22851be363 100644 --- a/sys/arch/luna88k/luna88k/mainbus.c +++ b/sys/arch/luna88k/luna88k/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.3 2004/08/10 17:07:20 aoyama Exp $ */ +/* $OpenBSD: mainbus.c,v 1.4 2004/08/18 13:29:46 aoyama Exp $ */ /* $NetBSD: mainbus.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */ /*- @@ -47,7 +47,7 @@ #include <machine/cpu.h> static const struct mainbus_attach_args devs[] = { - { "clock", 0x45000000, -1, LUNA_88K|LUNA_88K2 }, /* Mostek/Dallas TimeKeeper */ + { "clock", 0x45000000, 6, LUNA_88K|LUNA_88K2 }, /* Mostek/Dallas TimeKeeper */ { "le", 0xf1000000, 4, LUNA_88K|LUNA_88K2 }, /* Am7990 */ { "sio", 0x51000000, 5, LUNA_88K|LUNA_88K2 }, /* uPD7201A */ { "fb", 0xc1100000, -1, LUNA_88K|LUNA_88K2 }, /* BrookTree RAMDAC */ |