aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/machdep.c1
-rw-r--r--sys/amd64/include/clock.h3
-rw-r--r--sys/amd64/isa/clock.c1
-rw-r--r--sys/amd64/linux32/linux32_machdep.c1
-rw-r--r--sys/arm/include/clock.h3
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c1
-rw-r--r--sys/dev/twa/tw_osl_includes.h2
-rw-r--r--sys/dev/twa/tw_osl_share.h2
-rw-r--r--sys/fs/msdosfs/msdosfs_conv.c2
-rw-r--r--sys/fs/nwfs/nwfs_subr.c1
-rw-r--r--sys/i386/bios/apm.c1
-rw-r--r--sys/i386/i386/machdep.c1
-rw-r--r--sys/i386/ibcs2/ibcs2_xenix.c1
-rw-r--r--sys/i386/include/clock.h3
-rw-r--r--sys/i386/isa/clock.c1
-rw-r--r--sys/i386/isa/pmtimer.c1
-rw-r--r--sys/ia64/ia64/clock.c1
-rw-r--r--sys/ia64/include/clock.h4
-rw-r--r--sys/isa/atrtc.c1
-rw-r--r--sys/kern/kern_time.c1
-rw-r--r--sys/kern/vfs_mount.c1
-rw-r--r--sys/nfsclient/nfs_vfsops.c1
-rw-r--r--sys/pc98/cbus/clock.c1
-rw-r--r--sys/pc98/cbus/pcrtc.c1
-rw-r--r--sys/pc98/pc98/machdep.c1
-rw-r--r--sys/powerpc/include/clock.h4
-rw-r--r--sys/sparc64/include/clock.h3
-rw-r--r--sys/sys/clock.h24
-rw-r--r--sys/sys/kernel.h3
-rw-r--r--sys/sys/systm.h7
30 files changed, 43 insertions, 35 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 544b9fb4b550..13161868cc1b 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 f091b17d8e2b..36d0bebe00cf 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 28116dc08420..81082819f797 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 a55360286311..42f413dcbc93 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 9d90ff7e0622..61922f4daa93 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 2c5668782ab6..461e8c0c4eb4 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 48455e1776b4..c2c77b789f78 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 49c6e77d3833..f17d49d9679b 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 9fc666d1ad81..21836f294292 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 e983b13aa589..eabcc5f01b72 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 4e3dba31947b..f23099fbc801 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 ee7ed43db28d..d877f4b17a43 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 94a4eaed0dd5..8ff599721421 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 9550fab49b82..74679b9210ce 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 652cc0144cd5..9a80d8385ab8 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 1eeac6ddf46b..87eda2d4b0a2 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 24b7917d36dc..c7e5ccf40915 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 b05815830633..31a8ed2f8fc8 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 652cc0144cd5..9a80d8385ab8 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 0569c4b980f2..f6cd8ec08520 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 592daf3aabb4..c89a5fa35fb0 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 69476bcac52c..ee4c977c62a5 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 1bc70b09887c..2e2fc2ed93f3 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 1bc70b09887c..2e2fc2ed93f3 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 089d3a732a5b..6c1adda7dc9e 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 820a0d7d4ee0..ead37ac149ab 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 fbedfea57de9..c98b024437e3 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 1b61b1948c0e..be0de57ba628 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 cc36ede11079..1bee3fa8525b 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 bc2c65d7c5b6..150df1758f99 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) \