diff options
author | mav <mav@FreeBSD.org> | 2014-05-08 13:31:01 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-05-08 13:31:01 +0000 |
commit | 1cf59d11f48577bcd6fc3157bb8eb1d8a40e01d7 (patch) | |
tree | 89b10cb357f7547858306f01aece3aa86b9d354c /sys/cddl/compat/opensolaris/sys/time.h | |
parent | 44963562b00b94a91a0e5a1a5f7173128348f394 (diff) | |
download | FreeBSD-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.
Diffstat (limited to 'sys/cddl/compat/opensolaris/sys/time.h')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/time.h | 16 |
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 |