diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-10-02 12:59:59 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-10-02 12:59:59 +0000 |
commit | f645b0b51cd22b129405c2c32dba1d051ae3d99c (patch) | |
tree | f5002a864a5082d410445f24b5d28a04581034f1 | |
parent | 77ec673a84fac9ceb67d89bc7c2069c9ec2a7cb6 (diff) |
Notes
30 files changed, 43 insertions, 35 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 544b9fb4b5503..13161868cc1b6 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 f091b17d8e2b0..36d0bebe00cf9 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 28116dc08420b..81082819f7972 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 a553602863112..42f413dcbc931 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 9d90ff7e06224..61922f4daa93a 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 2c5668782ab68..461e8c0c4eb48 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 48455e1776b47..c2c77b789f786 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 49c6e77d38332..f17d49d9679b7 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 9fc666d1ad81d..21836f2942924 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 e983b13aa589b..eabcc5f01b72f 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 4e3dba31947bc..f23099fbc8018 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 ee7ed43db28d0..d877f4b17a433 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 94a4eaed0dd5d..8ff5997214213 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 9550fab49b82e..74679b9210ce9 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 652cc0144cd50..9a80d8385ab8b 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 1eeac6ddf46b2..87eda2d4b0a2b 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 24b7917d36dc5..c7e5ccf40915b 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 b058158306331..31a8ed2f8fc85 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 652cc0144cd50..9a80d8385ab8b 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 0569c4b980f2d..f6cd8ec08520a 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 592daf3aabb46..c89a5fa35fb0f 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 69476bcac52c3..ee4c977c62a5e 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 1bc70b09887ca..2e2fc2ed93f31 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 1bc70b09887ca..2e2fc2ed93f31 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 089d3a732a5b6..6c1adda7dc9ea 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 820a0d7d4ee02..ead37ac149abc 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 fbedfea57de97..c98b024437e39 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 1b61b1948c0e4..be0de57ba6281 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 cc36ede110797..1bee3fa8525bf 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 bc2c65d7c5b66..150df1758f99d 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) \ |