Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2014 13:31:02 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r265679 - stable/10/sys/cddl/compat/opensolaris/sys
Message-ID:  <201405081331.s48DV2FI019821@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405081331.s48DV2FI019821>