vmparam.h revision 1.18
11.18Srmind/* $NetBSD: vmparam.h,v 1.18 2011/02/08 20:20:20 rmind Exp $ */ 21.1Stsutsui 31.1Stsutsui/* 41.18Srmind * Copyright (c) 1988 University of Utah. 51.1Stsutsui * Copyright (c) 1982, 1986, 1990, 1993 61.1Stsutsui * The Regents of the University of California. All rights reserved. 71.11Sagc * 81.11Sagc * This code is derived from software contributed to Berkeley by 91.11Sagc * the Systems Programming Group of the University of Utah Computer 101.11Sagc * Science Department. 111.11Sagc * 121.11Sagc * Redistribution and use in source and binary forms, with or without 131.11Sagc * modification, are permitted provided that the following conditions 141.11Sagc * are met: 151.11Sagc * 1. Redistributions of source code must retain the above copyright 161.11Sagc * notice, this list of conditions and the following disclaimer. 171.11Sagc * 2. Redistributions in binary form must reproduce the above copyright 181.11Sagc * notice, this list of conditions and the following disclaimer in the 191.11Sagc * documentation and/or other materials provided with the distribution. 201.11Sagc * 3. Neither the name of the University nor the names of its contributors 211.11Sagc * may be used to endorse or promote products derived from this software 221.11Sagc * without specific prior written permission. 231.11Sagc * 241.11Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251.11Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261.11Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271.11Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281.11Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291.11Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301.11Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311.11Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321.11Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331.11Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341.11Sagc * SUCH DAMAGE. 351.11Sagc * 361.11Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 371.11Sagc * 381.11Sagc * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 391.11Sagc */ 401.1Stsutsui 411.1Stsutsui#ifndef _NEWS68K_VMPARAM_H_ 421.1Stsutsui#define _NEWS68K_VMPARAM_H_ 431.1Stsutsui 441.1Stsutsui/* 451.1Stsutsui * Machine dependent constants for news68k 461.1Stsutsui */ 471.4Sthorpej 481.4Sthorpej/* 491.4Sthorpej * We use 4K pages on the news68k. Override the PAGE_* definitions 501.4Sthorpej * to be compile time constants. 511.4Sthorpej */ 521.16Stsutsui#define PAGE_SHIFT PGSHIFT 531.4Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 541.4Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 551.1Stsutsui 561.1Stsutsui/* 571.9Sthorpej * USRSTACK is the top (end) of the user stack. 581.1Stsutsui * 591.1Stsutsui * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3) 601.1Stsutsui * is for HPUX compatibility. Why?? Because HPUX's debuggers 611.1Stsutsui * have the user's stack hard-wired at FFF00000 for post-mortems, 621.1Stsutsui * and we must be compatible... 631.1Stsutsui */ 641.10Sthorpej#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ 651.1Stsutsui#define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ 661.1Stsutsui#define P1PAGES 0x100000 671.10Sthorpej#define HIGHPAGES (0x100000/PAGE_SIZE) 681.1Stsutsui 691.1Stsutsui/* 701.1Stsutsui * Virtual memory related constants, all in bytes 711.1Stsutsui */ 721.1Stsutsui#ifndef MAXTSIZ 731.1Stsutsui#define MAXTSIZ (8*1024*1024) /* max text size */ 741.1Stsutsui#endif 751.1Stsutsui#ifndef DFLDSIZ 761.1Stsutsui#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 771.1Stsutsui#endif 781.1Stsutsui#ifndef MAXDSIZ 791.1Stsutsui#define MAXDSIZ (64*1024*1024) /* max data size */ 801.1Stsutsui#endif 811.1Stsutsui#ifndef DFLSSIZ 821.1Stsutsui#define DFLSSIZ (512*1024) /* initial stack size limit */ 831.1Stsutsui#endif 841.1Stsutsui#ifndef MAXSSIZ 851.1Stsutsui#define MAXSSIZ MAXDSIZ /* max stack size */ 861.1Stsutsui#endif 871.1Stsutsui 881.1Stsutsui/* 891.1Stsutsui * Sizes of the system and user portions of the system page table. 901.1Stsutsui */ 911.1Stsutsui/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 921.1Stsutsui#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 931.1Stsutsui#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 941.1Stsutsui 951.1Stsutsui/* 961.1Stsutsui * PTEs for mapping user space into the kernel for phyio operations. 971.1Stsutsui * One page is enough to handle 4Mb of simultaneous raw IO operations. 981.1Stsutsui */ 991.1Stsutsui#ifndef USRIOSIZE 1001.1Stsutsui#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 1011.1Stsutsui#endif 1021.1Stsutsui 1031.1Stsutsui/* 1041.1Stsutsui * Mach derived constants 1051.1Stsutsui */ 1061.1Stsutsui 1071.1Stsutsui/* user/kernel map constants */ 1081.1Stsutsui#define VM_MIN_ADDRESS ((vaddr_t)0) 1091.1Stsutsui#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000) 1101.1Stsutsui#define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 1111.1Stsutsui#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1121.12Syamt#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE*NPTEPG)) 1131.1Stsutsui 1141.1Stsutsui/* virtual sizes (bytes) for various kernel submaps */ 1151.10Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 1161.1Stsutsui 1171.1Stsutsui/* # of kernel PT pages (initial only, can grow dynamically) */ 1181.1Stsutsui#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1191.1Stsutsui 1201.1Stsutsui/* 1211.1Stsutsui * Constants which control the way the VM system deals with memory segments. 1221.1Stsutsui * The news68k only has one physical memory segment? 1231.1Stsutsui */ 1241.1Stsutsui#define VM_PHYSSEG_MAX 1 1251.1Stsutsui#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1261.1Stsutsui 1271.1Stsutsui#define VM_NFREELIST 1 1281.1Stsutsui#define VM_FREELIST_DEFAULT 0 1291.6Sthorpej 1301.7Sthorpej#define __HAVE_PMAP_PHYSSEG 1311.1Stsutsui 1321.1Stsutsui/* 1331.1Stsutsui * pmap-specific data stored in the vm_physmem[] array. 1341.1Stsutsui */ 1351.1Stsutsuistruct pmap_physseg { 1361.15Sthorpej struct pv_header *pvheader; /* pv table for this seg */ 1371.1Stsutsui}; 1381.1Stsutsui 1391.1Stsutsui#endif /* _NEWS68K_VMPARAM_H_ */ 140