vmparam.h revision 1.9
11.9Sagc/* $NetBSD: vmparam.h,v 1.9 2003/08/07 16:28:07 agc Exp $ */ 21.1Snisimura 31.1Snisimura/* 41.1Snisimura * Copyright (c) 1982, 1986, 1990, 1993 51.1Snisimura * The Regents of the University of California. All rights reserved. 61.9Sagc * 71.9Sagc * This code is derived from software contributed to Berkeley by 81.9Sagc * the Systems Programming Group of the University of Utah Computer 91.9Sagc * Science Department. 101.9Sagc * 111.9Sagc * Redistribution and use in source and binary forms, with or without 121.9Sagc * modification, are permitted provided that the following conditions 131.9Sagc * are met: 141.9Sagc * 1. Redistributions of source code must retain the above copyright 151.9Sagc * notice, this list of conditions and the following disclaimer. 161.9Sagc * 2. Redistributions in binary form must reproduce the above copyright 171.9Sagc * notice, this list of conditions and the following disclaimer in the 181.9Sagc * documentation and/or other materials provided with the distribution. 191.9Sagc * 3. Neither the name of the University nor the names of its contributors 201.9Sagc * may be used to endorse or promote products derived from this software 211.9Sagc * without specific prior written permission. 221.9Sagc * 231.9Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.9Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.9Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.9Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.9Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.9Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.9Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.9Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.9Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.9Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.9Sagc * SUCH DAMAGE. 341.9Sagc * 351.9Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 361.9Sagc * 371.9Sagc * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 381.9Sagc */ 391.9Sagc/* 401.9Sagc * Copyright (c) 1988 University of Utah. 411.1Snisimura * 421.1Snisimura * This code is derived from software contributed to Berkeley by 431.1Snisimura * the Systems Programming Group of the University of Utah Computer 441.1Snisimura * Science Department. 451.1Snisimura * 461.1Snisimura * Redistribution and use in source and binary forms, with or without 471.1Snisimura * modification, are permitted provided that the following conditions 481.1Snisimura * are met: 491.1Snisimura * 1. Redistributions of source code must retain the above copyright 501.1Snisimura * notice, this list of conditions and the following disclaimer. 511.1Snisimura * 2. Redistributions in binary form must reproduce the above copyright 521.1Snisimura * notice, this list of conditions and the following disclaimer in the 531.1Snisimura * documentation and/or other materials provided with the distribution. 541.1Snisimura * 3. All advertising materials mentioning features or use of this software 551.1Snisimura * must display the following acknowledgement: 561.1Snisimura * This product includes software developed by the University of 571.1Snisimura * California, Berkeley and its contributors. 581.1Snisimura * 4. Neither the name of the University nor the names of its contributors 591.1Snisimura * may be used to endorse or promote products derived from this software 601.1Snisimura * without specific prior written permission. 611.1Snisimura * 621.1Snisimura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 631.1Snisimura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 641.1Snisimura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 651.1Snisimura * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 661.1Snisimura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 671.1Snisimura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 681.1Snisimura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 691.1Snisimura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 701.1Snisimura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 711.1Snisimura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 721.1Snisimura * SUCH DAMAGE. 731.1Snisimura * 741.1Snisimura * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 751.1Snisimura * 761.1Snisimura * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 771.1Snisimura */ 781.1Snisimura 791.1Snisimura#ifndef _MACHINE_VMPARAM_H_ 801.1Snisimura#define _MACHINE_VMPARAM_H_ 811.7Sthorpej 821.7Sthorpej/* 831.7Sthorpej * We use 4K pages on the hp300. Override the PAGE_* definitions 841.7Sthorpej * to be compile-time constants. 851.7Sthorpej */ 861.7Sthorpej#define PAGE_SHIFT 12 871.7Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 881.7Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 891.1Snisimura 901.1Snisimura/* 911.6Sthorpej * USRSTACK is the top (end) of the user stack. 921.1Snisimura */ 931.1Snisimura#define USRSTACK VM_MAXUSER_ADDRESS 941.1Snisimura 951.1Snisimura/* 961.1Snisimura * Virtual memory related constants, all in bytes 971.1Snisimura */ 981.1Snisimura#ifndef MAXTSIZ 991.1Snisimura#define MAXTSIZ (8*1024*1024) /* max text size */ 1001.1Snisimura#endif 1011.1Snisimura#ifndef DFLDSIZ 1021.1Snisimura#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 1031.1Snisimura#endif 1041.1Snisimura#ifndef MAXDSIZ 1051.1Snisimura#define MAXDSIZ (64*1024*1024) /* max data size */ 1061.1Snisimura#endif 1071.1Snisimura#ifndef DFLSSIZ 1081.1Snisimura#define DFLSSIZ (512*1024) /* initial stack size limit */ 1091.1Snisimura#endif 1101.1Snisimura#ifndef MAXSSIZ 1111.1Snisimura#define MAXSSIZ MAXDSIZ /* max stack size */ 1121.1Snisimura#endif 1131.1Snisimura 1141.1Snisimura/* 1151.1Snisimura * Sizes of the system and user portions of the system page table. 1161.1Snisimura */ 1171.1Snisimura/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 1181.1Snisimura#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 1191.1Snisimura#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 1201.1Snisimura 1211.1Snisimura/* 1221.1Snisimura * PTEs for mapping user space into the kernel for phyio operations. 1231.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations. 1241.1Snisimura */ 1251.1Snisimura#ifndef USRIOSIZE 1261.1Snisimura#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 1271.1Snisimura#endif 1281.1Snisimura 1291.1Snisimura/* 1301.1Snisimura * PTEs for system V style shared memory. 1311.1Snisimura * This is basically slop for kmempt which we actually allocate (malloc) from. 1321.1Snisimura */ 1331.1Snisimura#ifndef SHMMAXPGS 1341.1Snisimura#define SHMMAXPGS 1024 /* 8mb */ 1351.1Snisimura#endif 1361.1Snisimura 1371.5Ssoren/* 1381.5Ssoren * Mach derived constants 1391.1Snisimura */ 1401.1Snisimura 1411.1Snisimura/* user/kernel map constants */ 1421.1Snisimura#define VM_MIN_ADDRESS ((vaddr_t)0) 1431.1Snisimura#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFFC0000) 1441.1Snisimura#define VM_MAX_ADDRESS ((vaddr_t)0xFFFC0000) 1451.1Snisimura#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1461.8Sthorpej#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) 1471.1Snisimura 1481.1Snisimura/* virtual sizes (bytes) for various kernel submaps */ 1491.1Snisimura#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) 1501.8Sthorpej#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 1511.1Snisimura 1521.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */ 1531.1Snisimura#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1541.1Snisimura 1551.1Snisimura/* 1561.1Snisimura * Constants which control the way the VM system deals with memory segments. 1571.1Snisimura * Only one physical contigous memory segment. 1581.1Snisimura */ 1591.1Snisimura#define VM_PHYSSEG_MAX 1 1601.1Snisimura#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1611.1Snisimura#define VM_PHYSSEG_NOADD 1621.1Snisimura 1631.1Snisimura#define VM_NFREELIST 1 1641.1Snisimura#define VM_FREELIST_DEFAULT 0 1651.3Sthorpej 1661.4Sthorpej#define __HAVE_PMAP_PHYSSEG 1671.1Snisimura 1681.1Snisimura/* 1691.1Snisimura * pmap-specific data stored in the vm_physmem[] array. 1701.1Snisimura */ 1711.1Snisimurastruct pmap_physseg { 1721.1Snisimura struct pv_entry *pvent; /* pv table for this seg */ 1731.1Snisimura char *attrs; /* page attributes for this seg */ 1741.1Snisimura}; 1751.1Snisimura 1761.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */ 177