Print this page
3799 ddi_ffs(9f): intddi_ffs
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man9f/ddi_ffs.9f
+++ new/usr/src/man/man9f/ddi_ffs.9f
1 1 '\" te
2 2 .\" Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" 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.
4 4 .\" 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.
5 5 .\" 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]
6 -.TH DDI_FFS 9F "Jan 16, 2006"
6 +.TH DDI_FFS 9F "Jun 5, 2013"
7 7 .SH NAME
8 8 ddi_ffs, ddi_fls \- find first (last) bit set in a long integer
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 #include <sys/conf.h>
13 13 #include <sys/ddi.h>
14 14 #include <sys/sunddi.h>
15 15
16 16
17 17
18 -\fBint\fR\fBddi_ffs\fR(\fBlong\fR \fImask\fR);
18 +\fBint\fR \fBddi_ffs\fR(\fBlong\fR \fImask\fR);
19 19 .fi
20 20
21 21 .LP
22 22 .nf
23 23 \fBint\fR \fBddi_fls\fR(\fBlong\fR \fImask\fR);
24 24 .fi
25 25
26 26 .SH INTERFACE LEVEL
27 27 .sp
28 28 .LP
29 29 Solaris DDI specific (Solaris DDI).
30 30 .SH PARAMETERS
31 31 .sp
32 32 .ne 2
33 33 .na
34 34 \fB\fImask\fR\fR
35 35 .ad
36 36 .RS 8n
37 37 A 32-bit argument value to search through.
38 38 .RE
39 39
40 40 .SH DESCRIPTION
41 41 .sp
42 42 .LP
43 43 The function \fBddi_ffs()\fR takes its argument and returns the shift count
44 44 that the first (least significant) bit set in the argument corresponds to. The
45 45 function \fBddi_fls()\fR does the same, only it returns the shift count for the
46 46 last (most significant) bit set in the argument.
47 47 .SH RETURN VALUES
48 48 .sp
49 49 .ne 2
50 50 .na
51 51 \fB\fB0\fR\fR
52 52 .ad
53 53 .RS 5n
54 54 No bits are set in mask.
55 55 .RE
56 56
57 57 .sp
58 58 .ne 2
59 59 .na
60 60 \fB\fIN\fR\fR
61 61 .ad
62 62 .RS 5n
63 63 Bit \fIN\fR is the least significant (\fBddi_ffs\fR) or most significant
64 64 (\fBddi_fls\fR) bit set in mask. Bits are numbered from \fB1\fR to \fB32\fR,
65 65 with bit \fB1\fR being the least significant bit position and bit \fB32\fR the
66 66 most significant position.
67 67 .RE
68 68
69 69 .SH CONTEXT
70 70 .sp
71 71 .LP
72 72 This function can be called from user, interrupt, or kernel context.
73 73 .SH SEE ALSO
74 74 .sp
75 75 .LP
76 76 \fIWriting Device Drivers\fR
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX