vmparam.h revision 246204
1129198Scognet/* $NetBSD: vmparam.h,v 1.26 2003/08/07 16:27:47 agc Exp $ */ 2129198Scognet 3139735Simp/*- 4129198Scognet * Copyright (c) 1988 The Regents of the University of California. 5129198Scognet * All rights reserved. 6129198Scognet * 7129198Scognet * Redistribution and use in source and binary forms, with or without 8129198Scognet * modification, are permitted provided that the following conditions 9129198Scognet * are met: 10129198Scognet * 1. Redistributions of source code must retain the above copyright 11129198Scognet * notice, this list of conditions and the following disclaimer. 12129198Scognet * 2. Redistributions in binary form must reproduce the above copyright 13129198Scognet * notice, this list of conditions and the following disclaimer in the 14129198Scognet * documentation and/or other materials provided with the distribution. 15129198Scognet * 3. Neither the name of the University nor the names of its contributors 16129198Scognet * may be used to endorse or promote products derived from this software 17129198Scognet * without specific prior written permission. 18129198Scognet * 19129198Scognet * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20129198Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21129198Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22129198Scognet * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23129198Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24129198Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25129198Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29129198Scognet * SUCH DAMAGE. 30129198Scognet * 31129198Scognet * $FreeBSD: head/sys/arm/include/vmparam.h 246204 2013-02-01 10:26:31Z andre $ 32129198Scognet */ 33129198Scognet 34129198Scognet#ifndef _MACHINE_VMPARAM_H_ 35129198Scognet#define _MACHINE_VMPARAM_H_ 36129198Scognet 37129198Scognet 38129198Scognet/*#include <arm/arm32/vmparam.h> 39129198Scognet*/ 40129198Scognet/* 41129198Scognet * Address space constants 42129198Scognet */ 43129198Scognet 44129198Scognet/* 45129198Scognet * The line between user space and kernel space 46129198Scognet * Mappings >= KERNEL_BASE are constant across all processes 47129198Scognet */ 48129198Scognet#define KERNBASE 0xc0000000 49129198Scognet 50129198Scognet/* 51129198Scognet * max number of non-contig chunks of physical RAM you can have 52129198Scognet */ 53129198Scognet 54129198Scognet#define VM_PHYSSEG_MAX 32 55129198Scognet 56129198Scognet/* 57169291Salc * The physical address space is densely populated. 58169291Salc */ 59169291Salc#define VM_PHYSSEG_DENSE 60169291Salc 61169291Salc/* 62172317Salc * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool 63170277Salc * from which physical pages are allocated and VM_FREEPOOL_DIRECT is 64170277Salc * the pool from which physical pages for small UMA objects are 65170277Salc * allocated. 66170277Salc */ 67172317Salc#define VM_NFREEPOOL 3 68172317Salc#define VM_FREEPOOL_CACHE 2 69170277Salc#define VM_FREEPOOL_DEFAULT 0 70170277Salc#define VM_FREEPOOL_DIRECT 1 71170277Salc 72170277Salc/* 73129198Scognet * we support 2 free lists: 74129198Scognet * 75129198Scognet * - DEFAULT for all systems 76129198Scognet * - ISADMA for the ISA DMA range on Sharks only 77129198Scognet */ 78129198Scognet 79129198Scognet#define VM_NFREELIST 2 80129198Scognet#define VM_FREELIST_DEFAULT 0 81129198Scognet#define VM_FREELIST_ISADMA 1 82129198Scognet 83170277Salc/* 84170277Salc * The largest allocation size is 1MB. 85170277Salc */ 86170277Salc#define VM_NFREEORDER 9 87170277Salc 88174938Salc/* 89210550Sjhb * Only one memory domain. 90210550Sjhb */ 91210550Sjhb#ifndef VM_NDOMAIN 92210550Sjhb#define VM_NDOMAIN 1 93210550Sjhb#endif 94210550Sjhb 95210550Sjhb/* 96174938Salc * Disable superpage reservations. 97174938Salc */ 98174938Salc#ifndef VM_NRESERVLEVEL 99174938Salc#define VM_NRESERVLEVEL 0 100174938Salc#endif 101174938Salc 102129198Scognet#define UPT_MAX_ADDRESS VADDR(UPTPTDI + 3, 0) 103129198Scognet#define UPT_MIN_ADDRESS VADDR(UPTPTDI, 0) 104129198Scognet 105129198Scognet#define VM_MIN_ADDRESS (0x00001000) 106161105Scognet#ifdef ARM_USE_SMALL_ALLOC 107236992Simp/* 108187592Scognet * ARM_KERN_DIRECTMAP is used to make sure there's enough space between 109187592Scognet * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory. 110187592Scognet * It has to be a compile-time constant, even if arm_init_smallalloc(), 111187592Scognet * which will do the mapping, gets the real amount of memory at runtime, 112187592Scognet * because VM_MAXUSER_ADDRESS is a constant. 113187592Scognet */ 114161105Scognet#ifndef ARM_KERN_DIRECTMAP 115161105Scognet#define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */ 116161105Scognet#endif 117161105Scognet#define VM_MAXUSER_ADDRESS KERNBASE - ARM_KERN_DIRECTMAP 118161105Scognet#else /* ARM_USE_SMALL_ALLOC */ 119239268Sgonzo#ifndef VM_MAXUSER_ADDRESS 120129198Scognet#define VM_MAXUSER_ADDRESS KERNBASE 121239268Sgonzo#endif /* VM_MAXUSER_ADDRESS */ 122161105Scognet#endif /* ARM_USE_SMALL_ALLOC */ 123129198Scognet#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 124129198Scognet 125129198Scognet#define USRSTACK VM_MAXUSER_ADDRESS 126129198Scognet 127129198Scognet/* initial pagein size of beginning of executable file */ 128129198Scognet#ifndef VM_INITIAL_PAGEIN 129129198Scognet#define VM_INITIAL_PAGEIN 16 130129198Scognet#endif 131129198Scognet 132129198Scognet#ifndef VM_MIN_KERNEL_ADDRESS 133129198Scognet#define VM_MIN_KERNEL_ADDRESS KERNBASE 134129198Scognet#endif 135129198Scognet 136129198Scognet#define VM_MAX_KERNEL_ADDRESS 0xffffffff 137246204Sandre 138129198Scognet/* 139133011Scognet * Virtual size (bytes) for various kernel submaps. 140133011Scognet */ 141129198Scognet#ifndef VM_KMEM_SIZE 142246204Sandre#define VM_KMEM_SIZE (12*1024*1024) 143129198Scognet#endif 144246204Sandre#ifndef VM_KMEM_SIZE_SCALE 145246204Sandre#define VM_KMEM_SIZE_SCALE (2) 146246204Sandre#endif 147129198Scognet 148129198Scognet#define MAXTSIZ (16*1024*1024) 149225995Smarcel#ifndef DFLDSIZ 150129198Scognet#define DFLDSIZ (128*1024*1024) 151225995Smarcel#endif 152225995Smarcel#ifndef MAXDSIZ 153129198Scognet#define MAXDSIZ (512*1024*1024) 154225995Smarcel#endif 155225995Smarcel#ifndef DFLSSIZ 156129198Scognet#define DFLSSIZ (2*1024*1024) 157225995Smarcel#endif 158225995Smarcel#ifndef MAXSSIZ 159129198Scognet#define MAXSSIZ (8*1024*1024) 160225995Smarcel#endif 161225995Smarcel#ifndef SGROWSIZ 162129198Scognet#define SGROWSIZ (128*1024) 163225995Smarcel#endif 164129198Scognet 165147114Scognet#ifdef ARM_USE_SMALL_ALLOC 166147114Scognet#define UMA_MD_SMALL_ALLOC 167147114Scognet#endif /* ARM_USE_SMALL_ALLOC */ 168221855Smdf 169221855Smdf#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ 170221855Smdf 171129198Scognet#endif /* _MACHINE_VMPARAM_H_ */ 172