summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat/opensolaris/sys/time.h
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
committergrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
commit2c6741be0f59191f2283eb268e4f7690399d578a (patch)
treeb139c8c6dcca4fa284815daade405b75886ee360 /sys/cddl/compat/opensolaris/sys/time.h
parent3c35264f695e0a1f8a04dbcca1c93bb5159b2274 (diff)
parent19ae02bba572390c7299166228d31e54003e094a (diff)
downloadFreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.zip
FreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.tar.gz
IFC @ r222830
Diffstat (limited to 'sys/cddl/compat/opensolaris/sys/time.h')
-rw-r--r--sys/cddl/compat/opensolaris/sys/time.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h
index 05db50e..8e8a99d 100644
--- a/sys/cddl/compat/opensolaris/sys/time.h
+++ b/sys/cddl/compat/opensolaris/sys/time.h
@@ -62,8 +62,21 @@ gethrtime(void) {
#define gethrestime(ts) getnanotime(ts)
#define gethrtime_waitfree() gethrtime()
-#define ddi_get_lbolt() ((gethrtime() * hz) / NANOSEC)
-#define ddi_get_lbolt64() (int64_t)((gethrtime() * hz) / NANOSEC)
+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());
+}
#else
OpenPOWER on IntegriCloud