xref: /openbsd-src/sys/arch/hppa/include/vmparam.h (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1 /*	$OpenBSD: vmparam.h,v 1.38 2011/05/30 22:25:21 oga Exp $	*/
2 
3 /*
4  * Copyright (c) 1988-1994, The University of Utah and
5  * the Computer Systems Laboratory at the University of Utah (CSL).
6  * All rights reserved.
7  *
8  * Permission to use, copy, modify and distribute this software is hereby
9  * granted provided that (1) source code retains these copyright, permission,
10  * and disclaimer notices, and (2) redistributions including binaries
11  * reproduce the notices in supporting documentation, and (3) all advertising
12  * materials mentioning features or use of this software display the following
13  * acknowledgement: ``This product includes software developed by the
14  * Computer Systems Laboratory at the University of Utah.''
15  *
16  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
17  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
18  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19  *
20  * CSL requests users of this software to return to csl-dist@cs.utah.edu any
21  * improvements that they make and grant CSL redistribution rights.
22  *
23  * 	Utah $Hdr: vmparam.h 1.16 94/12/16$
24  */
25 
26 #ifndef _MACHINE_VMPARAM_H_
27 #define _MACHINE_VMPARAM_H_
28 
29 /*
30  * Machine dependent constants for HP PA
31  */
32 /*
33  * USRTEXT is the start of the user text/data space, while USRSTACK
34  * is the bottm (start) of the user stack.
35  */
36 #define	USRTEXT		PAGE_SIZE		/* Start of user .text */
37 #define	USRSTACK	0x78000000UL		/* Start of user stack */
38 #define	SYSCALLGATE	0xC0000000		/* syscall gateway page */
39 
40 /*
41  * Virtual memory related constants, all in bytes
42  */
43 #ifndef MAXTSIZ
44 #define	MAXTSIZ		(512*1024*1024UL)	/* max text size */
45 #endif
46 #ifndef DFLDSIZ
47 #define	DFLDSIZ		(16*1024*1024)		/* initial data size limit */
48 #endif
49 #ifndef MAXDSIZ
50 #define	MAXDSIZ		(1*1024*1024*1024UL)	/* max data size */
51 #endif
52 #ifndef BRKSIZ
53 #define	BRKSIZ		MAXDSIZ			/* heap gap size */
54 #endif
55 #ifndef	DFLSSIZ
56 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
57 #endif
58 #ifndef	MAXSSIZ
59 #define	MAXSSIZ		(128*1024*1024UL)	/* max stack size */
60 #endif
61 
62 #define STACKGAP_RANDOM	256*1024
63 
64 #ifndef USRIOSIZE
65 #define	USRIOSIZE	((2*HPPA_PGALIAS)/PAGE_SIZE)	/* 8mb */
66 #endif
67 
68 /*
69  * PTEs for system V style shared memory.
70  * This is basically slop for kmempt which we actually allocate (malloc) from.
71  */
72 #ifndef SHMMAXPGS
73 #define SHMMAXPGS	8192	/* 32mb */
74 #endif
75 
76 /* user/kernel map constants */
77 #define	VM_MIN_ADDRESS		((vaddr_t)0)
78 #define	VM_MAXUSER_ADDRESS	((vaddr_t)0xc0000000)
79 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
80 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xc0001000)
81 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xef000000)
82 
83 /* use a small range for PIE to minimize mmap pressure */
84 #define	VM_PIE_MIN_ADDR		PAGE_SIZE
85 #define	VM_PIE_MAX_ADDR		0x40000UL
86 
87 /* virtual sizes (bytes) for various kernel submaps */
88 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
89 
90 #define	VM_PHYSSEG_MAX		1	/* this many physmem segments */
91 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
92 
93 #define	VM_PHYSSEG_NOADD	/* XXX until uvm code is fixed */
94 
95 #if defined(_KERNEL) && !defined(_LOCORE)
96 
97 #include <sys/lock.h>
98 
99 #define __HAVE_VM_PAGE_MD
100 struct pv_entry;
101 struct vm_page_md {
102 	struct simplelock pvh_lock;	/* locks every pv on this list */
103 	struct pv_entry	*pvh_list;	/* head of list (locked by pvh_lock) */
104 	u_int		pvh_attrs;	/* to preserve ref/mod */
105 };
106 
107 #define	VM_MDPAGE_INIT(pg) do {				\
108 	simple_lock_init(&(pg)->mdpage.pvh_lock);	\
109 	(pg)->mdpage.pvh_list = NULL;			\
110 	(pg)->mdpage.pvh_attrs = 0;			\
111 } while (0)
112 #endif
113 
114 #endif	/* _MACHINE_VMPARAM_H_ */
115 
116