]> granicus.if.org Git - spl/commitdiff
Add msec/usec/nsec to tick convertors
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 30 Apr 2013 16:46:33 +0000 (09:46 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 May 2013 19:07:56 +0000 (12:07 -0700)
Add wrappers for the Solaris MSEC_TO_TICK, USEC_TO_TICK, and
NSEC_TO_TICK conversion functions.  They are mapped directly to
their Linux counterparts with the exception of NSEC_TO_TICK
can cannot use usecs_to_jiffies() because it is not exported
by the kernel.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/timer.h

index 096eb1a4e3e5b7779c32bdaaafecbab021066b2f..13ef4045247f35450384b0b539b47f07f615f2b6 100644 (file)
 
 #define delay(ticks)                   schedule_timeout((long)(ticks))
 
+#define SEC_TO_TICK(sec)               ((sec) * HZ)
+#define MSEC_TO_TICK(ms)               msecs_to_jiffies(ms)
+#define USEC_TO_TICK(us)               usecs_to_jiffies(us)
+#define NSEC_TO_TICK(ns)               usecs_to_jiffies(ns / NSEC_PER_USEC)
+
 #endif  /* _SPL_TIMER_H */