1*c7ba784cSart /* $OpenBSD: vmparam.h,v 1.12 2001/05/05 20:56:37 art Exp $ */ 2e55ab885Smickey 3e55ab885Smickey /* 4e55ab885Smickey * Copyright (c) 1988-1994, The University of Utah and 5e55ab885Smickey * the Computer Systems Laboratory at the University of Utah (CSL). 6e55ab885Smickey * All rights reserved. 7e55ab885Smickey * 8e55ab885Smickey * Permission to use, copy, modify and distribute this software is hereby 9e55ab885Smickey * granted provided that (1) source code retains these copyright, permission, 10e55ab885Smickey * and disclaimer notices, and (2) redistributions including binaries 11e55ab885Smickey * reproduce the notices in supporting documentation, and (3) all advertising 12e55ab885Smickey * materials mentioning features or use of this software display the following 13e55ab885Smickey * acknowledgement: ``This product includes software developed by the 14e55ab885Smickey * Computer Systems Laboratory at the University of Utah.'' 15e55ab885Smickey * 16e55ab885Smickey * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS 17e55ab885Smickey * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF 18e55ab885Smickey * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 19e55ab885Smickey * 20e55ab885Smickey * CSL requests users of this software to return to csl-dist@cs.utah.edu any 21e55ab885Smickey * improvements that they make and grant CSL redistribution rights. 22e55ab885Smickey * 23e55ab885Smickey * Utah $Hdr: vmparam.h 1.16 94/12/16$ 24e55ab885Smickey */ 25e55ab885Smickey 26343a9f2aSmickey #ifndef _MACHINE_VMPARAM_H_ 27343a9f2aSmickey #define _MACHINE_VMPARAM_H_ 28e55ab885Smickey 29e55ab885Smickey /* 30e55ab885Smickey * Machine dependent constants for HP PA 31e55ab885Smickey */ 32e55ab885Smickey /* 33e55ab885Smickey * USRTEXT is the start of the user text/data space, while USRSTACK 34e55ab885Smickey * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are 35e55ab885Smickey * the number of pages from the beginning of the P0 region to the 36e55ab885Smickey * beginning of the text and from the beginning of the P1 region to the 37e55ab885Smickey * beginning of the stack respectively. 38e55ab885Smickey */ 39fc80caebSmickey #define USRTEXT 0x00002000 /* Start of user .text */ 40e55ab885Smickey #define USRSTACK 0x68FF3000 /* Start of user stack */ 41e55ab885Smickey #define BTOPUSRSTACK btop(USRSTACK) /* btop(USRSTACK) */ 424eadd93aSmickey #define P1PAGES 2 43e55ab885Smickey #define LOWPAGES 0 44e55ab885Smickey #define HIGHPAGES UPAGES 459fbfe4d3Smickey #define SYSCALLGATE 0xC0000000 /* syscall gateway page */ 46e55ab885Smickey 47e55ab885Smickey /* 48e55ab885Smickey * Virtual memory related constants, all in bytes 49e55ab885Smickey */ 50e55ab885Smickey #ifndef MAXTSIZ 5176fcfe46Smickey #define MAXTSIZ (0x40000000) /* max text size */ 52e55ab885Smickey #endif 53e55ab885Smickey #ifndef DFLDSIZ 54e55ab885Smickey #define DFLDSIZ (16*1024*1024) /* initial data size limit */ 55e55ab885Smickey #endif 56e55ab885Smickey #ifndef MAXDSIZ 5776fcfe46Smickey #define MAXDSIZ (USRSTACK-MAXTSIZ) /* max data size */ 58e55ab885Smickey #endif 59e55ab885Smickey #ifndef DFLSSIZ 60e55ab885Smickey #define DFLSSIZ (512*1024) /* initial stack size limit */ 61e55ab885Smickey #endif 62e55ab885Smickey #ifndef MAXSSIZ 6376fcfe46Smickey #define MAXSSIZ (UADDR-USRSTACK) /* max stack size */ 64e55ab885Smickey #endif 65e55ab885Smickey 66e55ab885Smickey /* 67e55ab885Smickey * Default sizes of swap allocation chunks (see dmap.h). 68e55ab885Smickey * The actual values may be changed in vminit() based on MAXDSIZ. 69e55ab885Smickey * With MAXDSIZ of 64Mb and NDMAP of 62, dmmax will be 4096. 70e55ab885Smickey * DMMIN should be at least ctod(1) so that vtod() works. 71e55ab885Smickey * vminit() ensures this. 72e55ab885Smickey */ 73343a9f2aSmickey #define DMMIN 32 /* smallest swap allocation */ 74e55ab885Smickey #define DMMAX 4096 /* largest potential swap allocation */ 75e55ab885Smickey 76343a9f2aSmickey #ifndef USRIOSIZE 77*c7ba784cSart #define USRIOSIZE ((2*HPPA_PGALIAS)/PAGE_SIZE) /* 2mb */ 78343a9f2aSmickey #endif 79e55ab885Smickey 80e55ab885Smickey /* 81e55ab885Smickey * PTEs for system V style shared memory. 82e55ab885Smickey * This is basically slop for kmempt which we actually allocate (malloc) from. 83e55ab885Smickey */ 84e55ab885Smickey #ifndef SHMMAXPGS 85e55ab885Smickey #define SHMMAXPGS ((1024*1024*10)/NBPG) /* 10mb */ 86e55ab885Smickey #endif 87e55ab885Smickey 88e55ab885Smickey /* 89e55ab885Smickey * The time for a process to be blocked before being very swappable. 90e55ab885Smickey * This is a number of seconds which the system takes as being a non-trivial 91e55ab885Smickey * amount of real time. You probably shouldn't change this; 92e55ab885Smickey * it is used in subtle ways (fractions and multiples of it are, that is, like 93e55ab885Smickey * half of a ``long time'', almost a long time, etc.) 94e55ab885Smickey * It is related to human patience and other factors which don't really 95e55ab885Smickey * change over time. 96e55ab885Smickey */ 97e55ab885Smickey #define MAXSLP 20 98e55ab885Smickey 99e55ab885Smickey /* 100e55ab885Smickey * A swapped in process is given a small amount of core without being bothered 101e55ab885Smickey * by the page replacement algorithm. Basically this says that if you are 102e55ab885Smickey * swapped in you deserve some resources. We protect the last SAFERSS 103e55ab885Smickey * pages against paging and will just swap you out rather than paging you. 104e55ab885Smickey * Note that each process has at least UPAGES+CLSIZE pages which are not 105e55ab885Smickey * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this 106e55ab885Smickey * number just means a swapped in process is given around 25k bytes. 107e55ab885Smickey * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), 108e55ab885Smickey * so we loan each swapped in process memory worth 100$, or just admit 109e55ab885Smickey * that we don't consider it worthwhile and swap it out to disk which costs 110e55ab885Smickey * $30/mb or about $0.75. 111e55ab885Smickey */ 1124eadd93aSmickey #define SAFERSS (0x4000/NBPG) /* nominal ``small'' resident set size 113e55ab885Smickey protected against replacement */ 114e55ab885Smickey 115e55ab885Smickey /* user/kernel map constants */ 1164eadd93aSmickey #define VM_MIN_ADDRESS ((vaddr_t)0) 1174eadd93aSmickey #define VM_MAXUSER_ADDRESS ((vaddr_t)0xc0000000) 118e55ab885Smickey #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 1194eadd93aSmickey #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 12091811916Smickey #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xf0000000) 121e55ab885Smickey 122e55ab885Smickey /* virtual sizes (bytes) for various kernel submaps */ 123e55ab885Smickey #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) 124*c7ba784cSart #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) 125*c7ba784cSart #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 126e55ab885Smickey 1279fbfe4d3Smickey #define VM_PHYSSEG_MAX 8 /* this many physmem segments */ 1289fbfe4d3Smickey #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST 1299fbfe4d3Smickey 13091811916Smickey #define VM_PHYSSEG_NOADD /* XXX until uvm code is fixed */ 13191811916Smickey 1324eadd93aSmickey #define VM_NFREELIST 2 1334eadd93aSmickey #define VM_FREELIST_DEFAULT 0 1344eadd93aSmickey #define VM_FREELIST_FIRST16 1 1354eadd93aSmickey 1364eadd93aSmickey #define MACHINE_NEW_NONCONTIG 1 /* defined this until we rely on vm */ 137570e1deaSmickey #define PMAP_NEW 1384eadd93aSmickey 139879ffe42Smickey #ifdef _KERNEL 140428ad8bbSmickey struct pmap_physseg { 141428ad8bbSmickey struct pv_entry *pvent; 142428ad8bbSmickey }; 143879ffe42Smickey #endif 144428ad8bbSmickey 145343a9f2aSmickey #endif /* _MACHINE_VMPARAM_H_ */ 146428ad8bbSmickey 147