vmparam.h revision 1.19
11.19Stsutsui/* $NetBSD: vmparam.h,v 1.19 2014/07/26 12:48:07 tsutsui Exp $ */ 21.1Snisimura 31.1Snisimura/* 41.18Srmind * Copyright (c) 1988 University of Utah. 51.1Snisimura * Copyright (c) 1982, 1986, 1990, 1993 61.1Snisimura * The Regents of the University of California. All rights reserved. 71.9Sagc * 81.9Sagc * This code is derived from software contributed to Berkeley by 91.9Sagc * the Systems Programming Group of the University of Utah Computer 101.9Sagc * Science Department. 111.9Sagc * 121.9Sagc * Redistribution and use in source and binary forms, with or without 131.9Sagc * modification, are permitted provided that the following conditions 141.9Sagc * are met: 151.9Sagc * 1. Redistributions of source code must retain the above copyright 161.9Sagc * notice, this list of conditions and the following disclaimer. 171.9Sagc * 2. Redistributions in binary form must reproduce the above copyright 181.9Sagc * notice, this list of conditions and the following disclaimer in the 191.9Sagc * documentation and/or other materials provided with the distribution. 201.9Sagc * 3. Neither the name of the University nor the names of its contributors 211.9Sagc * may be used to endorse or promote products derived from this software 221.9Sagc * without specific prior written permission. 231.9Sagc * 241.9Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251.9Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261.9Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271.9Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281.9Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291.9Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301.9Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311.9Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321.9Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331.9Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341.9Sagc * SUCH DAMAGE. 351.9Sagc * 361.9Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 371.9Sagc * 381.9Sagc * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 391.9Sagc */ 401.1Snisimura 411.1Snisimura#ifndef _MACHINE_VMPARAM_H_ 421.1Snisimura#define _MACHINE_VMPARAM_H_ 431.7Sthorpej 441.7Sthorpej/* 451.14Stsutsui * We use 4K pages on the luna68k. Override the PAGE_* definitions 461.7Sthorpej * to be compile-time constants. 471.7Sthorpej */ 481.14Stsutsui#define PAGE_SHIFT PGSHIFT 491.7Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 501.7Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 511.1Snisimura 521.1Snisimura/* 531.6Sthorpej * USRSTACK is the top (end) of the user stack. 541.1Snisimura */ 551.1Snisimura#define USRSTACK VM_MAXUSER_ADDRESS 561.1Snisimura 571.1Snisimura/* 581.1Snisimura * Virtual memory related constants, all in bytes 591.1Snisimura */ 601.1Snisimura#ifndef MAXTSIZ 611.1Snisimura#define MAXTSIZ (8*1024*1024) /* max text size */ 621.1Snisimura#endif 631.1Snisimura#ifndef DFLDSIZ 641.1Snisimura#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 651.1Snisimura#endif 661.1Snisimura#ifndef MAXDSIZ 671.1Snisimura#define MAXDSIZ (64*1024*1024) /* max data size */ 681.1Snisimura#endif 691.1Snisimura#ifndef DFLSSIZ 701.1Snisimura#define DFLSSIZ (512*1024) /* initial stack size limit */ 711.1Snisimura#endif 721.1Snisimura#ifndef MAXSSIZ 731.1Snisimura#define MAXSSIZ MAXDSIZ /* max stack size */ 741.1Snisimura#endif 751.1Snisimura 761.1Snisimura/* 771.1Snisimura * Sizes of the system and user portions of the system page table. 781.1Snisimura */ 791.1Snisimura/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 801.1Snisimura#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 811.1Snisimura#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 821.1Snisimura 831.1Snisimura/* 841.1Snisimura * PTEs for mapping user space into the kernel for phyio operations. 851.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations. 861.1Snisimura */ 871.1Snisimura#ifndef USRIOSIZE 881.1Snisimura#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 891.1Snisimura#endif 901.1Snisimura 911.5Ssoren/* 921.5Ssoren * Mach derived constants 931.1Snisimura */ 941.1Snisimura 951.1Snisimura/* user/kernel map constants */ 961.1Snisimura#define VM_MIN_ADDRESS ((vaddr_t)0) 971.19Stsutsui#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000) 981.19Stsutsui#define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 991.1Snisimura#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1001.10Syamt#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0x40000000-PAGE_SIZE*NPTEPG)) 1011.1Snisimura 1021.1Snisimura/* virtual sizes (bytes) for various kernel submaps */ 1031.8Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 1041.1Snisimura 1051.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */ 1061.1Snisimura#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1071.1Snisimura 1081.1Snisimura/* 1091.1Snisimura * Constants which control the way the VM system deals with memory segments. 1101.1Snisimura * Only one physical contigous memory segment. 1111.1Snisimura */ 1121.1Snisimura#define VM_PHYSSEG_MAX 1 1131.1Snisimura#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1141.1Snisimura 1151.1Snisimura#define VM_NFREELIST 1 1161.1Snisimura#define VM_FREELIST_DEFAULT 0 1171.3Sthorpej 1181.4Sthorpej#define __HAVE_PMAP_PHYSSEG 1191.1Snisimura 1201.1Snisimura/* 1211.1Snisimura * pmap-specific data stored in the vm_physmem[] array. 1221.1Snisimura */ 1231.1Snisimurastruct pmap_physseg { 1241.13Sthorpej struct pv_header *pvheader; /* pv table for this seg */ 1251.1Snisimura}; 1261.1Snisimura 1271.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */ 128