Print this page
10886 smatch debug macro cleanup in usr/src/uts


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 



  26 
  27 /*
  28  * bscv.c - multi-threaded lom driver for the Stiletto platform.
  29  */
  30 
  31 /*
  32  * Included files.
  33  */
  34 
  35 #include <sys/note.h>
  36 #include <sys/types.h>
  37 #include <sys/param.h>
  38 #include <sys/uio.h>
  39 #include <sys/open.h>
  40 #include <sys/cred.h>
  41 #include <sys/stream.h>
  42 #include <sys/systm.h>
  43 #include <sys/conf.h>
  44 #include <sys/reboot.h>
  45 #include <sys/modctl.h>


 387 #endif /* DEBUG */
 388 
 389 static struct modldrv modldrv = {
 390         &mod_driverops,
 391         BSCV_VERSION_STRING,
 392         &bscv_dev_ops,
 393 };
 394 
 395 static struct modlinkage modlinkage = {
 396         MODREV_1,
 397         &modldrv,
 398         NULL
 399 };
 400 
 401 #ifdef DEBUG
 402 /* Tracing is enabled if value is non-zero. */
 403 static int bscv_trace_flag = 1;
 404 
 405 #define BSCV_TRACE   if (bscv_trace_flag != 0)  bscv_trace
 406 #else
 407 #define BSCV_TRACE
 408 #endif
 409 
 410 /*
 411  * kernel accessible routines. These routines are necessarily global so the
 412  * driver can be loaded, and unloaded successfully
 413  */
 414 
 415 /*
 416  * function     - _init
 417  * description  - initializes the driver state structure and installs the
 418  *                driver module into the kernel
 419  * inputs       - none
 420  * outputs      - success or failure of module installation
 421  */
 422 
 423 int
 424 _init(void)
 425 {
 426         register int e;
 427 




   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright 2019 Joyent, Inc.
  28  */
  29 
  30 /*
  31  * bscv.c - multi-threaded lom driver for the Stiletto platform.
  32  */
  33 
  34 /*
  35  * Included files.
  36  */
  37 
  38 #include <sys/note.h>
  39 #include <sys/types.h>
  40 #include <sys/param.h>
  41 #include <sys/uio.h>
  42 #include <sys/open.h>
  43 #include <sys/cred.h>
  44 #include <sys/stream.h>
  45 #include <sys/systm.h>
  46 #include <sys/conf.h>
  47 #include <sys/reboot.h>
  48 #include <sys/modctl.h>


 390 #endif /* DEBUG */
 391 
 392 static struct modldrv modldrv = {
 393         &mod_driverops,
 394         BSCV_VERSION_STRING,
 395         &bscv_dev_ops,
 396 };
 397 
 398 static struct modlinkage modlinkage = {
 399         MODREV_1,
 400         &modldrv,
 401         NULL
 402 };
 403 
 404 #ifdef DEBUG
 405 /* Tracing is enabled if value is non-zero. */
 406 static int bscv_trace_flag = 1;
 407 
 408 #define BSCV_TRACE   if (bscv_trace_flag != 0)  bscv_trace
 409 #else
 410 #define BSCV_TRACE(...) (void)(0)
 411 #endif
 412 
 413 /*
 414  * kernel accessible routines. These routines are necessarily global so the
 415  * driver can be loaded, and unloaded successfully
 416  */
 417 
 418 /*
 419  * function     - _init
 420  * description  - initializes the driver state structure and installs the
 421  *                driver module into the kernel
 422  * inputs       - none
 423  * outputs      - success or failure of module installation
 424  */
 425 
 426 int
 427 _init(void)
 428 {
 429         register int e;
 430