Deleted Added
full compact
clock.c (61126) clock.c (61994)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz and Don Ahn.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz and Don Ahn.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
37 * $FreeBSD: head/sys/i386/isa/clock.c 61126 2000-05-31 13:32:28Z bde $
37 * $FreeBSD: head/sys/i386/isa/clock.c 61994 2000-06-23 07:44:33Z msmith $
38 */
39
40/*
41 * Routines to handle clock hardware.
42 */
43
44/*
45 * inittodr, settodr and support routines written
46 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at>
47 *
48 * reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94
49 */
50
51#include "opt_clock.h"
52#include "apm.h"
53
54#include <sys/param.h>
55#include <sys/systm.h>
38 */
39
40/*
41 * Routines to handle clock hardware.
42 */
43
44/*
45 * inittodr, settodr and support routines written
46 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at>
47 *
48 * reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94
49 */
50
51#include "opt_clock.h"
52#include "apm.h"
53
54#include <sys/param.h>
55#include <sys/systm.h>
56#include <sys/bus.h>
56#include <sys/time.h>
57#include <sys/timetc.h>
58#include <sys/kernel.h>
59#ifndef SMP
60#include <sys/lock.h>
61#endif
62#include <sys/sysctl.h>
63#include <sys/cons.h>

--- 13 unchanged lines hidden (view full) ---

77#if defined(SMP) || defined(APIC_IO)
78#include <machine/smp.h>
79#endif /* SMP || APIC_IO */
80#include <machine/specialreg.h>
81
82#include <i386/isa/icu.h>
83#include <i386/isa/isa.h>
84#include <isa/rtc.h>
57#include <sys/time.h>
58#include <sys/timetc.h>
59#include <sys/kernel.h>
60#ifndef SMP
61#include <sys/lock.h>
62#endif
63#include <sys/sysctl.h>
64#include <sys/cons.h>

--- 13 unchanged lines hidden (view full) ---

78#if defined(SMP) || defined(APIC_IO)
79#include <machine/smp.h>
80#endif /* SMP || APIC_IO */
81#include <machine/specialreg.h>
82
83#include <i386/isa/icu.h>
84#include <i386/isa/isa.h>
85#include <isa/rtc.h>
86#include <isa/isavar.h>
85#include <i386/isa/timerreg.h>
86
87#include <i386/isa/intr_machdep.h>
88
89#include "mca.h"
90#if NMCA > 0
91#include <i386/isa/mca_machdep.h>
92#endif

--- 1131 unchanged lines hidden (view full) ---

1224 return (count);
1225}
1226
1227static unsigned
1228tsc_get_timecount(struct timecounter *tc)
1229{
1230 return (rdtsc());
1231}
87#include <i386/isa/timerreg.h>
88
89#include <i386/isa/intr_machdep.h>
90
91#include "mca.h"
92#if NMCA > 0
93#include <i386/isa/mca_machdep.h>
94#endif

--- 1131 unchanged lines hidden (view full) ---

1226 return (count);
1227}
1228
1229static unsigned
1230tsc_get_timecount(struct timecounter *tc)
1231{
1232 return (rdtsc());
1233}
1234
1235/*
1236 * Attach to the ISA PnP descriptors for the timer and realtime clock.
1237 */
1238static struct isa_pnp_id attimer_ids[] = {
1239 { 0x0001d041 /* PNP0100 */, "AT timer" },
1240 { 0x000bd041 /* PNP0B00 */, "AT realtime clock" },
1241 { 0 }
1242};
1243
1244static int
1245attimer_probe(device_t dev)
1246{
1247 int result;
1248
1249 if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, attimer_ids)) <= 0)
1250 device_quiet(dev);
1251 return(result);
1252}
1253
1254static int
1255attimer_attach(device_t dev)
1256{
1257 return(0);
1258}
1259
1260static device_method_t attimer_methods[] = {
1261 /* Device interface */
1262 DEVMETHOD(device_probe, attimer_probe),
1263 DEVMETHOD(device_attach, attimer_attach),
1264 DEVMETHOD(device_detach, bus_generic_detach),
1265 DEVMETHOD(device_shutdown, bus_generic_shutdown),
1266 DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX stop statclock? */
1267 DEVMETHOD(device_resume, bus_generic_resume), /* XXX restart statclock? */
1268 { 0, 0 }
1269};
1270
1271static driver_t attimer_driver = {
1272 "attimer",
1273 attimer_methods,
1274 1, /* no softc */
1275};
1276
1277static devclass_t attimer_devclass;
1278
1279DRIVER_MODULE(attimer, isa, attimer_driver, attimer_devclass, 0, 0);