vmparam.h revision 1.1
11.1Smatt/* $NetBSD: vmparam.h,v 1.1 2001/04/19 07:11:05 matt Exp $ */ 21.1Smatt 31.1Smatt/* 41.1Smatt * Copyright (c) 1988 The Regents of the University of California. 51.1Smatt * All rights reserved. 61.1Smatt * 71.1Smatt * Redistribution and use in source and binary forms, with or without 81.1Smatt * modification, are permitted provided that the following conditions 91.1Smatt * are met: 101.1Smatt * 1. Redistributions of source code must retain the above copyright 111.1Smatt * notice, this list of conditions and the following disclaimer. 121.1Smatt * 2. Redistributions in binary form must reproduce the above copyright 131.1Smatt * notice, this list of conditions and the following disclaimer in the 141.1Smatt * documentation and/or other materials provided with the distribution. 151.1Smatt * 3. All advertising materials mentioning features or use of this software 161.1Smatt * must display the following acknowledgement: 171.1Smatt * This product includes software developed by the University of 181.1Smatt * California, Berkeley and its contributors. 191.1Smatt * 4. Neither the name of the University nor the names of its contributors 201.1Smatt * may be used to endorse or promote products derived from this software 211.1Smatt * without specific prior written permission. 221.1Smatt * 231.1Smatt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.1Smatt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.1Smatt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.1Smatt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.1Smatt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.1Smatt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.1Smatt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.1Smatt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.1Smatt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.1Smatt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.1Smatt * SUCH DAMAGE. 341.1Smatt */ 351.1Smatt 361.1Smatt#ifndef _ARM32_VMPARAM_H_ 371.1Smatt#define _ARM32_VMPARAM_H_ 381.1Smatt 391.1Smatt/* for pt_entry_t definition */ 401.1Smatt#include <machine/pte.h> 411.1Smatt 421.1Smatt#define USRTEXT VM_MIN_ADDRESS 431.1Smatt#define USRSTACK VM_MAXUSER_ADDRESS 441.1Smatt 451.1Smatt/* 461.1Smatt * Note that MAXTSIZ mustn't be greater than 32M. Otherwise you'd have 471.1Smatt * to change the compiler to not generate bl instructions 481.1Smatt */ 491.1Smatt#define MAXTSIZ (16*1024*1024) /* max text size */ 501.1Smatt#ifndef DFLDSIZ 511.1Smatt#define DFLDSIZ (128*1024*1024) /* initial data size limit */ 521.1Smatt#endif 531.1Smatt#ifndef MAXDSIZ 541.1Smatt#define MAXDSIZ (512*1024*1024) /* max data size */ 551.1Smatt#endif 561.1Smatt#ifndef DFLSSIZ 571.1Smatt#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ 581.1Smatt#endif 591.1Smatt#ifndef MAXSSIZ 601.1Smatt#define MAXSSIZ (8*1024*1024) /* max stack size */ 611.1Smatt#endif 621.1Smatt 631.1Smatt/* 641.1Smatt * Size of shared memory map 651.1Smatt */ 661.1Smatt#ifndef SHMMAXPGS 671.1Smatt#define SHMMAXPGS 1024 681.1Smatt#endif 691.1Smatt 701.1Smatt/* 711.1Smatt * The time for a process to be blocked before being very swappable. 721.1Smatt * This is a number of seconds which the system takes as being a non-trivial 731.1Smatt * amount of real time. You probably shouldn't change this; 741.1Smatt * it is used in subtle ways (fractions and multiples of it are, that is, like 751.1Smatt * half of a `long time'', almost a long time, etc.) 761.1Smatt * It is related to human patience and other factors which don't really 771.1Smatt * change over time. 781.1Smatt */ 791.1Smatt#define MAXSLP 20 801.1Smatt 811.1Smatt/* 821.1Smatt * Address space constants 831.1Smatt */ 841.1Smatt 851.1Smatt/* 861.1Smatt * The line between user space and kernel space 871.1Smatt * Mappings >= KERNEL_SPACE_START are constant across all processes 881.1Smatt */ 891.1Smatt#define KERNEL_SPACE_START 0xf0000000 901.1Smatt 911.1Smatt/* total number of page table entries to map 4GB * size of each entry*/ 921.1Smatt#define PAGE_TABLE_SPACE ((1 << (32 - PGSHIFT)) * sizeof(pt_entry_t)) 931.1Smatt 941.1Smatt/* Address where the page tables are mapped */ 951.1Smatt#define PAGE_TABLE_SPACE_START (KERNEL_SPACE_START - PAGE_TABLE_SPACE) 961.1Smatt 971.1Smatt/* Various constants used by the MD code*/ 981.1Smatt#define KERNEL_BASE 0xf0000000 991.1Smatt#define KERNEL_TEXT_BASE (KERNEL_BASE + 0xc000) 1001.1Smatt#define ALT_PAGE_TBLS_BASE 0xf0c00000 1011.1Smatt#define KERNEL_VM_BASE 0xf1000000 1021.1Smatt/* 1031.1Smatt * The Kernel VM Size varies depending on the machine depending on how 1041.1Smatt * much space is needed (and where) for other mappings. 1051.1Smatt * In some cases the chosen value may not be the maximum in order that 1061.1Smatt * we don't waste memory with kernel pages tables as we can't currently 1071.1Smatt * grow the kernel page tables after booting. 1081.1Smatt * You only need to increase these values if you find that the number of 1091.1Smatt * buffers is being limited due to lack of VA space. 1101.1Smatt */ 1111.1Smatt/* 1121.1Smatt * The range 0xf1000000 - 0xfcffffff is available for kernel VM space 1131.1Smatt * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff 1141.1Smatt */ 1151.1Smatt#define KERNEL_VM_SIZE 0x06000000 1161.1Smatt#define PROCESS_PAGE_TBLS_BASE PAGE_TABLE_SPACE_START 1171.1Smatt 1181.1Smatt/* 1191.1Smatt * Override the default pager_map size, there's not enough KVA. 1201.1Smatt */ 1211.1Smatt#define PAGER_MAP_SIZE (4 * 1024 * 1024) 1221.1Smatt 1231.1Smatt/* 1241.1Smatt * Mach derived constants 1251.1Smatt */ 1261.1Smatt 1271.1Smatt#define VM_MIN_ADDRESS ((vm_offset_t)0x00001000) 1281.1Smatt#define VM_MAXUSER_ADDRESS ((vm_offset_t)(PAGE_TABLE_SPACE_START - UPAGES * NBPG)) 1291.1Smatt#define VM_MAX_ADDRESS ((vm_offset_t)(PAGE_TABLE_SPACE_START + (KERNEL_SPACE_START >> PGSHIFT) * sizeof(pt_entry_t))) 1301.1Smatt 1311.1Smatt#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_TEXT_BASE) 1321.1Smatt#define VM_MAXKERN_ADDRESS ((vm_offset_t)(KERNEL_VM_BASE + KERNEL_VM_SIZE)) 1331.1Smatt#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xffffffff) 1341.1Smatt 1351.1Smatt/* 1361.1Smatt * Size of User Raw I/O map 1371.1Smatt */ 1381.1Smatt 1391.1Smatt#define USRIOSIZE 300 1401.1Smatt 1411.1Smatt/* XXX max. amount of KVM to be used by buffers. */ 1421.1Smatt#ifndef VM_MAX_KERNEL_BUF 1431.1Smatt#define VM_MAX_KERNEL_BUF \ 1441.1Smatt ((VM_MAXKERN_ADDRESS - KERNEL_VM_BASE) * 4 / 10) 1451.1Smatt#endif 1461.1Smatt 1471.1Smatt/* virtual sizes (bytes) for various kernel submaps */ 1481.1Smatt 1491.1Smatt#define VM_PHYS_SIZE (USRIOSIZE*NBPG) 1501.1Smatt 1511.1Smatt/* 1521.1Smatt * max number of non-contig chunks of physical RAM you can have 1531.1Smatt */ 1541.1Smatt 1551.1Smatt#define VM_PHYSSEG_MAX 32 1561.1Smatt 1571.1Smatt/* 1581.1Smatt * when converting a physical address to a vm_page structure, we 1591.1Smatt * want to use a binary search on the chunks of physical memory 1601.1Smatt * to find our RAM 1611.1Smatt */ 1621.1Smatt 1631.1Smatt#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1641.1Smatt 1651.1Smatt/* 1661.1Smatt * this indicates that we can't add RAM to the VM system after the 1671.1Smatt * vm system is init'd. 1681.1Smatt */ 1691.1Smatt 1701.1Smatt#define VM_PHYSSEG_NOADD 1711.1Smatt 1721.1Smatt/* 1731.1Smatt * we support 2 free lists: 1741.1Smatt * 1751.1Smatt * - DEFAULT for all systems 1761.1Smatt * - ISADMA for the ISA DMA range on Sharks only 1771.1Smatt */ 1781.1Smatt 1791.1Smatt#define VM_NFREELIST 2 1801.1Smatt#define VM_FREELIST_DEFAULT 0 1811.1Smatt#define VM_FREELIST_ISADMA 1 1821.1Smatt 1831.1Smatt/* 1841.1Smatt * define structure pmap_physseg: there is one of these structures 1851.1Smatt * for each chunk of noncontig RAM you have. 1861.1Smatt */ 1871.1Smatt 1881.1Smattstruct pmap_physseg { 1891.1Smatt struct pv_entry *pvent; /* pv_entry array */ 1901.1Smatt char *attrs; /* attrs array */ 1911.1Smatt}; 1921.1Smatt 1931.1Smatt#endif /* _ARM32_VMPARAM_H_ */ 1941.1Smatt 1951.1Smatt/* End of vmparam.h */ 196