summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2020-06-26 18:48:32 +0000
committercheloha <cheloha@cvs.openbsd.org>2020-06-26 18:48:32 +0000
commitf411fbba85151c4795c35d2764d1731a0ea94683 (patch)
tree478a4025e6721c00b46cbb022dac3558abcf00b3 /sys
parentc5fcf5d726cbaddb261acb6eb9afc16f7c78423e (diff)
timecounting: deprecate time_second(9), time_uptime(9)
time_second(9) has been replaced in the kernel by gettime(9). time_uptime(9) has been replaced in the kernel by getuptime(9). New code should use the replacement interfaces. They do not suffer from the split-read problem inherent to the time_* variables on 32-bit platforms. The variables remain in sys/kern/kern_tc.c for use via kvm(3) when examining kernel core dumps. This commit completes the deprecation process: - Remove the extern'd definitions for time_second and time_uptime from sys/time.h. - Replace manpage cross-references to time_second(9)/time_uptime(9) with references to microtime(9) or a related interface. - Move the time_second.9 manpage to the attic. With input from dlg@, kettenis@, visa@, and tedu@. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_tc.c6
-rw-r--r--sys/sys/time.h5
2 files changed, 6 insertions, 5 deletions
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()
*