summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-05-08 13:31:01 +0000
committermav <mav@FreeBSD.org>2014-05-08 13:31:01 +0000
commit1cf59d11f48577bcd6fc3157bb8eb1d8a40e01d7 (patch)
tree89b10cb357f7547858306f01aece3aa86b9d354c
parent44963562b00b94a91a0e5a1a5f7173128348f394 (diff)
downloadFreeBSD-src-1cf59d11f48577bcd6fc3157bb8eb1d8a40e01d7.zip
FreeBSD-src-1cf59d11f48577bcd6fc3157bb8eb1d8a40e01d7.tar.gz
MFC r260234, r260328:
Remove extra conversion to nanoseconds from ddi_get_lbolt64(). As result this uses one multiplication and shifts instead of one division and two multiplications.
-rw-r--r--sys/cddl/compat/opensolaris/sys/time.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h
index 1f210c5..fe4857a 100644
--- a/sys/cddl/compat/opensolaris/sys/time.h
+++ b/sys/cddl/compat/opensolaris/sys/time.h
@@ -71,19 +71,9 @@ gethrtime(void) {
extern int nsec_per_tick; /* nanoseconds per clock tick */
-static __inline int64_t
-ddi_get_lbolt64(void)
-{
-
- return (gethrtime() / nsec_per_tick);
-}
-
-static __inline clock_t
-ddi_get_lbolt(void)
-{
-
- return (ddi_get_lbolt64());
-}
+#define ddi_get_lbolt64() \
+ (int64_t)(((getsbinuptime() >> 16) * hz) >> 16)
+#define ddi_get_lbolt() (clock_t)ddi_get_lbolt64()
#else
OpenPOWER on IntegriCloud