xref: /openbsd-src/sys/arch/hppa/include/vmparam.h (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1 /*	$OpenBSD: vmparam.h,v 1.35 2008/09/06 19:49:05 kettenis 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	DFLSSIZ
53 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
54 #endif
55 #ifndef	MAXSSIZ
56 #define	MAXSSIZ		(128*1024*1024UL)	/* max stack size */
57 #endif
58 
59 #define STACKGAP_RANDOM	256*1024
60 
61 #ifndef USRIOSIZE
62 #define	USRIOSIZE	((2*HPPA_PGALIAS)/PAGE_SIZE)	/* 8mb */
63 #endif
64 
65 /*
66  * PTEs for system V style shared memory.
67  * This is basically slop for kmempt which we actually allocate (malloc) from.
68  */
69 #ifndef SHMMAXPGS
70 #define SHMMAXPGS	8192	/* 32mb */
71 #endif
72 
73 /* user/kernel map constants */
74 #define	VM_MIN_ADDRESS		((vaddr_t)0)
75 #define	VM_MAXUSER_ADDRESS	((vaddr_t)0xc0000000)
76 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
77 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xc0001000)
78 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xef000000)
79 
80 /* use a small range for PIE to minimize mmap pressure */
81 #define	VM_PIE_MIN_ADDR		PAGE_SIZE
82 #define	VM_PIE_MAX_ADDR		0x40000UL
83 
84 /* virtual sizes (bytes) for various kernel submaps */
85 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
86 
87 #define	VM_PHYSSEG_MAX		1	/* this many physmem segments */
88 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
89 
90 #define	VM_PHYSSEG_NOADD	/* XXX until uvm code is fixed */
91 
92 #define	VM_NFREELIST		2
93 #define	VM_FREELIST_DEFAULT	0
94 #define	VM_FREELIST_ARCH	1
95 
96 #if defined(_KERNEL) && !defined(_LOCORE)
97 #define __HAVE_VM_PAGE_MD
98 struct pv_entry;
99 struct vm_page_md {
100 	struct simplelock pvh_lock;	/* locks every pv on this list */
101 	struct pv_entry	*pvh_list;	/* head of list (locked by pvh_lock) */
102 	u_int		pvh_attrs;	/* to preserve ref/mod */
103 };
104 
105 #define	VM_MDPAGE_INIT(pg) do {				\
106 	simple_lock_init(&(pg)->mdpage.pvh_lock);	\
107 	(pg)->mdpage.pvh_list = NULL;			\
108 	(pg)->mdpage.pvh_attrs = 0;			\
109 } while (0)
110 #endif
111 
112 #endif	/* _MACHINE_VMPARAM_H_ */
113 
114