Print this page
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ptms_conf.c
          +++ new/usr/src/uts/common/io/ptms_conf.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       27 + */
  25   28  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   29  /*
  29   30   * This file contains global data and code shared between master and slave parts
  30   31   * of the pseudo-terminal driver.
  31   32   *
  32   33   * Pseudo terminals (or pt's for short) are allocated dynamically.
  33   34   * pt's are put in the global ptms_slots array indexed by minor numbers.
  34   35   *
  35   36   * The slots array is initially small (of the size NPTY_MIN). When more pt's are
  36   37   * needed than the slot array size, the larger slot array is allocated and all
  37   38   * opened pt's move to the new one.
↓ open down ↓ 149 lines elided ↑ open up ↑
 187  188  #define NPTY_INITIAL 16
 188  189  
 189  190  #define NPTY_PERCENT 5
 190  191  
 191  192  /* Maximum increment of the slot table size */
 192  193  #define PTY_MAXDELTA 128
 193  194  
 194  195  /*
 195  196   * Tuneable variables.
 196  197   */
 197      -uint_t  pt_cnt = 0;                     /* Minimum number of ptys */
 198      -size_t  pt_max_pty = 0;                 /* Maximum number of ptys */
      198 +volatile uint_t pt_cnt = 0;             /* Minimum number of ptys */
      199 +volatile size_t pt_max_pty = 0;         /* Maximum number of ptys */
 199  200  uint_t  pt_init_cnt = NPTY_INITIAL;     /* Initial number of ptms slots */
 200      -uint_t  pt_pctofmem = NPTY_PERCENT;     /* Percent of memory to use for ptys */
      201 +volatile uint_t pt_pctofmem = NPTY_PERCENT;     /* Percent of memory to use */
      202 +                                                /* for ptys */
 201  203  uint_t  pt_maxdelta = PTY_MAXDELTA;     /* Max increment for slot table size */
 202  204  
 203  205  /* Other global variables */
 204  206  
 205  207  kmutex_t ptms_lock;                     /* Global data access lock */
 206  208  
 207  209  /*
 208  210   * Slot array and its management variables
 209  211   */
 210  212  static struct pt_ttys **ptms_slots = NULL; /* Slots for actual pt structures */
↓ open down ↓ 455 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX