xref: /netbsd-src/sys/arch/vax/include/vmparam.h (revision 4ee6ed16f3016010ab9fb0e0f3d951968e33efa7)
1*4ee6ed16Sragge /*	$NetBSD: vmparam.h,v 1.51 2018/03/31 06:34:51 ragge Exp $	*/
2d62187c0Scgd 
38026fb53Sragge /*-
48026fb53Sragge  * Copyright (c) 1990 The Regents of the University of California.
58026fb53Sragge  * All rights reserved.
68026fb53Sragge  *
78026fb53Sragge  * This code is derived from software contributed to Berkeley by
88026fb53Sragge  * William Jolitz.
98026fb53Sragge  *
108026fb53Sragge  * Slightly modified for the VAX port /IC
118026fb53Sragge  *
128026fb53Sragge  * Redistribution and use in source and binary forms, with or without
138026fb53Sragge  * modification, are permitted provided that the following conditions
148026fb53Sragge  * are met:
158026fb53Sragge  * 1. Redistributions of source code must retain the above copyright
168026fb53Sragge  *    notice, this list of conditions and the following disclaimer.
178026fb53Sragge  * 2. Redistributions in binary form must reproduce the above copyright
188026fb53Sragge  *    notice, this list of conditions and the following disclaimer in the
198026fb53Sragge  *    documentation and/or other materials provided with the distribution.
20aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
218026fb53Sragge  *    may be used to endorse or promote products derived from this software
228026fb53Sragge  *    without specific prior written permission.
238026fb53Sragge  *
248026fb53Sragge  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
258026fb53Sragge  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
268026fb53Sragge  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
278026fb53Sragge  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
288026fb53Sragge  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
298026fb53Sragge  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
308026fb53Sragge  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
318026fb53Sragge  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
328026fb53Sragge  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
338026fb53Sragge  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
348026fb53Sragge  * SUCH DAMAGE.
358026fb53Sragge  *
36d62187c0Scgd  *	@(#)vmparam.h	5.9 (Berkeley) 5/12/91
378026fb53Sragge  */
386c5df587Sragge #ifndef _VMPARAM_H_
396c5df587Sragge #define _VMPARAM_H_
406c5df587Sragge 
418026fb53Sragge /*
428026fb53Sragge  * Machine dependent constants for VAX.
438026fb53Sragge  */
448026fb53Sragge 
458026fb53Sragge /*
46fb508507Sthorpej  * We use 4K VM pages on the VAX.  Override the PAGE_* definitions
47fb508507Sthorpej  * to be compile-time constants.
48fb508507Sthorpej  */
49fb508507Sthorpej #define	PAGE_SHIFT	12
50fb508507Sthorpej #define	PAGE_SIZE	(1 << PAGE_SHIFT)
51fb508507Sthorpej #define	PAGE_MASK	(PAGE_SIZE - 1)
52fb508507Sthorpej 
53fb508507Sthorpej /*
5478ea2dd3Sthorpej  * USRSTACK is the top (end) of the user stack. Immediately above the
5578ea2dd3Sthorpej  * user stack resides kernel.
568026fb53Sragge  */
578026fb53Sragge 
589aea445dSragge #define USRSTACK	KERNBASE
598026fb53Sragge 
608026fb53Sragge /*
618026fb53Sragge  * Virtual memory related constants, all in bytes
628026fb53Sragge  */
638026fb53Sragge 
648026fb53Sragge #ifndef MAXTSIZ
656f049394Smartin #define MAXTSIZ		(32*1024*1024)		/* max text size */
668026fb53Sragge #endif
6721d5b938Sragge #ifndef DFLDSIZ
6821d5b938Sragge #define DFLDSIZ		(128*1024*1024)		/* initial data size limit */
6921d5b938Sragge #endif
7021d5b938Sragge #ifndef MAXDSIZ
71*4ee6ed16Sragge #define MAXDSIZ		(512*1024*1024)		/* max data size */
7221d5b938Sragge #endif
738026fb53Sragge #ifndef DFLSSIZ
748026fb53Sragge #define DFLSSIZ		(512*1024)		/* initial stack size limit */
758026fb53Sragge #endif
769d6e9407Sthorpej #ifndef MAXSSIZ
779d6e9407Sthorpej #define MAXSSIZ		(8*1024*1024)		/* max stack size */
789d6e9407Sthorpej #endif
798026fb53Sragge 
808e2874bfSragge #define VM_PHYSSEG_MAX		1
818e2874bfSragge #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH /* XXX */
828e2874bfSragge 
83d47ea67cSthorpej #define	VM_NFREELIST		1
84d47ea67cSthorpej #define	VM_FREELIST_DEFAULT	0
85d47ea67cSthorpej 
86cb57cab9Sragge /* MD round macros */
87cb57cab9Sragge #define	vax_round_page(x) (((vaddr_t)(x) + VAX_PGOFSET) & ~VAX_PGOFSET)
88cb57cab9Sragge #define	vax_trunc_page(x) ((vaddr_t)(x) & ~VAX_PGOFSET)
89cb57cab9Sragge 
908026fb53Sragge /*
918026fb53Sragge  * Mach derived constants
928026fb53Sragge  */
938026fb53Sragge 
948026fb53Sragge /* user/kernel map constants */
95e0df4ffcSmatt #define VM_MIN_ADDRESS		((vaddr_t)0)
96e0df4ffcSmatt #define VM_MAXUSER_ADDRESS	((vaddr_t)KERNBASE)
97e0df4ffcSmatt #define VM_MAX_ADDRESS		((vaddr_t)KERNBASE)
98e0df4ffcSmatt #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)
99e0df4ffcSmatt #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0xC0000000))
1008026fb53Sragge 
10157fa6bb8Sragge #define __USE_TOPDOWN_VM
10221d5b938Sragge 
103e8c7c2f8Smatt #define	USRIOSIZE		(8 * VAX_NPTEPG)	/* 512MB */
104e8c7c2f8Smatt #define	VM_PHYS_SIZE		(USRIOSIZE*VAX_NBPG)
105e8c7c2f8Smatt 
1066c5df587Sragge #endif
107