Print this page
XXXX introduce drv_sectohz

@@ -24,10 +24,13 @@
 
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ */
 
 /*
  * UNIX Device Driver Interface functions
  *
  * This file contains functions that are to be added to the kernel

@@ -460,10 +463,25 @@
                 return (0);
 
         return (USEC_TO_TICK_ROUNDUP(microsecs));
 }
 
+/*
+ * Convert from seconds to system time units (hz).
+ *
+ * If secs <= 0, return 0.
+ * Otherwise, convert seconds to ticks, rounding up.
+ */
+clock_t
+drv_sectohz(clock_t secs)
+{
+        if (secs <= 0)
+                return (0);
+
+        return (SEC_TO_TICK(secs));
+}
+
 #ifdef  sun
 /*
  * drv_usecwait implemented in each architecture's machine
  * specific code somewhere. For sparc, it is the alternate entry
  * to usec_delay (eventually usec_delay goes away). See