Print this page
OS-5223 removed shm segment is no longer available
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/shm_impl.h
          +++ new/usr/src/uts/common/sys/shm_impl.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2016 Joyent, Inc.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_SHM_IMPL_H
  27   28  #define _SYS_SHM_IMPL_H
  28   29  
  29      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  30      -
  31   30  #include <sys/ipc_impl.h>
  32   31  #if defined(_KERNEL) || defined(_KMEMUSER)
  33   32  #include <sys/shm.h>
  34   33  #include <sys/avl.h>
  35   34  #include <sys/t_lock.h>
  36   35  #endif
  37   36  
  38   37  #ifdef  __cplusplus
  39   38  extern "C" {
  40   39  #endif
↓ open down ↓ 22 lines elided ↑ open up ↑
  63   62                                          /* Therefore, protects p_lckcnt for */
  64   63                                          /* pages that back shm */
  65   64          pid_t           shm_lpid;       /* pid of last shmop */
  66   65          pid_t           shm_cpid;       /* pid of creator */
  67   66          ulong_t         shm_ismattch;   /* number of ISM attaches */
  68   67          time_t          shm_atime;      /* last shmat time */
  69   68          time_t          shm_dtime;      /* last shmdt time */
  70   69          time_t          shm_ctime;      /* last change time */
  71   70          struct sptinfo  *shm_sptinfo;   /* info about ISM segment */
  72   71          struct seg      *shm_sptseg;    /* pointer to ISM segment */
  73      -        long            shm_sptprot;    /* was reserved (still a "long") */
       72 +        ulong_t         shm_opts;
       73 +                                        /*
       74 +                                         * Composed of: sptprot (uchar_t) and
       75 +                                         * RM_PENDING flag (1 bit).
       76 +                                         */
  74   77  } kshmid_t;
  75   78  
  76   79  /*
  77   80   *      Segacct Flags.
  78   81   */
  79   82  #define SHMSA_ISM       1       /* uses shared page table */
  80   83  
       84 +/*
       85 + * shm_opts definitions
       86 + * Low byte in shm_opts is used for sptprot (see PROT_ALL). The upper bits are
       87 + * used for additional options.
       88 + */
       89 +#define SHM_PROT_MASK   0xff
       90 +#define SHM_RM_PENDING  0x100
       91 +
  81   92  typedef struct sptinfo {
  82   93          struct as       *sptas;         /* dummy as ptr. for spt segment */
  83   94  } sptinfo_t;
  84   95  
  85   96  /*
  86   97   * Protected by p->p_lock
  87   98   */
  88   99  typedef struct segacct {
  89  100          avl_node_t      sa_tree;
  90  101          caddr_t         sa_addr;
↓ open down ↓ 46 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX