xref: /openbsd/sys/arch/m88k/include/vmparam.h (revision 891d7ab6)
1 /*	$OpenBSD: vmparam.h,v 1.11 2011/05/30 22:25:21 oga Exp $ */
2 /*
3  * Mach Operating System
4  * Copyright (c) 1992 Carnegie Mellon University
5  * All Rights Reserved.
6  *
7  * Permission to use, copy, modify and distribute this software and its
8  * documentation is hereby granted, provided that both the copyright
9  * notice and this permission notice appear in all copies of the
10  * software, derivative works or modified versions, and any portions
11  * thereof, and that both notices appear in supporting documentation.
12  *
13  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16  *
17  * Carnegie Mellon requests users of this software to return to
18  *
19  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
20  *  School of Computer Science
21  *  Carnegie Mellon University
22  *  Pittsburgh PA 15213-3890
23  *
24  * any improvements or extensions that they make and grant Carnegie Mellon
25  * the rights to redistribute these changes.
26  */
27 
28 /*
29  *	machine dependent virtual memory parameters.
30  */
31 
32 
33 #ifndef	_MACHINE_VM_PARAM_
34 #define _MACHINE_VM_PARAM_
35 
36 /*
37  * USRTEXT is the start of the user text/data space, while USRSTACK
38  * is the top (end) of the user stack.
39  */
40 #define	USRTEXT		0x1000			/* Start of user text */
41 #define	USRSTACK	VM_MAXUSER_ADDRESS	/* Start of user stack */
42 
43 /*
44  * Virtual memory related constants, all in bytes
45  */
46 #ifndef MAXTSIZ
47 #define	MAXTSIZ		(8*1024*1024)		/* max text size */
48 #endif
49 #ifndef DFLDSIZ
50 #define	DFLDSIZ		(32*1024*1024)		/* initial data size limit */
51 #endif
52 #ifndef MAXDSIZ
53 #define	MAXDSIZ		(64*1024*1024)		/* max data size */
54 #endif
55 #ifndef BRKSIZ
56 #define	BRKSIZ		MAXDSIZ			/* heap gap size */
57 #endif
58 #ifndef	DFLSSIZ
59 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
60 #endif
61 #ifndef	MAXSSIZ
62 #define	MAXSSIZ		MAXDSIZ			/* max stack size */
63 #endif
64 
65 #define STACKGAP_RANDOM	256*1024
66 
67 /*
68  * Size of shared memory map
69  */
70 #ifndef SHMMAXPGS
71 #define SHMMAXPGS	1024
72 #endif
73 
74 #define	VM_MIN_ADDRESS		((vaddr_t)0)
75 #define	VM_MAX_ADDRESS		((vaddr_t)0xfffff000)
76 #define VM_MAXUSER_ADDRESS	VM_MAX_ADDRESS
77 
78 /* virtual sizes (bytes) for various kernel submaps */
79 #define VM_PHYS_SIZE		(1 * NPTEPG * PAGE_SIZE)
80 
81 /*
82  * Constants which control the way the VM system deals with memory segments.
83  * The mvme88k only has one physical memory segment.
84  */
85 #define	VM_PHYSSEG_MAX		1
86 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
87 #define	VM_PHYSSEG_NOADD
88 
89 #ifndef _LOCORE
90 /*
91  * pmap-specific data stored in the vm_physmem[] array.
92  */
93 
94 /* XXX - belongs in pmap.h, but put here because of ordering issues */
95 struct pv_entry {
96 	struct pv_entry	*pv_next;	/* next pv_entry */
97 	struct pmap	*pv_pmap;	/* pmap where mapping lies */
98 	vaddr_t		pv_va;		/* virtual address for mapping */
99 	int		pv_flags;
100 };
101 
102 #define	__HAVE_VM_PAGE_MD
103 struct vm_page_md {
104 	struct pv_entry pvent;
105 };
106 
107 #define	VM_MDPAGE_INIT(pg) do {			\
108 	(pg)->mdpage.pvent.pv_next = NULL;	\
109 	(pg)->mdpage.pvent.pv_pmap = NULL;	\
110 	(pg)->mdpage.pvent.pv_va = 0;		\
111 	(pg)->mdpage.pvent.pv_flags = 0;	\
112 } while (0)
113 
114 #endif /* _LOCORE */
115 
116 #endif /* _MACHINE_VM_PARAM_ */
117