vmparam.h revision 1.8
11.8Sthorpej/* $NetBSD: vmparam.h,v 1.8 2003/04/02 07:36:00 thorpej Exp $ */ 21.1Snisimura 31.1Snisimura/* 41.1Snisimura * 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.1Snisimura * 81.1Snisimura * This code is derived from software contributed to Berkeley by 91.1Snisimura * the Systems Programming Group of the University of Utah Computer 101.1Snisimura * Science Department. 111.1Snisimura * 121.1Snisimura * Redistribution and use in source and binary forms, with or without 131.1Snisimura * modification, are permitted provided that the following conditions 141.1Snisimura * are met: 151.1Snisimura * 1. Redistributions of source code must retain the above copyright 161.1Snisimura * notice, this list of conditions and the following disclaimer. 171.1Snisimura * 2. Redistributions in binary form must reproduce the above copyright 181.1Snisimura * notice, this list of conditions and the following disclaimer in the 191.1Snisimura * documentation and/or other materials provided with the distribution. 201.1Snisimura * 3. All advertising materials mentioning features or use of this software 211.1Snisimura * must display the following acknowledgement: 221.1Snisimura * This product includes software developed by the University of 231.1Snisimura * California, Berkeley and its contributors. 241.1Snisimura * 4. Neither the name of the University nor the names of its contributors 251.1Snisimura * may be used to endorse or promote products derived from this software 261.1Snisimura * without specific prior written permission. 271.1Snisimura * 281.1Snisimura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Snisimura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Snisimura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Snisimura * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Snisimura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Snisimura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Snisimura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Snisimura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Snisimura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Snisimura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Snisimura * SUCH DAMAGE. 391.1Snisimura * 401.1Snisimura * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 411.1Snisimura * 421.1Snisimura * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 431.1Snisimura */ 441.1Snisimura 451.1Snisimura#ifndef _MACHINE_VMPARAM_H_ 461.1Snisimura#define _MACHINE_VMPARAM_H_ 471.7Sthorpej 481.7Sthorpej/* 491.7Sthorpej * We use 4K pages on the hp300. Override the PAGE_* definitions 501.7Sthorpej * to be compile-time constants. 511.7Sthorpej */ 521.7Sthorpej#define PAGE_SHIFT 12 531.7Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 541.7Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 551.1Snisimura 561.1Snisimura/* 571.6Sthorpej * USRSTACK is the top (end) of the user stack. 581.1Snisimura */ 591.1Snisimura#define USRSTACK VM_MAXUSER_ADDRESS 601.1Snisimura 611.1Snisimura/* 621.1Snisimura * Virtual memory related constants, all in bytes 631.1Snisimura */ 641.1Snisimura#ifndef MAXTSIZ 651.1Snisimura#define MAXTSIZ (8*1024*1024) /* max text size */ 661.1Snisimura#endif 671.1Snisimura#ifndef DFLDSIZ 681.1Snisimura#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 691.1Snisimura#endif 701.1Snisimura#ifndef MAXDSIZ 711.1Snisimura#define MAXDSIZ (64*1024*1024) /* max data size */ 721.1Snisimura#endif 731.1Snisimura#ifndef DFLSSIZ 741.1Snisimura#define DFLSSIZ (512*1024) /* initial stack size limit */ 751.1Snisimura#endif 761.1Snisimura#ifndef MAXSSIZ 771.1Snisimura#define MAXSSIZ MAXDSIZ /* max stack size */ 781.1Snisimura#endif 791.1Snisimura 801.1Snisimura/* 811.1Snisimura * Sizes of the system and user portions of the system page table. 821.1Snisimura */ 831.1Snisimura/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 841.1Snisimura#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 851.1Snisimura#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 861.1Snisimura 871.1Snisimura/* 881.1Snisimura * PTEs for mapping user space into the kernel for phyio operations. 891.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations. 901.1Snisimura */ 911.1Snisimura#ifndef USRIOSIZE 921.1Snisimura#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 931.1Snisimura#endif 941.1Snisimura 951.1Snisimura/* 961.1Snisimura * PTEs for system V style shared memory. 971.1Snisimura * This is basically slop for kmempt which we actually allocate (malloc) from. 981.1Snisimura */ 991.1Snisimura#ifndef SHMMAXPGS 1001.1Snisimura#define SHMMAXPGS 1024 /* 8mb */ 1011.1Snisimura#endif 1021.1Snisimura 1031.5Ssoren/* 1041.5Ssoren * Mach derived constants 1051.1Snisimura */ 1061.1Snisimura 1071.1Snisimura/* user/kernel map constants */ 1081.1Snisimura#define VM_MIN_ADDRESS ((vaddr_t)0) 1091.1Snisimura#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFFC0000) 1101.1Snisimura#define VM_MAX_ADDRESS ((vaddr_t)0xFFFC0000) 1111.1Snisimura#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1121.8Sthorpej#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) 1131.1Snisimura 1141.1Snisimura/* virtual sizes (bytes) for various kernel submaps */ 1151.1Snisimura#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) 1161.8Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 1171.1Snisimura 1181.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */ 1191.1Snisimura#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1201.1Snisimura 1211.1Snisimura/* 1221.1Snisimura * Constants which control the way the VM system deals with memory segments. 1231.1Snisimura * Only one physical contigous memory segment. 1241.1Snisimura */ 1251.1Snisimura#define VM_PHYSSEG_MAX 1 1261.1Snisimura#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1271.1Snisimura#define VM_PHYSSEG_NOADD 1281.1Snisimura 1291.1Snisimura#define VM_NFREELIST 1 1301.1Snisimura#define VM_FREELIST_DEFAULT 0 1311.3Sthorpej 1321.4Sthorpej#define __HAVE_PMAP_PHYSSEG 1331.1Snisimura 1341.1Snisimura/* 1351.1Snisimura * pmap-specific data stored in the vm_physmem[] array. 1361.1Snisimura */ 1371.1Snisimurastruct pmap_physseg { 1381.1Snisimura struct pv_entry *pvent; /* pv table for this seg */ 1391.1Snisimura char *attrs; /* page attributes for this seg */ 1401.1Snisimura}; 1411.1Snisimura 1421.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */ 143