9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / drv_hztousec.9f
blobe4531d6a73840f084a8ae2a572c83f308842f983
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH DRV_HZTOUSEC 9F "Jan 16, 2006"
8 .SH NAME
9 drv_hztousec \- convert clock ticks to microseconds
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/ddi.h>
18 \fBclock_t\fR \fBdrv_hztousec\fR(\fBclock_t\fR \fIhertz\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Architecture independent level 1 (DDI/DKI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIhertz\fR\fR
30 .ad
31 .RS 9n
32 The number of clock ticks to convert.
33 .RE
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBdrv_hztousec()\fR function converts into microseconds the time expressed
39 by \fIhertz\fR, which is in system clock ticks.
40 .sp
41 .LP
42 The kernel variable \fBlbolt\fR, whose value should be retrieved by calling
43 \fBddi_get_lbolt\fR(9F), is the length of time the system has been up since
44 boot and is expressed in clock ticks. Drivers often use the value of
45 \fBlbolt\fR before and after an \fBI/O\fR request to measure the amount of time
46 it took the device to process the request. The \fBdrv_hztousec()\fR function
47 can be used by the driver to convert the reading from clock ticks to a known
48 unit of time.
49 .SH RETURN VALUES
50 .sp
51 .LP
52 The number of microseconds equivalent to the \fIhertz\fR parameter. No error
53 value is returned. If the microsecond equivalent to \fIhertz\fR is too large to
54 be represented as a \fBclock_t\fR, then the maximum \fBclock_t\fR value will be
55 returned.
56 .SH CONTEXT
57 .sp
58 .LP
59 The \fBdrv_hztousec()\fR function can be called from user, interrupt, or kernel
60 context.
61 .SH SEE ALSO
62 .sp
63 .LP
64 \fBddi_get_lbolt\fR(9F), \fBdrv_usectohz\fR(9F), \fBdrv_usecwait\fR(9F)
65 .sp
66 .LP
67 \fIWriting Device Drivers\fR