1 /* $OpenBSD: vmparam.h,v 1.24 2011/05/30 22:25:21 oga Exp $ */ 2 /* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ 3 4 /* 5 * Copyright (c) 1988 University of Utah. 6 * Copyright (c) 1992, 1993 7 * The Regents of the University of California. All rights reserved. 8 * 9 * This code is derived from software contributed to Berkeley by 10 * the Systems Programming Group of the University of Utah Computer 11 * Science Department and Ralph Campbell. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 1. Redistributions of source code must retain the above copyright 17 * notice, this list of conditions and the following disclaimer. 18 * 2. Redistributions in binary form must reproduce the above copyright 19 * notice, this list of conditions and the following disclaimer in the 20 * documentation and/or other materials provided with the distribution. 21 * 3. Neither the name of the University nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: Utah Hdr: vmparam.h 1.16 91/01/18 38 * @(#)vmparam.h 8.2 (Berkeley) 4/22/94 39 */ 40 41 #ifndef _MIPS64_VMPARAM_H_ 42 #define _MIPS64_VMPARAM_H_ 43 44 /* 45 * Machine dependent constants mips processors. 46 */ 47 48 #define USRSTACK VM_MAXUSER_ADDRESS /* Start of user stack */ 49 50 /* 51 * Virtual memory related constants, all in bytes 52 */ 53 #ifndef MAXTSIZ 54 #define MAXTSIZ (64*1024*1024) /* max text size */ 55 #endif 56 #ifndef DFLDSIZ 57 #define DFLDSIZ (128*1024*1024) /* initial data size limit */ 58 #endif 59 #ifndef MAXDSIZ 60 #define MAXDSIZ (1*1024*1024*1024) /* max data size */ 61 #endif 62 #ifndef BRKSIZ 63 #define BRKSIZ MAXDSIZ /* heap gap size */ 64 #endif 65 #ifndef DFLSSIZ 66 #define DFLSSIZ (2*1024*1024) /* initial stack size limit */ 67 #endif 68 #ifndef MAXSSIZ 69 #define MAXSSIZ (32*1024*1024) /* max stack size */ 70 #endif 71 72 #define STACKGAP_RANDOM 256*1024 73 74 /* 75 * PTEs for mapping user space into the kernel for physio operations. 76 * 16 pte's are enough to cover 8 disks * MAXBSIZE. 77 */ 78 #ifndef USRIOSIZE 79 #define USRIOSIZE 32 80 #endif 81 82 /* 83 * PTEs for system V style shared memory. 84 * This is basically slop for kmempt which we actually allocate (malloc) from. 85 */ 86 #ifndef SHMMAXPGS 87 #define SHMMAXPGS 8192 /* 8mb */ 88 #endif 89 90 #ifndef VM_PHYSSEG_MAX 91 #define VM_PHYSSEG_MAX 8 /* Max number of physical memory segments */ 92 #endif 93 #ifndef VM_PHYSSEG_STRAT 94 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 95 #endif 96 #define VM_PHYSSEG_NOADD 97 98 /* user/kernel map constants */ 99 #define VM_MIN_ADDRESS ((vaddr_t)0x0000000000004000L) 100 #define VM_MAXUSER_ADDRESS ((vaddr_t)0x0000000080000000L) 101 #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 102 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc000000000000000L) 103 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xc000000040000000L) 104 105 /* map PIE below 256MB (non-pie link address) to avoid mmap pressure */ 106 #define VM_PIE_MIN_ADDR PAGE_SIZE 107 #define VM_PIE_MAX_ADDR (0x10000000UL) 108 109 /* virtual sizes (bytes) for various kernel submaps */ 110 #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 111 112 #if defined(_KERNEL) && !defined(_LOCORE) 113 /* 114 * pmap-specific data 115 */ 116 117 /* XXX - belongs in pmap.h, but put here because of ordering issues */ 118 typedef struct pv_entry { 119 struct pv_entry *pv_next; /* next pv_entry */ 120 struct pmap *pv_pmap; /* pmap where mapping lies */ 121 vaddr_t pv_va; /* virtual address for mapping */ 122 } *pv_entry_t; 123 124 #define __HAVE_VM_PAGE_MD 125 struct vm_page_md { 126 struct pv_entry pv_ent; /* pv list of this seg */ 127 }; 128 129 #define VM_MDPAGE_INIT(pg) \ 130 do { \ 131 (pg)->mdpage.pv_ent.pv_next = NULL; \ 132 (pg)->mdpage.pv_ent.pv_pmap = NULL; \ 133 (pg)->mdpage.pv_ent.pv_va = 0; \ 134 } while (0) 135 136 #endif /* _KERNEL && !_LOCORE */ 137 138 #endif /* !_MIPS64_VMPARAM_H_ */ 139