vmparam.h revision 1.12
11.12Syamt/* $NetBSD: vmparam.h,v 1.12 2005/04/01 11:59:33 yamt Exp $ */ 21.1Stsutsui 31.1Stsutsui/* 41.1Stsutsui * Copyright (c) 1982, 1986, 1990, 1993 51.1Stsutsui * The Regents of the University of California. All rights reserved. 61.11Sagc * 71.11Sagc * This code is derived from software contributed to Berkeley by 81.11Sagc * the Systems Programming Group of the University of Utah Computer 91.11Sagc * Science Department. 101.11Sagc * 111.11Sagc * Redistribution and use in source and binary forms, with or without 121.11Sagc * modification, are permitted provided that the following conditions 131.11Sagc * are met: 141.11Sagc * 1. Redistributions of source code must retain the above copyright 151.11Sagc * notice, this list of conditions and the following disclaimer. 161.11Sagc * 2. Redistributions in binary form must reproduce the above copyright 171.11Sagc * notice, this list of conditions and the following disclaimer in the 181.11Sagc * documentation and/or other materials provided with the distribution. 191.11Sagc * 3. Neither the name of the University nor the names of its contributors 201.11Sagc * may be used to endorse or promote products derived from this software 211.11Sagc * without specific prior written permission. 221.11Sagc * 231.11Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.11Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.11Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.11Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.11Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.11Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.11Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.11Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.11Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.11Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.11Sagc * SUCH DAMAGE. 341.11Sagc * 351.11Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 361.11Sagc * 371.11Sagc * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 381.11Sagc */ 391.11Sagc/* 401.11Sagc * Copyright (c) 1988 University of Utah. 411.1Stsutsui * 421.1Stsutsui * This code is derived from software contributed to Berkeley by 431.1Stsutsui * the Systems Programming Group of the University of Utah Computer 441.1Stsutsui * Science Department. 451.1Stsutsui * 461.1Stsutsui * Redistribution and use in source and binary forms, with or without 471.1Stsutsui * modification, are permitted provided that the following conditions 481.1Stsutsui * are met: 491.1Stsutsui * 1. Redistributions of source code must retain the above copyright 501.1Stsutsui * notice, this list of conditions and the following disclaimer. 511.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 521.1Stsutsui * notice, this list of conditions and the following disclaimer in the 531.1Stsutsui * documentation and/or other materials provided with the distribution. 541.1Stsutsui * 3. All advertising materials mentioning features or use of this software 551.1Stsutsui * must display the following acknowledgement: 561.1Stsutsui * This product includes software developed by the University of 571.1Stsutsui * California, Berkeley and its contributors. 581.1Stsutsui * 4. Neither the name of the University nor the names of its contributors 591.1Stsutsui * may be used to endorse or promote products derived from this software 601.1Stsutsui * without specific prior written permission. 611.1Stsutsui * 621.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 631.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 641.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 651.1Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 661.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 671.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 681.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 691.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 701.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 711.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 721.1Stsutsui * SUCH DAMAGE. 731.1Stsutsui * 741.1Stsutsui * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 751.1Stsutsui * 761.1Stsutsui * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 771.1Stsutsui */ 781.1Stsutsui 791.1Stsutsui#ifndef _NEWS68K_VMPARAM_H_ 801.1Stsutsui#define _NEWS68K_VMPARAM_H_ 811.1Stsutsui 821.1Stsutsui/* 831.1Stsutsui * Machine dependent constants for news68k 841.1Stsutsui */ 851.4Sthorpej 861.4Sthorpej/* 871.4Sthorpej * We use 4K pages on the news68k. Override the PAGE_* definitions 881.4Sthorpej * to be compile time constants. 891.4Sthorpej */ 901.4Sthorpej#define PAGE_SHIFT 12 911.4Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 921.4Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 931.1Stsutsui 941.1Stsutsui/* 951.9Sthorpej * USRSTACK is the top (end) of the user stack. 961.1Stsutsui * 971.1Stsutsui * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3) 981.1Stsutsui * is for HPUX compatibility. Why?? Because HPUX's debuggers 991.1Stsutsui * have the user's stack hard-wired at FFF00000 for post-mortems, 1001.1Stsutsui * and we must be compatible... 1011.1Stsutsui */ 1021.10Sthorpej#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ 1031.1Stsutsui#define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ 1041.1Stsutsui#define P1PAGES 0x100000 1051.10Sthorpej#define HIGHPAGES (0x100000/PAGE_SIZE) 1061.1Stsutsui 1071.1Stsutsui/* 1081.1Stsutsui * Virtual memory related constants, all in bytes 1091.1Stsutsui */ 1101.1Stsutsui#ifndef MAXTSIZ 1111.1Stsutsui#define MAXTSIZ (8*1024*1024) /* max text size */ 1121.1Stsutsui#endif 1131.1Stsutsui#ifndef DFLDSIZ 1141.1Stsutsui#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 1151.1Stsutsui#endif 1161.1Stsutsui#ifndef MAXDSIZ 1171.1Stsutsui#define MAXDSIZ (64*1024*1024) /* max data size */ 1181.1Stsutsui#endif 1191.1Stsutsui#ifndef DFLSSIZ 1201.1Stsutsui#define DFLSSIZ (512*1024) /* initial stack size limit */ 1211.1Stsutsui#endif 1221.1Stsutsui#ifndef MAXSSIZ 1231.1Stsutsui#define MAXSSIZ MAXDSIZ /* max stack size */ 1241.1Stsutsui#endif 1251.1Stsutsui 1261.1Stsutsui/* 1271.1Stsutsui * Sizes of the system and user portions of the system page table. 1281.1Stsutsui */ 1291.1Stsutsui/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 1301.1Stsutsui#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 1311.1Stsutsui#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 1321.1Stsutsui 1331.1Stsutsui/* 1341.1Stsutsui * PTEs for mapping user space into the kernel for phyio operations. 1351.1Stsutsui * One page is enough to handle 4Mb of simultaneous raw IO operations. 1361.1Stsutsui */ 1371.1Stsutsui#ifndef USRIOSIZE 1381.1Stsutsui#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 1391.1Stsutsui#endif 1401.1Stsutsui 1411.1Stsutsui/* 1421.1Stsutsui * PTEs for system V style shared memory. 1431.1Stsutsui * This is basically slop for kmempt which we actually allocate (malloc) from. 1441.1Stsutsui */ 1451.1Stsutsui#ifndef SHMMAXPGS 1461.1Stsutsui#define SHMMAXPGS 1024 /* 4mb */ 1471.1Stsutsui#endif 1481.1Stsutsui 1491.1Stsutsui/* 1501.1Stsutsui * Mach derived constants 1511.1Stsutsui */ 1521.1Stsutsui 1531.1Stsutsui/* user/kernel map constants */ 1541.1Stsutsui#define VM_MIN_ADDRESS ((vaddr_t)0) 1551.1Stsutsui#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000) 1561.1Stsutsui#define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 1571.1Stsutsui#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1581.12Syamt#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE*NPTEPG)) 1591.1Stsutsui 1601.1Stsutsui/* virtual sizes (bytes) for various kernel submaps */ 1611.10Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 1621.1Stsutsui 1631.1Stsutsui/* # of kernel PT pages (initial only, can grow dynamically) */ 1641.1Stsutsui#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1651.1Stsutsui 1661.1Stsutsui/* 1671.1Stsutsui * Constants which control the way the VM system deals with memory segments. 1681.1Stsutsui * The news68k only has one physical memory segment? 1691.1Stsutsui */ 1701.1Stsutsui#define VM_PHYSSEG_MAX 1 1711.1Stsutsui#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1721.1Stsutsui#define VM_PHYSSEG_NOADD 1731.1Stsutsui 1741.1Stsutsui#define VM_NFREELIST 1 1751.1Stsutsui#define VM_FREELIST_DEFAULT 0 1761.6Sthorpej 1771.7Sthorpej#define __HAVE_PMAP_PHYSSEG 1781.1Stsutsui 1791.1Stsutsui/* 1801.1Stsutsui * pmap-specific data stored in the vm_physmem[] array. 1811.1Stsutsui */ 1821.1Stsutsuistruct pmap_physseg { 1831.1Stsutsui struct pv_entry *pvent; /* pv table for this seg */ 1841.1Stsutsui char *attrs; /* page attributes for this seg */ 1851.1Stsutsui}; 1861.1Stsutsui 1871.1Stsutsui#endif /* _NEWS68K_VMPARAM_H_ */ 188