1*fc9073f9Stsutsui /* $NetBSD: vmparam.h,v 1.19 2020/02/01 19:41:49 tsutsui Exp $ */ 2e047259aSdrochner 3e047259aSdrochner /* 49b6bd2d9Srmind * Copyright (c) 1988 University of Utah. 5e047259aSdrochner * Copyright (c) 1982, 1986, 1990, 1993 6e047259aSdrochner * The Regents of the University of California. All rights reserved. 7e047259aSdrochner * 8e047259aSdrochner * This code is derived from software contributed to Berkeley by 9e047259aSdrochner * the Systems Programming Group of the University of Utah Computer 10e047259aSdrochner * Science Department. 11e047259aSdrochner * 12e047259aSdrochner * Redistribution and use in source and binary forms, with or without 13e047259aSdrochner * modification, are permitted provided that the following conditions 14e047259aSdrochner * are met: 15e047259aSdrochner * 1. Redistributions of source code must retain the above copyright 16e047259aSdrochner * notice, this list of conditions and the following disclaimer. 17e047259aSdrochner * 2. Redistributions in binary form must reproduce the above copyright 18e047259aSdrochner * notice, this list of conditions and the following disclaimer in the 19e047259aSdrochner * documentation and/or other materials provided with the distribution. 20aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 21aad01611Sagc * may be used to endorse or promote products derived from this software 22aad01611Sagc * without specific prior written permission. 23aad01611Sagc * 24aad01611Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25aad01611Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26aad01611Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27aad01611Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28aad01611Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29aad01611Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30aad01611Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31aad01611Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32aad01611Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33aad01611Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34aad01611Sagc * SUCH DAMAGE. 35aad01611Sagc * 36aad01611Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 37aad01611Sagc * 38aad01611Sagc * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 39aad01611Sagc */ 40e047259aSdrochner 41e047259aSdrochner #ifndef _MACHINE_VMPARAM_H_ 42e047259aSdrochner #define _MACHINE_VMPARAM_H_ 43e047259aSdrochner 44e047259aSdrochner /* 45e047259aSdrochner * Machine dependent constants for cesfic 46e047259aSdrochner */ 47e047259aSdrochner 48e047259aSdrochner /* 49*fc9073f9Stsutsui * Use common m68k definitions to define PAGE_SIZE and related constants. 50e047259aSdrochner */ 51*fc9073f9Stsutsui #include <m68k/vmparam.h> 52e047259aSdrochner 53e047259aSdrochner /* 5478ea2dd3Sthorpej * USRSTACK is the top (end) of the user stack. 55e047259aSdrochner * 56e047259aSdrochner * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3) 57e047259aSdrochner * is for HPUX compatibility. Why?? Because HPUX's debuggers 58e047259aSdrochner * have the user's stack hard-wired at FFF00000 for post-mortems, 59e047259aSdrochner * and we must be compatible... 60e047259aSdrochner */ 61cc2c493bSthorpej #define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ 62e047259aSdrochner #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ 63e047259aSdrochner #define P1PAGES 0x100000 64cc2c493bSthorpej #define HIGHPAGES (0x100000/PAGE_SIZE) 65e047259aSdrochner 66e047259aSdrochner /* 67e047259aSdrochner * Virtual memory related constants, all in bytes 68e047259aSdrochner */ 69e047259aSdrochner #ifndef MAXTSIZ 709e3d987aSrin #define MAXTSIZ (32*1024*1024) /* max text size */ 71e047259aSdrochner #endif 72e047259aSdrochner #ifndef DFLDSIZ 73e047259aSdrochner #define DFLDSIZ (32*1024*1024) /* initial data size limit */ 74e047259aSdrochner #endif 75e047259aSdrochner #ifndef MAXDSIZ 76e047259aSdrochner #define MAXDSIZ (64*1024*1024) /* max data size */ 77e047259aSdrochner #endif 78e047259aSdrochner #ifndef DFLSSIZ 79e047259aSdrochner #define DFLSSIZ (512*1024) /* initial stack size limit */ 80e047259aSdrochner #endif 81e047259aSdrochner #ifndef MAXSSIZ 82e047259aSdrochner #define MAXSSIZ MAXDSIZ /* max stack size */ 83e047259aSdrochner #endif 84e047259aSdrochner 85e047259aSdrochner /* 86e047259aSdrochner * Default sizes of swap allocation chunks (see dmap.h). 87e047259aSdrochner * The actual values may be changed in vminit() based on MAXDSIZ. 88e047259aSdrochner * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024. 89e047259aSdrochner * DMMIN should be at least ctod(1) so that vtod() works. 90e047259aSdrochner * vminit() insures this. 91e047259aSdrochner */ 92e047259aSdrochner #define DMMIN 32 /* smallest swap allocation */ 93e047259aSdrochner #define DMMAX 4096 /* largest potential swap allocation */ 94e047259aSdrochner 95e047259aSdrochner /* 96e047259aSdrochner * PTEs for mapping user space into the kernel for phyio operations. 97e047259aSdrochner * One page is enough to handle 4Mb of simultaneous raw IO operations. 98e047259aSdrochner */ 99e047259aSdrochner #ifndef USRIOSIZE 100e047259aSdrochner #define USRIOSIZE (1 * NPTEPG) /* 4mb */ 101e047259aSdrochner #endif 102e047259aSdrochner 103e047259aSdrochner /* 104e047259aSdrochner * Mach derived constants 105e047259aSdrochner */ 106e047259aSdrochner 107e047259aSdrochner /* user/kernel map constants */ 10835f2b913Sdrochner #define VM_MIN_ADDRESS ((vaddr_t)0) 10935f2b913Sdrochner #define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000) 11035f2b913Sdrochner #define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 11135f2b913Sdrochner #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0x00002000) 1126b2d8b66Syamt #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE*NPTEPG*2)) 113e047259aSdrochner 114e047259aSdrochner /* virtual sizes (bytes) for various kernel submaps */ 115cc2c493bSthorpej #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 116e047259aSdrochner 117e047259aSdrochner /* # of kernel PT pages (initial only, can grow dynamically) */ 1186eadace4Srin #define VM_KERNEL_PT_PAGES ((vsize_t)2) 119e047259aSdrochner 120e047259aSdrochner /* Use new VM page bootstrap interface. */ 121e047259aSdrochner #define MACHINE_NEW_NONCONTIG 122e047259aSdrochner 123e047259aSdrochner /* 124e047259aSdrochner * Constants which control the way the VM system deals with memory segments. 125e047259aSdrochner * The cesfic only has one usable physical memory segment. 126e047259aSdrochner */ 127e047259aSdrochner #define VM_PHYSSEG_MAX 1 128e047259aSdrochner #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 129e047259aSdrochner 130e047259aSdrochner #define VM_NFREELIST 1 131e047259aSdrochner #define VM_FREELIST_DEFAULT 0 132e047259aSdrochner 133e047259aSdrochner #define __HAVE_PMAP_PHYSSEG 134e047259aSdrochner 135e047259aSdrochner /* 136e047259aSdrochner * pmap-specific data stored in the vm_physmem[] array. 137e047259aSdrochner */ 138e047259aSdrochner struct pmap_physseg { 139b5fd5d57Sthorpej struct pv_header *pvheader; /* pv table for this seg */ 140e047259aSdrochner }; 141e047259aSdrochner 142e047259aSdrochner #endif /* _MACHINE_VMPARAM_H_ */ 143