xref: /openbsd-src/sys/arch/hppa/include/vmparam.h (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1 /*	$OpenBSD: vmparam.h,v 1.16 2001/08/12 20:06:11 miod 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 top (end) of the user stack.  LOWPAGES and HIGHPAGES are
35  * the number of pages from the beginning of the P0 region to the
36  * beginning of the text and from the beginning of the P1 region to the
37  * beginning of the stack respectively.
38  */
39 #define	USRTEXT		0x00002000		/* Start of user .text */
40 #define	USRSTACK	0x68FF3000		/* Start of user stack */
41 #define	LOWPAGES	0
42 #define	HIGHPAGES	UPAGES
43 #define	SYSCALLGATE	0xC0000000		/* syscall gateway page */
44 
45 /*
46  * Virtual memory related constants, all in bytes
47  */
48 #ifndef MAXTSIZ
49 #define	MAXTSIZ		(0x40000000)		/* max text size */
50 #endif
51 #ifndef DFLDSIZ
52 #define	DFLDSIZ		(16*1024*1024)		/* initial data size limit */
53 #endif
54 #ifndef MAXDSIZ
55 #define	MAXDSIZ		(USRSTACK-MAXTSIZ)	/* max data size */
56 #endif
57 #ifndef	DFLSSIZ
58 #define	DFLSSIZ		(512*1024)		/* initial stack size limit */
59 #endif
60 #ifndef	MAXSSIZ
61 #define	MAXSSIZ		(UADDR-USRSTACK)	/* max stack size */
62 #endif
63 
64 /*
65  * Default sizes of swap allocation chunks (see dmap.h).
66  * The actual values may be changed in vminit() based on MAXDSIZ.
67  * With MAXDSIZ of 64Mb and NDMAP of 62, dmmax will be 4096.
68  * DMMIN should be at least ctod(1) so that vtod() works.
69  * vminit() ensures this.
70  */
71 #define	DMMIN	32			/* smallest swap allocation */
72 #define	DMMAX	4096			/* largest potential swap allocation */
73 
74 #ifndef USRIOSIZE
75 #define	USRIOSIZE	((2*HPPA_PGALIAS)/PAGE_SIZE)	/* 2mb */
76 #endif
77 
78 /*
79  * PTEs for system V style shared memory.
80  * This is basically slop for kmempt which we actually allocate (malloc) from.
81  */
82 #ifndef SHMMAXPGS
83 #define SHMMAXPGS	((1024*1024*10)/NBPG)	/* 10mb */
84 #endif
85 
86 /*
87  * The time for a process to be blocked before being very swappable.
88  * This is a number of seconds which the system takes as being a non-trivial
89  * amount of real time.  You probably shouldn't change this;
90  * it is used in subtle ways (fractions and multiples of it are, that is, like
91  * half of a ``long time'', almost a long time, etc.)
92  * It is related to human patience and other factors which don't really
93  * change over time.
94  */
95 #define	MAXSLP 		20
96 
97 /*
98  * A swapped in process is given a small amount of core without being bothered
99  * by the page replacement algorithm.  Basically this says that if you are
100  * swapped in you deserve some resources.  We protect the last SAFERSS
101  * pages against paging and will just swap you out rather than paging you.
102  */
103 #define	SAFERSS		(0x4000/NBPG)	/* nominal ``small'' resident set size
104 					   protected against replacement */
105 
106 /* user/kernel map constants */
107 #define	VM_MIN_ADDRESS		((vaddr_t)0)
108 #define	VM_MAXUSER_ADDRESS	((vaddr_t)0xc0000000)
109 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
110 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
111 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xf0000000)
112 
113 /* virtual sizes (bytes) for various kernel submaps */
114 #define VM_MBUF_SIZE		(NMBCLUSTERS*MCLBYTES)
115 #define VM_KMEM_SIZE		(NKMEMCLUSTERS*PAGE_SIZE)
116 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
117 
118 #define	VM_PHYSSEG_MAX	8	/* this many physmem segments */
119 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BIGFIRST
120 
121 #define	VM_PHYSSEG_NOADD	/* XXX until uvm code is fixed */
122 
123 #define	VM_NFREELIST		2
124 #define	VM_FREELIST_DEFAULT	0
125 #define	VM_FREELIST_FIRST16	1
126 
127 #ifdef _KERNEL
128 struct pmap_physseg {
129 	struct pv_entry *pvent;
130 };
131 #endif
132 
133 #endif	/* _MACHINE_VMPARAM_H_ */
134 
135