vmparam.h revision 1.6
11.6Sthorpej/* $NetBSD: vmparam.h,v 1.6 2001/04/29 22:44:36 thorpej Exp $ */ 21.1Stsutsui 31.1Stsutsui/* 41.1Stsutsui * 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.1Stsutsui * 81.1Stsutsui * This code is derived from software contributed to Berkeley by 91.1Stsutsui * the Systems Programming Group of the University of Utah Computer 101.1Stsutsui * Science Department. 111.1Stsutsui * 121.1Stsutsui * Redistribution and use in source and binary forms, with or without 131.1Stsutsui * modification, are permitted provided that the following conditions 141.1Stsutsui * are met: 151.1Stsutsui * 1. Redistributions of source code must retain the above copyright 161.1Stsutsui * notice, this list of conditions and the following disclaimer. 171.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 181.1Stsutsui * notice, this list of conditions and the following disclaimer in the 191.1Stsutsui * documentation and/or other materials provided with the distribution. 201.1Stsutsui * 3. All advertising materials mentioning features or use of this software 211.1Stsutsui * must display the following acknowledgement: 221.1Stsutsui * This product includes software developed by the University of 231.1Stsutsui * California, Berkeley and its contributors. 241.1Stsutsui * 4. Neither the name of the University nor the names of its contributors 251.1Stsutsui * may be used to endorse or promote products derived from this software 261.1Stsutsui * without specific prior written permission. 271.1Stsutsui * 281.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Stsutsui * SUCH DAMAGE. 391.1Stsutsui * 401.1Stsutsui * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 411.1Stsutsui * 421.1Stsutsui * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 431.1Stsutsui */ 441.1Stsutsui 451.1Stsutsui#ifndef _NEWS68K_VMPARAM_H_ 461.1Stsutsui#define _NEWS68K_VMPARAM_H_ 471.1Stsutsui 481.1Stsutsui/* 491.1Stsutsui * Machine dependent constants for news68k 501.1Stsutsui */ 511.4Sthorpej 521.4Sthorpej/* 531.4Sthorpej * We use 4K pages on the news68k. Override the PAGE_* definitions 541.4Sthorpej * to be compile time constants. 551.4Sthorpej */ 561.4Sthorpej#define PAGE_SHIFT 12 571.4Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 581.4Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 591.1Stsutsui 601.1Stsutsui/* 611.1Stsutsui * USRTEXT is the start of the user text/data space, while USRSTACK 621.1Stsutsui * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are 631.1Stsutsui * the number of pages from the beginning of the P0 region to the 641.1Stsutsui * beginning of the text and from the beginning of the P1 region to the 651.1Stsutsui * beginning of the stack respectively. 661.1Stsutsui * 671.1Stsutsui * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3) 681.1Stsutsui * is for HPUX compatibility. Why?? Because HPUX's debuggers 691.1Stsutsui * have the user's stack hard-wired at FFF00000 for post-mortems, 701.1Stsutsui * and we must be compatible... 711.1Stsutsui */ 721.1Stsutsui#define USRTEXT 8192 /* Must equal __LDPGSZ */ 731.1Stsutsui#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ 741.1Stsutsui#define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ 751.1Stsutsui#define P1PAGES 0x100000 761.1Stsutsui#define LOWPAGES 0 771.1Stsutsui#define HIGHPAGES (0x100000/NBPG) 781.1Stsutsui 791.1Stsutsui/* 801.1Stsutsui * Virtual memory related constants, all in bytes 811.1Stsutsui */ 821.1Stsutsui#ifndef MAXTSIZ 831.1Stsutsui#define MAXTSIZ (8*1024*1024) /* max text size */ 841.1Stsutsui#endif 851.1Stsutsui#ifndef DFLDSIZ 861.1Stsutsui#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 871.1Stsutsui#endif 881.1Stsutsui#ifndef MAXDSIZ 891.1Stsutsui#define MAXDSIZ (64*1024*1024) /* max data size */ 901.1Stsutsui#endif 911.1Stsutsui#ifndef DFLSSIZ 921.1Stsutsui#define DFLSSIZ (512*1024) /* initial stack size limit */ 931.1Stsutsui#endif 941.1Stsutsui#ifndef MAXSSIZ 951.1Stsutsui#define MAXSSIZ MAXDSIZ /* max stack size */ 961.1Stsutsui#endif 971.1Stsutsui 981.1Stsutsui/* 991.1Stsutsui * Sizes of the system and user portions of the system page table. 1001.1Stsutsui */ 1011.1Stsutsui/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 1021.1Stsutsui#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 1031.1Stsutsui#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 1041.1Stsutsui 1051.1Stsutsui/* 1061.1Stsutsui * PTEs for mapping user space into the kernel for phyio operations. 1071.1Stsutsui * One page is enough to handle 4Mb of simultaneous raw IO operations. 1081.1Stsutsui */ 1091.1Stsutsui#ifndef USRIOSIZE 1101.1Stsutsui#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 1111.1Stsutsui#endif 1121.1Stsutsui 1131.1Stsutsui/* 1141.1Stsutsui * PTEs for system V style shared memory. 1151.1Stsutsui * This is basically slop for kmempt which we actually allocate (malloc) from. 1161.1Stsutsui */ 1171.1Stsutsui#ifndef SHMMAXPGS 1181.1Stsutsui#define SHMMAXPGS 1024 /* 4mb */ 1191.1Stsutsui#endif 1201.1Stsutsui 1211.1Stsutsui/* 1221.1Stsutsui * The time for a process to be blocked before being very swappable. 1231.1Stsutsui * This is a number of seconds which the system takes as being a non-trivial 1241.1Stsutsui * amount of real time. You probably shouldn't change this; 1251.1Stsutsui * it is used in subtle ways (fractions and multiples of it are, that is, like 1261.1Stsutsui * half of a ``long time'', almost a long time, etc.) 1271.1Stsutsui * It is related to human patience and other factors which don't really 1281.1Stsutsui * change over time. 1291.1Stsutsui */ 1301.1Stsutsui#define MAXSLP 20 1311.1Stsutsui 1321.1Stsutsui/* 1331.1Stsutsui * Mach derived constants 1341.1Stsutsui */ 1351.1Stsutsui 1361.1Stsutsui/* user/kernel map constants */ 1371.1Stsutsui#define VM_MIN_ADDRESS ((vaddr_t)0) 1381.1Stsutsui#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000) 1391.1Stsutsui#define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 1401.1Stsutsui#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1411.1Stsutsui#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) 1421.1Stsutsui 1431.1Stsutsui/* virtual sizes (bytes) for various kernel submaps */ 1441.1Stsutsui#define VM_PHYS_SIZE (USRIOSIZE*NBPG) 1451.1Stsutsui 1461.1Stsutsui/* # of kernel PT pages (initial only, can grow dynamically) */ 1471.1Stsutsui#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1481.1Stsutsui 1491.1Stsutsui/* 1501.1Stsutsui * Constants which control the way the VM system deals with memory segments. 1511.1Stsutsui * The news68k only has one physical memory segment? 1521.1Stsutsui */ 1531.1Stsutsui#define VM_PHYSSEG_MAX 1 1541.1Stsutsui#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1551.1Stsutsui#define VM_PHYSSEG_NOADD 1561.1Stsutsui 1571.1Stsutsui#define VM_NFREELIST 1 1581.1Stsutsui#define VM_FREELIST_DEFAULT 0 1591.6Sthorpej 1601.6Sthorpej#define VM_MDPAGE_MEMBERS /* XXX nothing yet */ 1611.6Sthorpej#define VM_MDPAGE_INIT(pg) /* XXX nothing yet */ 1621.6Sthorpej#define PMAP_PHYSSEG /* XXX for now */ 1631.1Stsutsui 1641.1Stsutsui/* 1651.1Stsutsui * pmap-specific data stored in the vm_physmem[] array. 1661.1Stsutsui */ 1671.1Stsutsuistruct pmap_physseg { 1681.1Stsutsui struct pv_entry *pvent; /* pv table for this seg */ 1691.1Stsutsui char *attrs; /* page attributes for this seg */ 1701.1Stsutsui}; 1711.1Stsutsui 1721.1Stsutsui#endif /* _NEWS68K_VMPARAM_H_ */ 173