Print this page
re #13613 rb4516 Tunables needs volatile keyword


   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */



  25 
  26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27 /*      All Rights Reserved   */
  28 
  29 /*
  30  * Portions of this source code were derived from Berkeley 4.3 BSD
  31  * under license from the Regents of the University of California.
  32  */
  33 
  34 /*
  35  * UNIX machine dependent virtual memory support.
  36  */
  37 
  38 #include <sys/vm.h>
  39 #include <sys/exec.h>
  40 #include <sys/cmn_err.h>
  41 #include <sys/cpu_module.h>
  42 #include <sys/cpu.h>
  43 #include <sys/elf_SPARC.h>
  44 #include <sys/archsystm.h>
  45 #include <vm/hat_sfmmu.h>
  46 #include <sys/memnode.h>
  47 #include <sys/mem_cage.h>
  48 #include <vm/vm_dep.h>
  49 #include <sys/random.h>
  50 
  51 #if defined(__sparcv9) && defined(SF_ERRATA_57)
  52 caddr_t errata57_limit;
  53 #endif
  54 
  55 uint_t page_colors = 0;
  56 uint_t page_colors_mask = 0;
  57 uint_t page_coloring_shift = 0;
  58 int consistent_coloring;
  59 int update_proc_pgcolorbase_after_fork = 0;
  60 
  61 uint_t mmu_page_sizes = DEFAULT_MMU_PAGE_SIZES;
  62 uint_t max_mmu_page_sizes = MMU_PAGE_SIZES;
  63 uint_t mmu_hashcnt = DEFAULT_MAX_HASHCNT;
  64 uint_t max_mmu_hashcnt = MAX_HASHCNT;
  65 size_t mmu_ism_pagesize = DEFAULT_ISM_PAGESIZE;
  66 
  67 /*
  68  * The sun4u hardware mapping sizes which will always be supported are
  69  * 8K, 64K, 512K and 4M.  If sun4u based machines need to support other
  70  * page sizes, platform or cpu specific routines need to modify the value.
  71  * The base pagesize (p_szc == 0) must always be supported by the hardware.
  72  */
  73 int mmu_exported_pagesize_mask = (1 << TTE8K) | (1 << TTE64K) |
  74         (1 << TTE512K) | (1 << TTE4M);
  75 uint_t mmu_exported_page_sizes;
  76 
  77 uint_t szc_2_userszc[MMU_PAGE_SIZES];
  78 uint_t userszc_2_szc[MMU_PAGE_SIZES];




   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  27  */
  28 
  29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  30 /*      All Rights Reserved   */
  31 
  32 /*
  33  * Portions of this source code were derived from Berkeley 4.3 BSD
  34  * under license from the Regents of the University of California.
  35  */
  36 
  37 /*
  38  * UNIX machine dependent virtual memory support.
  39  */
  40 
  41 #include <sys/vm.h>
  42 #include <sys/exec.h>
  43 #include <sys/cmn_err.h>
  44 #include <sys/cpu_module.h>
  45 #include <sys/cpu.h>
  46 #include <sys/elf_SPARC.h>
  47 #include <sys/archsystm.h>
  48 #include <vm/hat_sfmmu.h>
  49 #include <sys/memnode.h>
  50 #include <sys/mem_cage.h>
  51 #include <vm/vm_dep.h>
  52 #include <sys/random.h>
  53 
  54 #if defined(__sparcv9) && defined(SF_ERRATA_57)
  55 caddr_t errata57_limit;
  56 #endif
  57 
  58 uint_t page_colors = 0;
  59 uint_t page_colors_mask = 0;
  60 uint_t page_coloring_shift = 0;
  61 volatile int consistent_coloring;
  62 int update_proc_pgcolorbase_after_fork = 0;
  63 
  64 uint_t mmu_page_sizes = DEFAULT_MMU_PAGE_SIZES;
  65 uint_t max_mmu_page_sizes = MMU_PAGE_SIZES;
  66 uint_t mmu_hashcnt = DEFAULT_MAX_HASHCNT;
  67 uint_t max_mmu_hashcnt = MAX_HASHCNT;
  68 size_t mmu_ism_pagesize = DEFAULT_ISM_PAGESIZE;
  69 
  70 /*
  71  * The sun4u hardware mapping sizes which will always be supported are
  72  * 8K, 64K, 512K and 4M.  If sun4u based machines need to support other
  73  * page sizes, platform or cpu specific routines need to modify the value.
  74  * The base pagesize (p_szc == 0) must always be supported by the hardware.
  75  */
  76 int mmu_exported_pagesize_mask = (1 << TTE8K) | (1 << TTE64K) |
  77         (1 << TTE512K) | (1 << TTE4M);
  78 uint_t mmu_exported_page_sizes;
  79 
  80 uint_t szc_2_userszc[MMU_PAGE_SIZES];
  81 uint_t userszc_2_szc[MMU_PAGE_SIZES];