diff options
author | phk <phk@FreeBSD.org> | 2008-04-22 19:38:30 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2008-04-22 19:38:30 +0000 |
commit | 8d647da1edcc4aad93660da8a41dc09f628eb53c (patch) | |
tree | e4f15176f61a95b3d24f7c514cf7cb4c76fbb8bf /sys/kern/subr_clock.c | |
parent | a82fbe5c0ffe1812ebbef9a1aa50deadd4d4cb8c (diff) | |
download | FreeBSD-src-8d647da1edcc4aad93660da8a41dc09f628eb53c.zip FreeBSD-src-8d647da1edcc4aad93660da8a41dc09f628eb53c.tar.gz |
Now that all platforms use genclock, shuffle things around slightly
for better structure.
Much of this is related to <sys/clock.h>, which should really have
been called <sys/calendar.h>, but unless and until we need the name,
the repocopy can wait.
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 almost universally
track time in a YY-MM-DD HH:MM:SS format, and sometimes in local
timezone instead of UTC. For this we have <sys/clock.h>
<sys/time.h> on the other hand, deals with time_t, timeval, timespec
and so on. These know only seconds and fractions thereof.
Move inittodr() and resettodr() prototypes to <sys/time.h>.
Retain the names as it is one of the few surviving PDP/VAX references.
Move startrtclock() to <machine/clock.h> on relevant platforms, it
is a MD call between machdep.c/clock.c. Remove references to it
elsewhere.
Remove a lot of unnecessary <sys/clock.h> includes.
Move the machdep.disable_rtc_set sysctl to subr_rtc.c where it belongs.
XXX: should be kern.disable_rtc_set really, it's not MD.
Diffstat (limited to 'sys/kern/subr_clock.c')
-rw-r--r-- | sys/kern/subr_clock.c | 9 |
1 files changed, 2 insertions, 7 deletions
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); |