diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-07-27 11:08:59 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-07-27 11:08:59 +0000 |
commit | 584b675ed657ee94cabcf475b1ed73bee4eb4054 (patch) | |
tree | e08e805219bd39e9a9c2d5cd174b1732cebd707f /sys/net/altq | |
parent | dc831186e32a0fbb7452d890f9ca459e192bae1d (diff) | |
download | src-584b675ed657ee94cabcf475b1ed73bee4eb4054.tar.gz src-584b675ed657ee94cabcf475b1ed73bee4eb4054.zip |
Hide the boottime and bootimebin globals, provide the getboottime(9)
and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI. The variables were renamed to avoid shadowing issues with local
variables of the same name.
Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure. As a
preparation, this commit only introduces the interface.
Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance. Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.
Tested by: pho (as part of the bigger patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302
Notes
Notes:
svn path=/head/; revision=303382
Diffstat (limited to 'sys/net/altq')
-rw-r--r-- | sys/net/altq/altq_subr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index 873d7bd83aa6..c5093d82eb3d 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -1027,9 +1027,10 @@ read_machclk(void) panic("read_machclk"); #endif } else { - struct timeval tv; + struct timeval tv, boottime; microtime(&tv); + getboottime(&boottime); val = (((u_int64_t)(tv.tv_sec - boottime.tv_sec) * 1000000 + tv.tv_usec) << MACHCLK_SHIFT); } |