svn commit: r265679 - stable/10/sys/cddl/compat/opensolaris/sys
Alexander Motin
mav at FreeBSD.org
Thu May 8 13:31:02 UTC 2014
Author: mav
Date: Thu May 8 13:31:01 2014
New Revision: 265679
URL: http://svnweb.freebsd.org/changeset/base/265679
Log:
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.
Modified:
stable/10/sys/cddl/compat/opensolaris/sys/time.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/compat/opensolaris/sys/time.h
==============================================================================
--- stable/10/sys/cddl/compat/opensolaris/sys/time.h Thu May 8 13:12:24 2014 (r265678)
+++ stable/10/sys/cddl/compat/opensolaris/sys/time.h Thu May 8 13:31:01 2014 (r265679)
@@ -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
More information about the svn-src-stable
mailing list