Print this page
re #13613 rb4516 Tunables needs volatile keyword


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   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 (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.

  23  */
  24 
  25 #ifndef _SYS_MODCTL_H
  26 #define _SYS_MODCTL_H
  27 
  28 /*
  29  * loadable module support.
  30  */
  31 
  32 #include <sys/types.h>
  33 #include <sys/ioccom.h>
  34 #include <sys/nexusdefs.h>
  35 #include <sys/thread.h>
  36 #include <sys/t_lock.h>
  37 #include <sys/dditypes.h>
  38 #include <sys/hwconf.h>
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif


 530 
 531 #define MOD_NOAUTOUNLOAD        0x1     /* Auto mod-unloader skips this mod */
 532 #define MOD_NONOTIFY            0x2     /* No krtld notifications on (un)load */
 533 #define MOD_NOUNLOAD            0x4     /* Assume EBUSY for all _fini's */
 534 
 535 
 536 #ifdef _KERNEL
 537 
 538 #define MOD_BIND_HASHSIZE       64
 539 #define MOD_BIND_HASHMASK       (MOD_BIND_HASHSIZE-1)
 540 
 541 typedef int modid_t;
 542 
 543 /*
 544  * global function and data declarations
 545  */
 546 extern kmutex_t mod_lock;
 547 
 548 extern char *systemfile;
 549 extern char **syscallnames;
 550 extern int moddebug;
 551 
 552 /*
 553  * this is the head of a doubly linked list.  Only the next and prev
 554  * pointers are used
 555  */
 556 extern modctl_t modules;
 557 
 558 extern int modload_qualified(const char *,
 559     const char *, const char *, const char *, uint_t[], int, int *);
 560 
 561 extern void     mod_setup(void);
 562 extern int      modload(const char *, const char *);
 563 extern int      modloadonly(const char *, const char *);
 564 extern int      modunload(int);
 565 extern int      mod_hold_stub(struct mod_stub_info *);
 566 extern void     modunload_disable(void);
 567 extern void     modunload_enable(void);
 568 extern void     modunload_begin(void);
 569 extern void     modunload_end(void);
 570 extern int      mod_remove_by_name(char *);




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   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 (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 
  26 #ifndef _SYS_MODCTL_H
  27 #define _SYS_MODCTL_H
  28 
  29 /*
  30  * loadable module support.
  31  */
  32 
  33 #include <sys/types.h>
  34 #include <sys/ioccom.h>
  35 #include <sys/nexusdefs.h>
  36 #include <sys/thread.h>
  37 #include <sys/t_lock.h>
  38 #include <sys/dditypes.h>
  39 #include <sys/hwconf.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif


 531 
 532 #define MOD_NOAUTOUNLOAD        0x1     /* Auto mod-unloader skips this mod */
 533 #define MOD_NONOTIFY            0x2     /* No krtld notifications on (un)load */
 534 #define MOD_NOUNLOAD            0x4     /* Assume EBUSY for all _fini's */
 535 
 536 
 537 #ifdef _KERNEL
 538 
 539 #define MOD_BIND_HASHSIZE       64
 540 #define MOD_BIND_HASHMASK       (MOD_BIND_HASHSIZE-1)
 541 
 542 typedef int modid_t;
 543 
 544 /*
 545  * global function and data declarations
 546  */
 547 extern kmutex_t mod_lock;
 548 
 549 extern char *systemfile;
 550 extern char **syscallnames;
 551 extern volatile int moddebug;
 552 
 553 /*
 554  * this is the head of a doubly linked list.  Only the next and prev
 555  * pointers are used
 556  */
 557 extern modctl_t modules;
 558 
 559 extern int modload_qualified(const char *,
 560     const char *, const char *, const char *, uint_t[], int, int *);
 561 
 562 extern void     mod_setup(void);
 563 extern int      modload(const char *, const char *);
 564 extern int      modloadonly(const char *, const char *);
 565 extern int      modunload(int);
 566 extern int      mod_hold_stub(struct mod_stub_info *);
 567 extern void     modunload_disable(void);
 568 extern void     modunload_enable(void);
 569 extern void     modunload_begin(void);
 570 extern void     modunload_end(void);
 571 extern int      mod_remove_by_name(char *);