vmparam.h revision 216589
1/*- 2 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 3 * Copyright (C) 1995, 1996 TooLs GmbH. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by TooLs GmbH. 17 * 4. The name of TooLs GmbH may not be used to endorse or promote products 18 * derived from this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * 31 * $NetBSD: vmparam.h,v 1.11 2000/02/11 19:25:16 thorpej Exp $ 32 * $FreeBSD: head/sys/powerpc/include/vmparam.h 216589 2010-12-20 14:25:01Z nwhitehorn $ 33 */ 34 35#ifndef _MACHINE_VMPARAM_H_ 36#define _MACHINE_VMPARAM_H_ 37 38#define USRSTACK VM_MAXUSER_ADDRESS 39 40#ifndef MAXTSIZ 41#define MAXTSIZ (64*1024*1024) /* max text size */ 42#endif 43 44#ifndef DFLDSIZ 45#define DFLDSIZ (128*1024*1024) /* default data size */ 46#endif 47 48#ifndef MAXDSIZ 49#define MAXDSIZ (1*1024*1024*1024) /* max data size */ 50#endif 51 52#ifndef DFLSSIZ 53#define DFLSSIZ (8*1024*1024) /* default stack size */ 54#endif 55 56#ifndef MAXSSIZ 57#define MAXSSIZ (64*1024*1024) /* max stack size */ 58#endif 59 60/* 61 * The time for a process to be blocked before being very swappable. 62 * This is a number of seconds which the system takes as being a non-trivial 63 * amount of real time. You probably shouldn't change this; 64 * it is used in subtle ways (fractions and multiples of it are, that is, like 65 * half of a ``long time'', almost a long time, etc.) 66 * It is related to human patience and other factors which don't really 67 * change over time. 68 */ 69#define MAXSLP 20 70 71/* 72 * Would like to have MAX addresses = 0, but this doesn't (currently) work 73 */ 74#if !defined(LOCORE) 75#ifdef __powerpc64__ 76#define VM_MIN_ADDRESS (0x0000000000000000UL) 77#define VM_MAXUSER_ADDRESS (0x7ffffffffffff000UL) 78#define VM_MAX_ADDRESS (0xffffffffffffffffUL) 79#else 80#define VM_MIN_ADDRESS ((vm_offset_t)0) 81#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x7ffff000) 82#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 83#endif 84#else /* LOCORE */ 85#ifndef __powerpc64__ 86#define VM_MIN_ADDRESS 0 87#define VM_MAXUSER_ADDRESS 0x7ffff000 88#endif 89#endif /* LOCORE */ 90 91#define FREEBSD32_USRSTACK 0x7ffff000 92 93 94#ifdef AIM 95#define KERNBASE 0x00100000UL /* start of kernel virtual */ 96 97#ifdef __powerpc64__ 98#define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL 99#define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL 100#define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS 101#else 102#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) 103#define VM_MAX_SAFE_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH -1) 104#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 3*SEGMENT_LENGTH - 1) 105#endif 106 107/* 108 * Use the direct-mapped BAT registers for UMA small allocs. This 109 * takes pressure off the small amount of available KVA. 110 */ 111#define UMA_MD_SMALL_ALLOC 112 113#else /* Book-E */ 114 115/* 116 * Kernel CCSRBAR location. We make this the reset location. 117 */ 118#define CCSRBAR_VA 0xfef00000 119#define CCSRBAR_SIZE 0x00100000 120 121#define KERNBASE 0xc0000000 /* start of kernel virtual */ 122 123#define VM_MIN_KERNEL_ADDRESS KERNBASE 124#define VM_MAX_KERNEL_ADDRESS 0xf8000000 125 126#endif /* AIM/E500 */ 127 128/* XXX max. amount of KVM to be used by buffers. */ 129#ifndef VM_MAX_KERNEL_BUF 130#define VM_MAX_KERNEL_BUF (SEGMENT_LENGTH * 7 / 10) 131#endif 132 133#if !defined(LOCORE) 134struct pmap_physseg { 135 struct pv_entry *pvent; 136 char *attrs; 137}; 138#endif 139 140#define VM_PHYSSEG_MAX 16 /* 1? */ 141 142/* 143 * The physical address space is densely populated on 32-bit systems, 144 * but may not be on 64-bit ones. 145 */ 146#ifdef __powerpc64__ 147#define VM_PHYSSEG_SPARSE 148#else 149#define VM_PHYSSEG_DENSE 150#endif 151 152/* 153 * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool 154 * from which physical pages are allocated and VM_FREEPOOL_DIRECT is 155 * the pool from which physical pages for small UMA objects are 156 * allocated. 157 */ 158#define VM_NFREEPOOL 3 159#define VM_FREEPOOL_CACHE 2 160#define VM_FREEPOOL_DEFAULT 0 161#define VM_FREEPOOL_DIRECT 1 162 163/* 164 * Create one free page list. 165 */ 166#define VM_NFREELIST 1 167#define VM_FREELIST_DEFAULT 0 168 169/* 170 * The largest allocation size is 4MB. 171 */ 172#define VM_NFREEORDER 11 173 174/* 175 * Only one memory domain. 176 */ 177#ifndef VM_NDOMAIN 178#define VM_NDOMAIN 1 179#endif 180 181/* 182 * Disable superpage reservations. 183 */ 184#ifndef VM_NRESERVLEVEL 185#define VM_NRESERVLEVEL 0 186#endif 187 188#ifndef VM_INITIAL_PAGEIN 189#define VM_INITIAL_PAGEIN 16 190#endif 191 192#ifndef SGROWSIZ 193#define SGROWSIZ (128UL*1024) /* amount to grow stack */ 194#endif 195 196#ifndef VM_KMEM_SIZE 197#define VM_KMEM_SIZE (12 * 1024 * 1024) 198#endif 199 200#ifdef __powerpc64__ 201#ifndef VM_KMEM_SIZE_SCALE 202#define VM_KMEM_SIZE_SCALE (3) 203#endif 204 205#ifndef VM_KMEM_SIZE_MAX 206#define VM_KMEM_SIZE_MAX 0x1c0000000 /* 7 GB */ 207#endif 208#endif 209 210#endif /* _MACHINE_VMPARAM_H_ */ 211