diff options
author | mav <mav@FreeBSD.org> | 2014-01-03 18:08:31 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-01-03 18:08:31 +0000 |
commit | 7402ef489749b9b9fc300d1219f14388caca38fe (patch) | |
tree | ebf042f7489eaa848a6c0d46b2ced6691cd8bad0 /sys/cddl | |
parent | 83ac68548d8e58cbbddde3a08004050d31c24b27 (diff) | |
download | FreeBSD-src-7402ef489749b9b9fc300d1219f14388caca38fe.zip FreeBSD-src-7402ef489749b9b9fc300d1219f14388caca38fe.tar.gz |
Remove extra conversion to nanoseconds from ddi_get_lbolt64().
As result this uses one multiplication and shifts instead of one division
and two multiplications.
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/time.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h index 1f210c5..e980e3b 100644 --- a/sys/cddl/compat/opensolaris/sys/time.h +++ b/sys/cddl/compat/opensolaris/sys/time.h @@ -70,12 +70,13 @@ gethrtime(void) { #define gethrtime_waitfree() gethrtime() extern int nsec_per_tick; /* nanoseconds per clock tick */ +extern int hz; /* clock ticks per second */ static __inline int64_t ddi_get_lbolt64(void) { - return (gethrtime() / nsec_per_tick); + return (((getsbinuptime() >> 16) * hz) >> 16); } static __inline clock_t |