diff options
30 files changed, 43 insertions, 35 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 544b9fb..1316186 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -61,6 +61,7 @@ __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 f091b17..36d0beb 100644 --- a/sys/amd64/include/clock.h +++ b/sys/amd64/include/clock.h @@ -14,9 +14,7 @@ * i386 to clock driver interface. * XXX large parts of the driver and its interface are misplaced. */ -extern int adjkerntz; extern int clkintr_pending; -extern int disable_rtc_set; extern int pscnt; extern int psdiv; extern int statclock_disable; @@ -24,7 +22,6 @@ extern u_int timer_freq; extern int timer0_max_count; extern uint64_t tsc_freq; extern int tsc_is_broken; -extern int wall_cmos_clock; extern struct mtx clock_lock; /* diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 28116dc..8108281 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -52,6 +52,7 @@ __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/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index a553602..42f413d 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/clock.h> #include <sys/imgact.h> #include <sys/limits.h> #include <sys/lock.h> diff --git a/sys/arm/include/clock.h b/sys/arm/include/clock.h index 9d90ff7..61922f4 100644 --- a/sys/arm/include/clock.h +++ b/sys/arm/include/clock.h @@ -29,7 +29,4 @@ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ -#define wall_cmos_clock 0 -#define adjkerntz 0 - #endif /* !_MACHINE_CLOCK_H_ */ diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 2c56687..461e8c0 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/clock.h> #include <sys/exec.h> #include <sys/fcntl.h> #include <sys/filedesc.h> diff --git a/sys/dev/twa/tw_osl_includes.h b/sys/dev/twa/tw_osl_includes.h index 48455e1..c2c77b7 100644 --- a/sys/dev/twa/tw_osl_includes.h +++ b/sys/dev/twa/tw_osl_includes.h @@ -53,6 +53,7 @@ #include <sys/sysctl.h> #include <sys/bus.h> #include <sys/conf.h> +#include <sys/clock.h> #include <sys/disk.h> #include <sys/stat.h> #include <sys/devicestat.h> @@ -60,7 +61,6 @@ #include <machine/bus.h> #include <machine/resource.h> -#include <machine/clock.h> #include <machine/stdarg.h> #include <vm/vm.h> diff --git a/sys/dev/twa/tw_osl_share.h b/sys/dev/twa/tw_osl_share.h index 49c6e77..f17d49d 100644 --- a/sys/dev/twa/tw_osl_share.h +++ b/sys/dev/twa/tw_osl_share.h @@ -49,6 +49,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/clock.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sysctl.h> @@ -56,7 +57,6 @@ #include <sys/taskqueue.h> #include <machine/bus.h> -#include <machine/clock.h> #include <machine/endian.h> #include <machine/stdarg.h> diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index 9fc666d..21836f2 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -52,7 +52,7 @@ * System include files. */ #include <sys/param.h> -#include <sys/time.h> +#include <sys/clock.h> #include <sys/kernel.h> /* defines tz */ #include <sys/systm.h> #include <machine/clock.h> diff --git a/sys/fs/nwfs/nwfs_subr.c b/sys/fs/nwfs/nwfs_subr.c index e983b13..eabcc5f 100644 --- a/sys/fs/nwfs/nwfs_subr.c +++ b/sys/fs/nwfs/nwfs_subr.c @@ -34,6 +34,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/clock.h> #include <sys/lockmgr.h> #include <sys/malloc.h> #include <machine/clock.h> diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 4e3dba3..f23099f 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -22,6 +22,7 @@ __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 ee7ed43..d877f4b 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -62,6 +62,7 @@ __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/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c index 94a4eae..8ff5997 100644 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ b/sys/i386/ibcs2/ibcs2_xenix.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/namei.h> #include <sys/sysproto.h> +#include <sys/clock.h> #include <sys/jail.h> #include <sys/kernel.h> #include <sys/malloc.h> diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h index 9550fab..74679b9 100644 --- a/sys/i386/include/clock.h +++ b/sys/i386/include/clock.h @@ -14,9 +14,7 @@ * i386 to clock driver interface. * XXX large parts of the driver and its interface are misplaced. */ -extern int adjkerntz; extern int clkintr_pending; -extern int disable_rtc_set; extern int pscnt; extern int psdiv; extern int statclock_disable; @@ -24,7 +22,6 @@ extern u_int timer_freq; extern int timer0_max_count; extern uint64_t tsc_freq; extern int tsc_is_broken; -extern int wall_cmos_clock; extern struct mtx clock_lock; /* diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 652cc01..9a80d83 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -55,6 +55,7 @@ __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 1eeac6d..87eda2d 100644 --- a/sys/i386/isa/pmtimer.c +++ b/sys/i386/isa/pmtimer.c @@ -35,6 +35,7 @@ __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 24b7917..c7e5ccf 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -29,6 +29,7 @@ __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> diff --git a/sys/ia64/include/clock.h b/sys/ia64/include/clock.h index b058158..31a8ed2 100644 --- a/sys/ia64/include/clock.h +++ b/sys/ia64/include/clock.h @@ -13,10 +13,6 @@ #define CLOCK_VECTOR 254 -extern int adjkerntz; -extern int disable_rtc_set; -extern int wall_cmos_clock; - extern uint64_t ia64_clock_reload; extern uint64_t itc_frequency; diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 652cc01..9a80d83 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -55,6 +55,7 @@ __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/kern/kern_time.c b/sys/kern/kern_time.c index 0569c4b..f6cd8ec 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/limits.h> +#include <sys/clock.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sysproto.h> diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 592daf3..c89a5fa 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/conf.h> +#include <sys/clock.h> #include <sys/jail.h> #include <sys/kernel.h> #include <sys/libkern.h> diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 69476bc..ee4c977 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -44,6 +44,7 @@ __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 1bc70b0..2e2fc2e 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -56,6 +56,7 @@ #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/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 1bc70b0..2e2fc2e 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -56,6 +56,7 @@ #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 089d3a7..6c1adda 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -60,6 +60,7 @@ __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/include/clock.h b/sys/powerpc/include/clock.h index 820a0d7..ead37ac1 100644 --- a/sys/powerpc/include/clock.h +++ b/sys/powerpc/include/clock.h @@ -11,10 +11,6 @@ #ifdef _KERNEL -extern int disable_rtc_set; -extern int wall_cmos_clock; -extern int adjkerntz; - struct trapframe; int sysbeep(int pitch, int period); diff --git a/sys/sparc64/include/clock.h b/sys/sparc64/include/clock.h index fbedfea..c98b024 100644 --- a/sys/sparc64/include/clock.h +++ b/sys/sparc64/include/clock.h @@ -33,9 +33,6 @@ extern u_long tick_increment; extern u_long tick_freq; extern u_long tick_MHz; -extern int adjkerntz; -extern int wall_cmos_clock; - int sysbeep(int, int); #endif /* !_MACHINE_CLOCK_H_ */ diff --git a/sys/sys/clock.h b/sys/sys/clock.h index 1b61b19..be0de57 100644 --- a/sys/sys/clock.h +++ b/sys/sys/clock.h @@ -41,6 +41,24 @@ #ifndef _SYS_CLOCK_H_ #define _SYS_CLOCK_H_ +#ifdef _KERNEL /* No user serviceable parts */ + +/* + * Kernel to clock driver interface. + */ +void inittodr(time_t base); +void resettodr(void); +void startrtclock(void); +extern int wall_cmos_clock; +extern int adjkerntz; +extern int disable_rtc_set; + +/* + * Timezone info from settimeofday(2), usually not used + */ +extern int tz_minuteswest; +extern int tz_dsttime; + /* * Structure to hold the values typically reported by time-of-day clocks. * This can be passed to the generic conversion functions to be converted @@ -64,8 +82,8 @@ void clock_register(device_t, long); /* * BCD to decimal and decimal to BCD. */ -#define FROMBCD(x) (((x) >> 4) * 10 + ((x) & 0xf)) -#define TOBCD(x) (((x) / 10 * 16) + ((x) % 10)) +#define FROMBCD(x) bcd2bin(x) +#define TOBCD(x) bin2bcd(x) /* Some handy constants. */ #define SECDAY (24 * 60 * 60) @@ -74,4 +92,6 @@ void clock_register(device_t, long); /* Traditional POSIX base year */ #define POSIX_BASE_YEAR 1970 +#endif /* _KERNEL */ + #endif /* !_SYS_CLOCK_H_ */ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index cc36ede..1bee3fa 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -69,9 +69,6 @@ extern int profprocs; /* number of process's profiling */ extern int ticks; extern int lbolt; /* once a second sleep address */ -extern int tz_minuteswest; -extern int tz_dsttime; - #endif /* _KERNEL */ /* diff --git a/sys/sys/systm.h b/sys/sys/systm.h index bc2c65d..150df17 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -266,13 +266,6 @@ void usrinfoinit(void); /* Finalize the world. */ void shutdown_nice(int); -/* - * Kernel to clock driver interface. - */ -void inittodr(time_t base); -void resettodr(void); -void startrtclock(void); - /* Timeouts */ typedef void timeout_t(void *); /* timeout function type */ #define CALLOUT_HANDLE_INITIALIZER(handle) \ |