diff options
-rw-r--r-- | sys/amd64/amd64/machdep.c | 1 | ||||
-rw-r--r-- | sys/amd64/include/clock.h | 1 | ||||
-rw-r--r-- | sys/amd64/isa/clock.c | 1 | ||||
-rw-r--r-- | sys/arm/sa11x0/sa11x0_ost.c | 1 | ||||
-rw-r--r-- | sys/i386/bios/apm.c | 1 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 1 | ||||
-rw-r--r-- | sys/i386/include/clock.h | 1 | ||||
-rw-r--r-- | sys/i386/isa/clock.c | 1 | ||||
-rw-r--r-- | sys/i386/isa/pmtimer.c | 1 | ||||
-rw-r--r-- | sys/ia64/ia64/clock.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/machdep.c | 1 | ||||
-rw-r--r-- | sys/kern/subr_clock.c | 9 | ||||
-rw-r--r-- | sys/kern/subr_rtc.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 1 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 1 | ||||
-rw-r--r-- | sys/pc98/cbus/clock.c | 1 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 1 | ||||
-rw-r--r-- | sys/powerpc/aim/clock.c | 1 | ||||
-rw-r--r-- | sys/powerpc/aim/machdep.c | 1 | ||||
-rw-r--r-- | sys/powerpc/booke/clock.c | 1 | ||||
-rw-r--r-- | sys/sys/clock.h | 22 | ||||
-rw-r--r-- | sys/sys/time.h | 7 |
22 files changed, 31 insertions, 33 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 9d26e53..43fbfc3 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include <sys/buf.h> #include <sys/bus.h> #include <sys/callout.h> -#include <sys/clock.h> #include <sys/cons.h> #include <sys/cpu.h> #include <sys/eventhandler.h> diff --git a/sys/amd64/include/clock.h b/sys/amd64/include/clock.h index b7fafcf..de09de3 100644 --- a/sys/amd64/include/clock.h +++ b/sys/amd64/include/clock.h @@ -27,6 +27,7 @@ void i8254_init(void); * Driver to clock driver interface. */ +void startrtclock(void); void init_TSC(void); void init_TSC_tc(void); diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index d665059..91598d5 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/lock.h> #include <sys/kdb.h> #include <sys/mutex.h> diff --git a/sys/arm/sa11x0/sa11x0_ost.c b/sys/arm/sa11x0/sa11x0_ost.c index 6dd4cf3..1ffb26c 100644 --- a/sys/arm/sa11x0/sa11x0_ost.c +++ b/sys/arm/sa11x0/sa11x0_ost.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/time.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/module.h> #include <machine/bus.h> diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index a844728..6120723 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -22,7 +22,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/conf.h> #include <sys/condvar.h> #include <sys/eventhandler.h> diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 54b5e9d..b1a0d74 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include <sys/buf.h> #include <sys/bus.h> #include <sys/callout.h> -#include <sys/clock.h> #include <sys/cons.h> #include <sys/cpu.h> #include <sys/eventhandler.h> diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h index 3817e32..5a72416 100644 --- a/sys/i386/include/clock.h +++ b/sys/i386/include/clock.h @@ -27,6 +27,7 @@ void i8254_init(void); * Driver to clock driver interface. */ +void startrtclock(void); void timer_restore(void); void init_TSC(void); void init_TSC_tc(void); diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 3c44baf..93a06a3 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/lock.h> #include <sys/kdb.h> #include <sys/mutex.h> diff --git a/sys/i386/isa/pmtimer.c b/sys/i386/isa/pmtimer.c index 87eda2d..1eeac6d 100644 --- a/sys/i386/isa/pmtimer.c +++ b/sys/i386/isa/pmtimer.c @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/syslog.h> diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index c774dad..22fcf9b 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -29,12 +29,10 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/kernel.h> -#include <sys/clock.h> #include <sys/queue.h> #include <sys/sysctl.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/timetc.h> #include <sys/pcpu.h> diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 7ce78b8..45e57de 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -261,7 +261,6 @@ cpu_startup(dummy) */ identifycpu(); - /* startrtclock(); */ #ifdef PERFMON perfmon_init(); #endif diff --git a/sys/kern/subr_clock.c b/sys/kern/subr_clock.c index e8a847e..ffc70af 100644 --- a/sys/kern/subr_clock.c +++ b/sys/kern/subr_clock.c @@ -52,18 +52,14 @@ __FBSDID("$FreeBSD$"); #define ct_debug bootverbose static int adjkerntz; /* local offset from GMT in seconds */ static int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */ -int disable_rtc_set; /* disable resettodr() if != 0 */ int tz_minuteswest; int tz_dsttime; /* - * These have traditionally been in machdep, but should probably be moved to + * This have traditionally been in machdep, but should probably be moved to * kern. */ -SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, - CTLFLAG_RW, &disable_rtc_set, 0, ""); - SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock, CTLFLAG_RW, &wall_cmos_clock, 0, ""); @@ -71,8 +67,7 @@ static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS) { int error; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, - req); + error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); if (!error && req->newptr) resettodr(); return (error); diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c index df0df32..1ec10fa 100644 --- a/sys/kern/subr_rtc.c +++ b/sys/kern/subr_rtc.c @@ -63,6 +63,11 @@ __FBSDID("$FreeBSD$"); static device_t clock_dev = NULL; static long clock_res; +/* XXX: should be kern. now, it's no longer machdep. */ +static int disable_rtc_set; +SYSCTL_INT(_machdep, OID_AUTO, disable_rtc_set, + CTLFLAG_RW, &disable_rtc_set, 0, ""); + void clock_register(device_t dev, long res) /* res has units of microseconds */ { @@ -118,6 +123,7 @@ inittodr(time_t base) "will not be set accurately\n"); return; } + /* XXX: We should poll all registered RTCs in case of failure */ error = CLOCK_GETTIME(clock_dev, &ts); if (error != 0 && error != EINVAL) { printf("warning: clock_gettime failed (%d), the system time " @@ -158,6 +164,7 @@ resettodr() getnanotime(&ts); ts.tv_sec -= utc_offset(); + /* XXX: We should really set all registered RTCs */ if ((error = CLOCK_SETTIME(clock_dev, &ts)) != 0) { printf("warning: clock_settime failed (%d), time-of-day clock " "not adjusted to system time\n", error); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index cfaec35..34166e7 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/conf.h> -#include <sys/clock.h> #include <sys/fcntl.h> #include <sys/jail.h> #include <sys/kernel.h> diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 7185bb5..aac2e00 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/bio.h> #include <sys/buf.h> -#include <sys/clock.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mbuf.h> diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index ff4bd8f..86dc687 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/lock.h> #include <sys/kdb.h> #include <sys/mutex.h> diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index dd524c9..942b804 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include <sys/buf.h> #include <sys/bus.h> #include <sys/callout.h> -#include <sys/clock.h> #include <sys/cons.h> #include <sys/cpu.h> #include <sys/eventhandler.h> diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c index 0116475..1911220 100644 --- a/sys/powerpc/aim/clock.c +++ b/sys/powerpc/aim/clock.c @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/sysctl.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/timetc.h> #include <sys/interrupt.h> diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index f28d5c2..d407314 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -196,7 +196,6 @@ cpu_startup(void *dummy) */ cpu_setup(PCPU_GET(cpuid)); - /* startrtclock(); */ #ifdef PERFMON perfmon_init(); #endif diff --git a/sys/powerpc/booke/clock.c b/sys/powerpc/booke/clock.c index 3ba58c0..7070161 100644 --- a/sys/powerpc/booke/clock.c +++ b/sys/powerpc/booke/clock.c @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/sysctl.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/timetc.h> #include <sys/interrupt.h> diff --git a/sys/sys/clock.h b/sys/sys/clock.h index 00f6821..c08683e 100644 --- a/sys/sys/clock.h +++ b/sys/sys/clock.h @@ -35,6 +35,19 @@ * * $NetBSD: clock_subr.h,v 1.7 2000/10/03 13:41:07 tsutsui Exp $ * + * + * This file is the central clearing-house for calendrical issues. + * + * In general the kernel does not know about minutes, hours, days, timezones, + * daylight savings time, leap-years and such. All that is theoretically a + * matter for userland only. + * + * Parts of kernel code does however care: badly designed filesystems store + * timestamps in local time and RTC chips sometimes track time in a local + * timezone instead of UTC and so on. + * + * All that code should go here for service. + * * $FreeBSD$ */ @@ -44,15 +57,6 @@ #ifdef _KERNEL /* No user serviceable parts */ /* - * Kernel to clock driver interface. - */ -void inittodr(time_t base); -void resettodr(void); -void startrtclock(void); - -extern int disable_rtc_set; - -/* * Timezone info from settimeofday(2), usually not used */ extern int tz_minuteswest; diff --git a/sys/sys/time.h b/sys/sys/time.h index b12b6d8..320a121 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -255,6 +255,13 @@ struct clockinfo { #endif #ifdef _KERNEL + +/* + * Kernel to clock driver interface. + */ +void inittodr(time_t base); +void resettodr(void); + extern time_t time_second; extern time_t time_uptime; extern struct timeval boottime; |