summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man4/man4.octeon/octrtc.48
-rw-r--r--share/man/man9/hardclock.95
-rw-r--r--share/man/man9/inittodr.98
-rw-r--r--share/man/man9/microtime.97
-rw-r--r--share/man/man9/ppsratecheck.98
-rw-r--r--share/man/man9/ratecheck.98
-rw-r--r--share/man/man9/resettodr.913
-rw-r--r--share/man/man9/time_second.977
-rw-r--r--sys/kern/kern_tc.c6
-rw-r--r--sys/sys/time.h5
10 files changed, 32 insertions, 113 deletions
diff --git a/share/man/man4/man4.octeon/octrtc.4 b/share/man/man4/man4.octeon/octrtc.4
index b05d76b544d..191b4714463 100644
--- a/share/man/man4/man4.octeon/octrtc.4
+++ b/share/man/man4/man4.octeon/octrtc.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: octrtc.4,v 1.4 2020/04/06 00:01:08 pirofti Exp $
+.\" $OpenBSD: octrtc.4,v 1.5 2020/06/26 18:48:31 cheloha Exp $
.\"
.\" Copyright (c) 2014 Paul Irofti <paul@irofti.net>
.\"
@@ -15,7 +15,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\"
-.Dd $Mdocdate: April 6 2020 $
+.Dd $Mdocdate: June 26 2020 $
.Dt OCTRTC 4 octeon
.Os
.Sh NAME
@@ -46,9 +46,9 @@ Known models missing a DS1377 clock:
.El
.Sh SEE ALSO
.Xr intro 4 ,
+.Xr gettime 9 ,
.Xr inittodr 9 ,
-.Xr resettodr 9 ,
-.Xr time_second 9
+.Xr resettodr 9
.Sh HISTORY
The
.Nm
diff --git a/share/man/man9/hardclock.9 b/share/man/man9/hardclock.9
index bf4a0fd0b79..a53388f4a45 100644
--- a/share/man/man9/hardclock.9
+++ b/share/man/man9/hardclock.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: hardclock.9,v 1.12 2016/09/27 17:06:24 schwarze Exp $
+.\" $OpenBSD: hardclock.9,v 1.13 2020/06/26 18:48:31 cheloha Exp $
.\"
.\" Copyright (c) 2001 Kenneth R Westerback
.\" All rights reserved.
@@ -24,7 +24,7 @@
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 27 2016 $
+.Dd $Mdocdate: June 26 2020 $
.Dt HARDCLOCK 9
.Os
.Sh NAME
@@ -74,5 +74,4 @@ is implemented in the file
.Xr hz 9 ,
.Xr microtime 9 ,
.Xr spl 9 ,
-.Xr time_second 9 ,
.Xr timeout 9
diff --git a/share/man/man9/inittodr.9 b/share/man/man9/inittodr.9
index c4452ddecd9..f708d0b904d 100644
--- a/share/man/man9/inittodr.9
+++ b/share/man/man9/inittodr.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: inittodr.9,v 1.11 2016/04/03 06:43:59 jsg Exp $
+.\" $OpenBSD: inittodr.9,v 1.12 2020/06/26 18:48:31 cheloha Exp $
.\" $NetBSD: inittodr.9,v 1.2 1996/03/27 21:16:06 jtc Exp $
.\"
.\" Copyright (c) 1994 Christopher G. Demetriou
@@ -30,7 +30,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 3 2016 $
+.Dd $Mdocdate: June 26 2020 $
.Dt INITTODR 9
.Os
.Sh NAME
@@ -88,8 +88,8 @@ The
time and the battery-backed clock's time differ by a large amount.
.El
.Sh SEE ALSO
-.Xr resettodr 9 ,
-.Xr time_second 9
+.Xr microtime 9 ,
+.Xr resettodr 9
.Sh BUGS
Each system's heuristics for picking the correct time are slightly
different.
diff --git a/share/man/man9/microtime.9 b/share/man/man9/microtime.9
index f8904c6f6a0..aef446f36fc 100644
--- a/share/man/man9/microtime.9
+++ b/share/man/man9/microtime.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: microtime.9,v 1.21 2020/06/22 21:16:07 cheloha Exp $
+.\" $OpenBSD: microtime.9,v 1.22 2020/06/26 18:48:31 cheloha Exp $
.\" $NetBSD: microtime.9,v 1.2 1999/03/16 00:40:47 garbled Exp $
.\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 22 2020 $
+.Dd $Mdocdate: June 26 2020 $
.Dt MICROTIME 9
.Os
.Sh NAME
@@ -151,5 +151,4 @@ the bulk of the code is in the file
.Xr settimeofday 2 ,
.Xr hardclock 9 ,
.Xr hz 9 ,
-.Xr inittodr 9 ,
-.Xr time_second 9
+.Xr inittodr 9
diff --git a/share/man/man9/ppsratecheck.9 b/share/man/man9/ppsratecheck.9
index 7fbb19e29a3..179ca9ebfe3 100644
--- a/share/man/man9/ppsratecheck.9
+++ b/share/man/man9/ppsratecheck.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ppsratecheck.9,v 1.6 2016/04/03 06:43:59 jsg Exp $
+.\" $OpenBSD: ppsratecheck.9,v 1.7 2020/06/26 18:48:31 cheloha Exp $
.\" $NetBSD: ppsratecheck.9,v 1.1 2000/08/03 00:09:39 itojun Exp $
.\"
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 3 2016 $
+.Dd $Mdocdate: June 26 2020 $
.Dt PPSRATECHECK 9
.Os
.Sh NAME
@@ -79,9 +79,9 @@ will be incremented every time
is called, and will be reset whenever necessary.
.Sh SEE ALSO
.Xr log 9 ,
+.Xr microtime 9 ,
.Xr printf 9 ,
-.Xr ratecheck 9 ,
-.Xr time_second 9
+.Xr ratecheck 9
.Sh HISTORY
The
.Fn ppsratecheck
diff --git a/share/man/man9/ratecheck.9 b/share/man/man9/ratecheck.9
index cafcecf3f0d..77639bd8e62 100644
--- a/share/man/man9/ratecheck.9
+++ b/share/man/man9/ratecheck.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ratecheck.9,v 1.12 2017/10/29 08:42:55 mpi Exp $
+.\" $OpenBSD: ratecheck.9,v 1.13 2020/06/26 18:48:31 cheloha Exp $
.\" $NetBSD: ratecheck.9,v 1.1.2.1 2000/02/18 20:26:43 he Exp $
.\"
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: October 29 2017 $
+.Dd $Mdocdate: June 26 2020 $
.Dt RATECHECK 9
.Os
.Sh NAME
@@ -129,8 +129,8 @@ drv_errhandler(int err1, int err2)
.Ed
.Sh SEE ALSO
.Xr log 9 ,
-.Xr printf 9 ,
-.Xr time_second 9
+.Xr microtime 9 ,
+.Xr printf 9
.Sh HISTORY
The
.Fn ratecheck
diff --git a/share/man/man9/resettodr.9 b/share/man/man9/resettodr.9
index 7d6284c625e..59bd71d9428 100644
--- a/share/man/man9/resettodr.9
+++ b/share/man/man9/resettodr.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: resettodr.9,v 1.7 2016/04/03 06:43:59 jsg Exp $
+.\" $OpenBSD: resettodr.9,v 1.8 2020/06/26 18:48:31 cheloha Exp $
.\" $NetBSD: resettodr.9,v 1.1 1995/11/25 21:24:51 perry Exp $
.\"
.\" Copyright (c) 1994 Christopher G. Demetriou
@@ -30,7 +30,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 3 2016 $
+.Dd $Mdocdate: June 26 2020 $
.Dt RESETTODR 9
.Os
.Sh NAME
@@ -42,12 +42,9 @@
.Sh DESCRIPTION
The
.Fn resettodr
-function sets the system's battery backed clock based on the contents
-of the system
-.Va time_second
-variable or a function such as
+function sets the system's battery backed clock to a value based on the
+output of a function such as
.Xr microtime 9 .
.Sh SEE ALSO
.Xr inittodr 9 ,
-.Xr microtime 9 ,
-.Xr time_second 9
+.Xr microtime 9
diff --git a/share/man/man9/time_second.9 b/share/man/man9/time_second.9
deleted file mode 100644
index 1e7f31ecd76..00000000000
--- a/share/man/man9/time_second.9
+++ /dev/null
@@ -1,77 +0,0 @@
-.\" $OpenBSD: time_second.9,v 1.1 2016/04/03 06:43:59 jsg Exp $
-.\" $NetBSD: time.9,v 1.1 1995/11/25 21:24:53 perry Exp $
-.\"
-.\" Copyright (c) 1994 Christopher G. Demetriou
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Christopher G. Demetriou
-.\" for the NetBSD Project.
-.\" 3. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd $Mdocdate: April 3 2016 $
-.Dt TIME_SECOND 9
-.Os
-.Sh NAME
-.Nm time_second ,
-.Nm time_uptime
-.Nd system time variables
-.Sh SYNOPSIS
-.Vt extern volatile time_t time_second;
-.Vt extern volatile time_t time_uptime;
-.Sh DESCRIPTION
-The
-.Va time_second
-variable is the system's
-.Dq wall time
-clock.
-It is set at boot by
-.Xr inittodr 9 ,
-and is updated by the
-.Xr settimeofday 2
-system call and by periodic clock interrupts.
-.Pp
-The
-.Va time_uptime
-variable is a monotonically increasing system clock.
-It is set at boot, and is updated by the periodic timer interrupt.
-(It is not updated by
-.Xr settimeofday 2 . )
-.Pp
-All of these variables contain times
-expressed in seconds since midnight (0 hour),
-January 1, 1970.
-.Pp
-Clock interrupts should be blocked when reading or writing
-.Va time_second
-or
-.Va time_uptime ,
-because those variables are updated by
-.Xr hardclock 9 .
-.Sh SEE ALSO
-.Xr settimeofday 2 ,
-.Xr hardclock 9 ,
-.Xr hz 9 ,
-.Xr inittodr 9 ,
-.Xr microtime 9
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 54d50b1a6f7..96bc4b952c8 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_tc.c,v 1.58 2020/06/22 21:16:07 cheloha Exp $ */
+/* $OpenBSD: kern_tc.c,v 1.59 2020/06/26 18:48:31 cheloha Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@@ -113,6 +113,10 @@ static struct timehands *volatile timehands = &th0; /* [w] */
struct timecounter *timecounter = &dummy_timecounter; /* [t] */
static SLIST_HEAD(, timecounter) tc_list = SLIST_HEAD_INITIALIZER(tc_list);
+/*
+ * These are updated from tc_windup(). They are useful when
+ * examining kernel core dumps.
+ */
volatile time_t time_second = 1;
volatile time_t time_uptime = 0;
diff --git a/sys/sys/time.h b/sys/sys/time.h
index 3128a9cca23..32d3dd10364 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.53 2020/06/26 03:21:46 jsg Exp $ */
+/* $OpenBSD: time.h,v 1.54 2020/06/26 18:48:31 cheloha Exp $ */
/* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */
/*
@@ -250,9 +250,6 @@ TIMEVAL_TO_BINTIME(const struct timeval *tv, struct bintime *bt)
bt->frac = (uint64_t)tv->tv_usec * (uint64_t)18446744073709ULL;
}
-extern volatile time_t time_second; /* Seconds since epoch, wall time. */
-extern volatile time_t time_uptime; /* Seconds since reboot. */
-
/*
* Functions for looking at our clocks: [get]{bin,nano,micro}[boot|up]time()
*