vmparam.h revision 1.15
11.15Sthorpej/* $NetBSD: vmparam.h,v 1.15 2003/04/02 07:36:01 thorpej 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.7Sthorpej#ifdef _KERNEL 401.5Sthorpej 411.5Sthorpej#include <arm/arm32/vmparam.h> 421.1Smatt 431.1Smatt/* 441.1Smatt * Address space constants 451.1Smatt */ 461.1Smatt 471.1Smatt/* 481.1Smatt * The line between user space and kernel space 491.12Sthorpej * Mappings >= KERNEL_BASE are constant across all processes 501.1Smatt */ 511.12Sthorpej#define KERNEL_BASE 0xf0000000 521.1Smatt 531.1Smatt/* Various constants used by the MD code*/ 541.11Sthorpej#define KERNEL_TEXT_BASE (KERNEL_BASE + 0x0000c000) 551.11Sthorpej#define APTE_BASE (KERNEL_BASE + 0x00c00000) 561.11Sthorpej#define KERNEL_VM_BASE (KERNEL_BASE + 0x01000000) 571.1Smatt/* 581.1Smatt * The Kernel VM Size varies depending on the machine depending on how 591.1Smatt * much space is needed (and where) for other mappings. 601.1Smatt * In some cases the chosen value may not be the maximum in order that 611.1Smatt * we don't waste memory with kernel pages tables as we can't currently 621.1Smatt * grow the kernel page tables after booting. 631.1Smatt * You only need to increase these values if you find that the number of 641.1Smatt * buffers is being limited due to lack of VA space. 651.1Smatt */ 661.1Smatt/* 671.1Smatt * The range 0xf1000000 - 0xfcffffff is available for kernel VM space 681.1Smatt * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff 691.1Smatt */ 701.9Schris#define KERNEL_VM_SIZE 0x0C000000 711.1Smatt 721.1Smatt/* 731.1Smatt * Override the default pager_map size, there's not enough KVA. 741.1Smatt */ 751.1Smatt#define PAGER_MAP_SIZE (4 * 1024 * 1024) 761.1Smatt 771.1Smatt/* 781.1Smatt * Size of User Raw I/O map 791.1Smatt */ 801.1Smatt 811.1Smatt#define USRIOSIZE 300 821.1Smatt 831.1Smatt/* XXX max. amount of KVM to be used by buffers. */ 841.1Smatt#ifndef VM_MAX_KERNEL_BUF 851.1Smatt#define VM_MAX_KERNEL_BUF \ 861.9Schris ((KERNEL_VM_SIZE) * 4 / 10) 871.1Smatt#endif 881.1Smatt 891.1Smatt/* virtual sizes (bytes) for various kernel submaps */ 901.1Smatt 911.15Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 921.1Smatt 931.1Smatt/* 941.1Smatt * max number of non-contig chunks of physical RAM you can have 951.1Smatt */ 961.1Smatt 971.1Smatt#define VM_PHYSSEG_MAX 32 981.1Smatt 991.1Smatt/* 1001.1Smatt * when converting a physical address to a vm_page structure, we 1011.1Smatt * want to use a binary search on the chunks of physical memory 1021.1Smatt * to find our RAM 1031.1Smatt */ 1041.1Smatt 1051.1Smatt#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1061.1Smatt 1071.1Smatt/* 1081.1Smatt * this indicates that we can't add RAM to the VM system after the 1091.1Smatt * vm system is init'd. 1101.1Smatt */ 1111.1Smatt 1121.1Smatt#define VM_PHYSSEG_NOADD 1131.1Smatt 1141.1Smatt/* 1151.1Smatt * we support 2 free lists: 1161.1Smatt * 1171.1Smatt * - DEFAULT for all systems 1181.1Smatt * - ISADMA for the ISA DMA range on Sharks only 1191.1Smatt */ 1201.1Smatt 1211.1Smatt#define VM_NFREELIST 2 1221.1Smatt#define VM_FREELIST_DEFAULT 0 1231.1Smatt#define VM_FREELIST_ISADMA 1 1241.14Sthorpej 1251.14Sthorpej#endif /* _KERNEL */ 1261.1Smatt 1271.1Smatt#endif /* _ARM32_VMPARAM_H_ */ 128