diff options
Diffstat (limited to 'sys/cddl/compat/opensolaris/sys/time.h')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/time.h | 17 |
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 |