From f37ddce7e821f1910bb29ded4bba337825045264 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Mon, 24 Nov 2003 06:24:27 +0000 Subject: [PATCH] Remove obsolete MD mcclock files. --- sys/arch/prep/prep/mcclock.c | 144 -------------------------------- sys/arch/prep/prep/mcclockvar.h | 41 --------- 2 files changed, 185 deletions(-) delete mode 100644 sys/arch/prep/prep/mcclock.c delete mode 100644 sys/arch/prep/prep/mcclockvar.h diff --git a/sys/arch/prep/prep/mcclock.c b/sys/arch/prep/prep/mcclock.c deleted file mode 100644 index 0be4fc7b144a..000000000000 --- a/sys/arch/prep/prep/mcclock.c +++ /dev/null @@ -1,144 +0,0 @@ -/* $NetBSD: mcclock.c,v 1.2 2003/07/15 02:54:52 lukem Exp $ */ - -/* - * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.2 2003/07/15 02:54:52 lukem Exp $"); - -#include /* RCS ID & Copyright macro defns */ - -#include -#include -#include -#include - -#include - -#include - -#include -#include - -/* - * XXX rate is machine-dependent. - */ -#define MC_DFEAULTRATE MC_RATE_1024_Hz - -void mcclock_init __P((struct device *)); -void mcclock_get __P((struct device *, time_t, struct clocktime *)); -void mcclock_set __P((struct device *, struct clocktime *)); - -const struct clockfns mcclock_clockfns = { - mcclock_init, mcclock_get, mcclock_set, -}; - -#define mc146818_write(dev, reg, datum) \ - (*(dev)->sc_busfns->mc_bf_write)(dev, reg, datum) -#define mc146818_read(dev, reg) \ - (*(dev)->sc_busfns->mc_bf_read)(dev, reg) - -void -mcclock_attach(sc, busfns) - struct mcclock_softc *sc; - const struct mcclock_busfns *busfns; -{ - - printf(": mc146818 or compatible"); - - sc->sc_busfns = busfns; - - /* Turn interrupts off, just in case. */ - mc146818_write(sc, MC_REGB, MC_REGB_24HR); - - clockattach(&sc->sc_dev, &mcclock_clockfns); -} - -void -mcclock_init(dev) - struct device *dev; -{ - struct mcclock_softc *sc = (struct mcclock_softc *)dev; - - mc146818_write(sc, MC_REGA, MC_BASE_32_KHz | MC_DFEAULTRATE); - mc146818_write(sc, MC_REGB, MC_REGB_24HR); -} - -/* - * Get the time of day, based on the clock's value and/or the base value. - */ -void -mcclock_get(dev, base, ct) - struct device *dev; - time_t base; - struct clocktime *ct; -{ - struct mcclock_softc *sc = (struct mcclock_softc *)dev; - mc_todregs regs; - int s; - - s = splclock(); - MC146818_GETTOD(sc, ®s) - splx(s); - - ct->sec = FROMBCD(regs[MC_SEC]); - ct->min = FROMBCD(regs[MC_MIN]); - ct->hour = FROMBCD(regs[MC_HOUR]); - ct->dow = FROMBCD(regs[MC_DOW]); - ct->day = FROMBCD(regs[MC_DOM]); - ct->mon = FROMBCD(regs[MC_MONTH]); - ct->year = FROMBCD(regs[MC_YEAR]); -} - -/* - * Reset the TODR based on the time value. - */ -void -mcclock_set(dev, ct) - struct device *dev; - struct clocktime *ct; -{ - struct mcclock_softc *sc = (struct mcclock_softc *)dev; - mc_todregs regs; - int s; - - s = splclock(); - MC146818_GETTOD(sc, ®s); - splx(s); - - regs[MC_SEC] = TOBCD(ct->sec); - regs[MC_MIN] = TOBCD(ct->min); - regs[MC_HOUR] = TOBCD(ct->hour); - regs[MC_DOW] = TOBCD(ct->dow); - regs[MC_DOM] = TOBCD(ct->day); - regs[MC_MONTH] = TOBCD(ct->mon); - regs[MC_YEAR] = TOBCD(ct->year); - - s = splclock(); - MC146818_PUTTOD(sc, ®s); - splx(s); -} diff --git a/sys/arch/prep/prep/mcclockvar.h b/sys/arch/prep/prep/mcclockvar.h deleted file mode 100644 index 5b02d998b03a..000000000000 --- a/sys/arch/prep/prep/mcclockvar.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $NetBSD: mcclockvar.h,v 1.1 2000/02/29 15:21:47 nonaka Exp $ */ - -/* - * Copyright (c) 1996 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -struct mcclock_softc { - struct device sc_dev; - const struct mcclock_busfns *sc_busfns; -}; - -struct mcclock_busfns { - void (*mc_bf_write) __P((struct mcclock_softc *, u_int, u_int)); - u_int (*mc_bf_read) __P((struct mcclock_softc *, u_int)); -}; - -void mcclock_attach __P((struct mcclock_softc *, - const struct mcclock_busfns *));