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