1 /** $MirOS: src/sys/arch/sparc/include/vmparam.h,v 1.2 2006/06/27 21:00:55 tg Exp $ */ 2 /* $OpenBSD: vmparam.h,v 1.28 2003/06/02 23:27:55 millert Exp $ */ 3 /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ 4 5 /* 6 * Copyright (c) 1992, 1993 7 * The Regents of the University of California. All rights reserved. 8 * 9 * This software was developed by the Computer Systems Engineering group 10 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 11 * contributed to Berkeley. 12 * 13 * All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Lawrence Berkeley Laboratory. 17 * 18 * Redistribution and use in source and binary forms, with or without 19 * modification, are permitted provided that the following conditions 20 * are met: 21 * 1. Redistributions of source code must retain the above copyright 22 * notice, this list of conditions and the following disclaimer. 23 * 2. Redistributions in binary form must reproduce the above copyright 24 * notice, this list of conditions and the following disclaimer in the 25 * documentation and/or other materials provided with the distribution. 26 * 3. Neither the name of the University nor the names of its contributors 27 * may be used to endorse or promote products derived from this software 28 * without specific prior written permission. 29 * 30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 * @(#)vmparam.h 8.1 (Berkeley) 6/11/93 43 */ 44 45 #ifndef _SPARC_VMPARAM_H_ 46 #define _SPARC_VMPARAM_H_ 47 48 /* 49 * Machine dependent constants for Sun-4c SPARC 50 */ 51 52 /* 53 * USRTEXT is the start of the user text/data space, while USRSTACK 54 * is the top (end) of the user stack. 55 */ 56 #define USRTEXT 0x2000 /* Start of user text */ 57 #define USRSTACK KERNBASE /* Start of user stack */ 58 59 /* 60 * Virtual memory related constants, all in bytes 61 */ 62 #ifndef MAXTSIZ 63 #define MAXTSIZ (16*1024*1024) /* max text size */ 64 #endif 65 #ifndef DFLDSIZ 66 #define DFLDSIZ (32*1024*1024) /* initial data size limit */ 67 #endif 68 #ifndef MAXDSIZ 69 #define MAXDSIZ (320*1024*1024) /* max data size */ 70 #endif 71 #ifndef DFLSSIZ 72 #define DFLSSIZ (512*1024) /* initial stack size limit */ 73 #endif 74 #ifndef MAXSSIZ 75 #define MAXSSIZ MAXDSIZ /* max stack size */ 76 #endif 77 78 /* 79 * Size of shared memory map 80 */ 81 #ifndef SHMMAXPGS 82 #define SHMMAXPGS 1024 83 #endif 84 85 /* 86 * The time for a process to be blocked before being very swappable. 87 * This is a number of seconds which the system takes as being a non-trivial 88 * amount of real time. You probably shouldn't change this; 89 * it is used in subtle ways (fractions and multiples of it are, that is, like 90 * half of a ``long time'', almost a long time, etc.) 91 * It is related to human patience and other factors which don't really 92 * change over time. 93 */ 94 #define MAXSLP 20 95 96 /* 97 * User/kernel map constants. Note that sparc/vaddrs.h defines the 98 * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS: 99 * tread with care. 100 */ 101 #define VM_MIN_ADDRESS ((vaddr_t)0) 102 #define VM_MAX_ADDRESS ((vaddr_t)KERNBASE) 103 #define VM_MAXUSER_ADDRESS ((vaddr_t)KERNBASE) 104 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE) 105 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xfe000000) 106 107 #define VM_PHYSSEG_MAX 32 /* we only have one "hole" */ 108 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 109 #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ 110 111 /* 112 * pmap specific data stored in the vm_physmem[] array 113 */ 114 115 116 /* XXX - belongs in pmap.h, but put here because of ordering issues */ 117 struct pvlist { 118 struct pvlist *pv_next; /* next pvlist, if any */ 119 struct pmap *pv_pmap; /* pmap of this va */ 120 vaddr_t pv_va; /* virtual address */ 121 int pv_flags; /* flags (below) */ 122 }; 123 124 #define __HAVE_VM_PAGE_MD 125 struct vm_page_md { 126 struct pvlist pv_head; 127 }; 128 129 #define VM_MDPAGE_INIT(pg) do { \ 130 (pg)->mdpage.pv_head.pv_next = NULL; \ 131 (pg)->mdpage.pv_head.pv_pmap = NULL; \ 132 (pg)->mdpage.pv_head.pv_va = 0; \ 133 (pg)->mdpage.pv_head.pv_flags = 0; \ 134 } while (0) 135 136 #define VM_NFREELIST 1 137 #define VM_FREELIST_DEFAULT 0 138 139 #if defined (_KERNEL) && !defined(_LOCORE) 140 struct vm_map; 141 #define dvma_mapin(map,va,len,canwait) dvma_mapin_space(map,va,len,canwait,0) 142 vaddr_t dvma_mapin_space(struct vm_map *, vaddr_t, int, int, int); 143 void dvma_mapout(vaddr_t, vaddr_t, int); 144 #endif 145 146 #endif /* _SPARC_VMPARAM_H_ */ 147