| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:41:54 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of DRV_HZTOUSECDescription: Manual PageKeywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpciDRV_HZTOUSECSection: Linux Fast-STREAMS DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEdrv_hztousec, drv_usectohz, drv_hztomsec, drv_msectohz - convert kernel tick time between microseconds or millisecondsSYNOPSIS#include <sys/types.h>
ARGUMENTS
INTERFACEDESCRIPTIONdrv_hztousec() drv_hztomsec() drv_usectohz() and drv_msectohz() provide a mechanism for converting between kernel tick time and an absolute time unit (microseconds or milliseconds). Use of these functions permit driver code to be architecturally independent from the quantum of the kernel tick clock. drv_hztousec() accepts a kernel tick clock time as the hertz argument and returns the time in microseconds. drv_hztomsec() accepts a kernel tick clock time as the hertz argument and returns the time in milliseconds. drv_usectohz() accepts a time interval in microseconds in the usec argument and returns the time in clock ticks. drv_msectohz() accepts a time interval in milliseconds in the msec argument and returns the time in clock ticks. These functions are useful in conjunction with timeout(9) and qtimeout(9) which only accept timeout durations in system ticks. RETURNdrv_usectohz() and drv_msectohz() return the time value in ticks. drv_hztousec() returns the time value in microseconds. drv_hztomsec() returns the time value in milliseconds. ERRORSdrv_hztousec(), drv_hztomsec(), drv_usectohz() and drv_msectohz() always succeed. CONTEXTdrv_hztousec(), drv_hztomsec(), drv_usectohz() and drv_msectohz() can be called from any context, including user context, module procedures, callouts, callbacks, soft interrupts (tasklets and bottom halves), and interrupt service routines. MP-STREAMSdrv_hztousec(), drv_hztomsec(), drv_usectohz() and drv_msectohz() are MP safe. NOTICESdrv_hztousec(), drv_hztomsec(), drv_usectohz() and drv_msectohz() are implemented by performing simple calculations using jiffies(9) and HZ(9). There are defined as extern inline functions and with optimization these calculations will be inline. drv_usectohz() and drv_msectohz() always truncate to the next lowest integer tick value. This means that, when converting a value less than a tick, the result will always be 0 ticks. This makes these functions unsafe for use directly with timeout(9) and qtimeout(9). The caller should test whether the result is zero before passing it to timeout(9) or qtimeout(9), unless it is acceptable to cause a possibly immediate timeout callback. Care should be taken with the drv_hztousec() function, as coverted value can easily overflow a clock_t. Portable STREAMS drivers and modules will only convert differences between successive calls to drv_getparm(9) or retrieval of lbolt(9) with drv_hztousec() instead of converting each value (possibly causing an overflow on each) and then taking the difference. SEE ALSOdrv_getparm(9), ddi_get_lbolt(9), ddi_get_time(9). BUGSThese functions have no known bugs in LfS[1]. COMPATIBILITYdrv_hztousec(), drv_hztomsec(), drv_usectohz() and drv_msectohz() are source-level compatible with SVR 4.2 MP DDI/DKI[2], and implementations based on SVR 4.2[3], with the following portability considerations:
See STREAMS(9) for additional compatibility information. CONFORMANCEdrv_hztousec() and drv_usectohz() conform to SVR 4.2 MP DDI/DKI[2]. drv_hztomsec() and drv_msectohz() are Linux Fast-STREAMS specific. HISTORYdrv_hztousec() and drv_usectohz() first appeared in SVR 4[5]. REFERENCES
TRADEMARKS
Other trademarks are the property of their respective owners. IDENTIFICATION
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
Index
This document was created by man2html, using the manual pages. Time: 11:58:22 GMT, May 25, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:41:54 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |