Print this page
patch cstyle
patch sccs-keywords
patch SEGOP_SWAPOUT-delete

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/seg_kpm.c
          +++ new/usr/src/uts/common/vm/seg_kpm.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  /*
  30   28   * Kernel Physical Mapping (kpm) segment driver (segkpm).
  31   29   *
  32   30   * This driver delivers along with the hat_kpm* interfaces an alternative
  33   31   * mechanism for kernel mappings within the 64-bit Solaris operating system,
  34   32   * which allows the mapping of all physical memory into the kernel address
  35   33   * space at once. This is feasible in 64 bit kernels, e.g. for Ultrasparc II
  36   34   * and beyond processors, since the available VA range is much larger than
  37   35   * possible physical memory. Momentarily all physical memory is supported,
  38   36   * that is represented by the list of memory segments (memsegs).
↓ open down ↓ 75 lines elided ↑ open up ↑
 114  112  
 115  113  static struct seg_ops segkpm_ops = {
 116  114          SEGKPM_BADOP(int),      /* dup */
 117  115          SEGKPM_BADOP(int),      /* unmap */
 118  116          SEGKPM_BADOP(void),     /* free */
 119  117          segkpm_fault,
 120  118          SEGKPM_BADOP(int),      /* faulta */
 121  119          SEGKPM_BADOP(int),      /* setprot */
 122  120          SEGKPM_BADOP(int),      /* checkprot */
 123  121          SEGKPM_BADOP(int),      /* kluster */
 124      -        SEGKPM_BADOP(size_t),   /* swapout */
 125  122          SEGKPM_BADOP(int),      /* sync */
 126  123          SEGKPM_BADOP(size_t),   /* incore */
 127  124          SEGKPM_BADOP(int),      /* lockop */
 128  125          SEGKPM_BADOP(int),      /* getprot */
 129  126          SEGKPM_BADOP(u_offset_t), /* getoffset */
 130  127          SEGKPM_BADOP(int),      /* gettype */
 131  128          SEGKPM_BADOP(int),      /* getvp */
 132  129          SEGKPM_BADOP(int),      /* advise */
 133  130          segkpm_dump,            /* dump */
 134  131          SEGKPM_NOTSUP,          /* pagelock */
↓ open down ↓ 18 lines elided ↑ open up ↑
 153  150  int
 154  151  segkpm_create(struct seg *seg, void *argsp)
 155  152  {
 156  153          struct segkpm_data *skd;
 157  154          struct segkpm_crargs *b = (struct segkpm_crargs *)argsp;
 158  155          ushort_t *p;
 159  156          int i, j;
 160  157  
 161  158          ASSERT(seg->s_as && RW_WRITE_HELD(&seg->s_as->a_lock));
 162  159          ASSERT(btokpmp(seg->s_size) >= 1 &&
 163      -                kpmpageoff((uintptr_t)seg->s_base) == 0 &&
 164      -                kpmpageoff((uintptr_t)seg->s_base + seg->s_size) == 0);
      160 +            kpmpageoff((uintptr_t)seg->s_base) == 0 &&
      161 +            kpmpageoff((uintptr_t)seg->s_base + seg->s_size) == 0);
 165  162  
 166  163          skd = kmem_zalloc(sizeof (struct segkpm_data), KM_SLEEP);
 167  164  
 168  165          seg->s_data = (void *)skd;
 169  166          seg->s_ops = &segkpm_ops;
 170  167          skd->skd_prot = b->prot;
 171  168  
 172  169          /*
 173  170           * (1) Segkpm virtual addresses are based on physical adresses.
 174  171           * From this and in opposite to other segment drivers it is
↓ open down ↓ 11 lines elided ↑ open up ↑
 186  183           * the abilities of (2), especially to utilize the cache
 187  184           * hierarchy (3) and to avoid VAC alias conflicts (4) the
 188  185           * selection has to be done carefully. For each virtual color
 189  186           * a separate counter is provided (4). The count values are
 190  187           * used for the utilization of all cache lines (3) and are
 191  188           * corresponding to the cache bins.
 192  189           */
 193  190          skd->skd_nvcolors = b->nvcolors;
 194  191  
 195  192          p = skd->skd_va_select =
 196      -                kmem_zalloc(NCPU * b->nvcolors * sizeof (ushort_t), KM_SLEEP);
      193 +            kmem_zalloc(NCPU * b->nvcolors * sizeof (ushort_t), KM_SLEEP);
 197  194  
 198  195          for (i = 0; i < NCPU; i++)
 199  196                  for (j = 0; j < b->nvcolors; j++, p++)
 200  197                          *p = j;
 201  198  
 202  199          return (0);
 203  200  }
 204  201  
 205  202  /*
 206  203   * This routine is called via a machine specific fault handling
↓ open down ↓ 136 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX