Print this page
8627 want ddi_ffsll, ddi_flsll
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>

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 "Jun 5, 2013"
   7      -.SH NAME
   8      -ddi_ffs, ddi_fls \- find first (last) bit set in a long integer
   9      -.SH SYNOPSIS
  10      -.LP
  11      -.nf
  12      -#include <sys/conf.h>
  13      -#include <sys/ddi.h>
  14      -#include <sys/sunddi.h>
  15      -
  16      -
  17      -
  18      -\fBint\fR \fBddi_ffs\fR(\fBlong\fR \fImask\fR);
  19      -.fi
  20      -
  21      -.LP
  22      -.nf
  23      -\fBint\fR \fBddi_fls\fR(\fBlong\fR \fImask\fR);
  24      -.fi
  25      -
  26      -.SH INTERFACE LEVEL
  27      -.sp
  28      -.LP
        6 +.Dd July 14, 2017
        7 +.Dt DDI_FFS 9F
        8 +.Os
        9 +.Sh NAME
       10 +.Nm ddi_ffs, ddi_ffsll, ddi_fls, ddi_flsll
       11 +.Nd find first (last) bit set in a long (long) integer
       12 +.Sh SYNOPSIS
       13 +.In sys/conf.h
       14 +.In sys/ddi.h
       15 +.In sys/sunddi.h
       16 +.Ft int
       17 +.Fo "ddi_ffs"
       18 +.Fa "long mask"
       19 +.Fc
       20 +.Ft int
       21 +.Fo "ddi_fls"
       22 +.Fa "long mask"
       23 +.Fc
       24 +.Ft int
       25 +.Fo "ddi_ffs"
       26 +.Fa "long long mask"
       27 +.Fc
       28 +.Ft int
       29 +.Fo "ddi_fls"
       30 +.Fa "long long mask"
       31 +.Fc
       32 +.Sh INTERFACE LEVEL
  29   33  Solaris DDI specific (Solaris DDI).
  30      -.SH PARAMETERS
  31      -.sp
  32      -.ne 2
  33      -.na
  34      -\fB\fImask\fR\fR
  35      -.ad
  36      -.RS 8n
  37      -A 32-bit argument value to search through.
  38      -.RE
  39      -
  40      -.SH DESCRIPTION
  41      -.sp
  42      -.LP
  43      -The function \fBddi_ffs()\fR takes its argument and returns the shift count
  44      -that the first (least significant) bit set in the argument corresponds to. The
  45      -function \fBddi_fls()\fR does the same, only it returns the shift count for the
  46      -last (most significant) bit set in the argument.
  47      -.SH RETURN VALUES
  48      -.sp
  49      -.ne 2
  50      -.na
  51      -\fB\fB0\fR\fR
  52      -.ad
  53      -.RS 5n
       34 +.Sh PARAMETERS
       35 +.Bl -tag -width Va
       36 +.It Fa mask
       37 +A 32-bit or 64-bit argument value to search through.
       38 +.El
       39 +.Sh DESCRIPTION
       40 +The functions
       41 +.Fn ddi_ffs
       42 +and
       43 +.Fn ddi_ffsll
       44 +take their argument and return the shift count that the first (least
       45 +significant) bit set in the argument corresponds to.
       46 +The functions
       47 +.Fn ddi_fls
       48 +and
       49 +.Fn ddi_flsll
       50 +do the same, only they returns the shift count for the last (most
       51 +significant) bit set in the argument.
       52 +.Fn ddi_ffs
       53 +and
       54 +.Fn ddi_fls
       55 +operate on 32-bit values, while
       56 +.Fn ddi_ffsll
       57 +and
       58 +.Fn ddi_flsll
       59 +operate on 64-bit values.
       60 +.Sh CONTEXT
       61 +These functions can be called from user, interrupt, or kernel context.
       62 +.Sh RETURN VALUES
       63 +.Bl -tag -width Va
       64 +.It 0
  54   65  No bits are set in mask.
  55      -.RE
  56      -
  57      -.sp
  58      -.ne 2
  59      -.na
  60      -\fB\fIN\fR\fR
  61      -.ad
  62      -.RS 5n
  63      -Bit  \fIN\fR is the least significant (\fBddi_ffs\fR) or most significant
  64      -(\fBddi_fls\fR) bit set in mask. Bits are numbered from  \fB1\fR to  \fB32\fR,
  65      -with bit \fB1\fR being the least significant bit position and bit \fB32\fR the
  66      -most significant position.
  67      -.RE
  68      -
  69      -.SH CONTEXT
  70      -.sp
  71      -.LP
  72      -This function can be called from user, interrupt, or kernel context.
  73      -.SH SEE ALSO
  74      -.sp
  75      -.LP
       66 +.It N
       67 +Bit
       68 +.Em N
       69 +is the least significant
       70 +.Po
       71 +.Fn ddi_ffs ,
       72 +.Fn ddi_ffsll
       73 +.Pc
       74 +or most significant
       75 +.Po
       76 +.Fn ddi_fls ,
       77 +.Fn ddi_flsll
       78 +.Pc
       79 +bit set in
       80 +.Fa mask .
       81 +Bits are numbered from
       82 +.Em 1
       83 +to
       84 +.Em 32
       85 +or
       86 +.Em 64 ,
       87 +with bit
       88 +.Em 1
       89 +being the least significant bit position and bit
       90 +.Em 32
       91 +or
       92 +.Em 64
       93 +the most significant position, depending on the variant of the
       94 +functions used.
       95 +.El
       96 +.Sh SEE ALSO
  76   97  \fIWriting Device Drivers\fR
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX