From owner-svn-src-all@FreeBSD.ORG Thu May 8 13:31:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64D1158C; Thu, 8 May 2014 13:31:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51FBDFB1; Thu, 8 May 2014 13:31:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48DV2i0019822; Thu, 8 May 2014 13:31:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DV2FI019821; Thu, 8 May 2014 13:31:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081331.s48DV2FI019821@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 13:31:02 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:31:02 -0000 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