xref: /openbsd/sys/arch/sh/include/vmparam.h (revision 62fe2d4b)
1*62fe2d4bSmiod /*	$OpenBSD: vmparam.h,v 1.10 2014/01/30 18:16:41 miod Exp $	*/
295c7671fSmiod /*	$NetBSD: vmparam.h,v 1.17 2006/03/04 01:55:03 uwe Exp $	*/
395c7671fSmiod 
495c7671fSmiod /*-
595c7671fSmiod  * Copyright (c) 2002 The NetBSD Foundation, Inc.
695c7671fSmiod  * All rights reserved.
795c7671fSmiod  *
895c7671fSmiod  * This code is derived from software contributed to The NetBSD Foundation
995c7671fSmiod  * by UCHIYAMA Yasushi.
1095c7671fSmiod  *
1195c7671fSmiod  * Redistribution and use in source and binary forms, with or without
1295c7671fSmiod  * modification, are permitted provided that the following conditions
1395c7671fSmiod  * are met:
1495c7671fSmiod  * 1. Redistributions of source code must retain the above copyright
1595c7671fSmiod  *    notice, this list of conditions and the following disclaimer.
1695c7671fSmiod  * 2. Redistributions in binary form must reproduce the above copyright
1795c7671fSmiod  *    notice, this list of conditions and the following disclaimer in the
1895c7671fSmiod  *    documentation and/or other materials provided with the distribution.
1995c7671fSmiod  *
2095c7671fSmiod  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2195c7671fSmiod  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2295c7671fSmiod  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2395c7671fSmiod  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2495c7671fSmiod  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2595c7671fSmiod  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2695c7671fSmiod  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2795c7671fSmiod  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2895c7671fSmiod  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2995c7671fSmiod  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3095c7671fSmiod  * POSSIBILITY OF SUCH DAMAGE.
3195c7671fSmiod  */
3295c7671fSmiod 
3395c7671fSmiod #ifndef _SH_VMPARAM_H_
3495c7671fSmiod #define	_SH_VMPARAM_H_
3595c7671fSmiod #include <sys/queue.h>
3695c7671fSmiod 
3795c7671fSmiod /* Virtual address map. */
38b5da920cSderaadt #define	VM_MIN_ADDRESS		((vaddr_t)PAGE_SIZE)
3995c7671fSmiod #define	VM_MAXUSER_ADDRESS	((vaddr_t)0x7ffff000)
4095c7671fSmiod #define	VM_MAX_ADDRESS		((vaddr_t)0x7ffff000)
4195c7671fSmiod #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xc0000000)
4295c7671fSmiod #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xe0000000)
4395c7671fSmiod 
4431af9a24Skurt /* map PIE below 4MB (non-pie link address) to avoid mmap pressure */
4531af9a24Skurt #define VM_PIE_MIN_ADDR		PAGE_SIZE
4631af9a24Skurt #define VM_PIE_MAX_ADDR		0x400000UL
4731af9a24Skurt 
4895c7671fSmiod /* top of stack */
4995c7671fSmiod #define	USRSTACK		VM_MAXUSER_ADDRESS
5095c7671fSmiod 
51e1f31333Shshoexer /* Virtual memory resource limit. */
5295c7671fSmiod #define	MAXTSIZ			(64 * 1024 * 1024)	/* max text size */
5395c7671fSmiod #ifndef MAXDSIZ
5495c7671fSmiod #define	MAXDSIZ			(512 * 1024 * 1024)	/* max data size */
5595c7671fSmiod #endif
5601d0831fStedu #ifndef BRKSIZ
5701d0831fStedu #define	BRKSIZ			MAXDSIZ			/* heap gap size */
5801d0831fStedu #endif
5995c7671fSmiod #ifndef	MAXSSIZ
6095c7671fSmiod #define	MAXSSIZ			(32 * 1024 * 1024)	/* max stack size */
6195c7671fSmiod #endif
6295c7671fSmiod 
6395c7671fSmiod /* initial data size limit */
6495c7671fSmiod #ifndef DFLDSIZ
6595c7671fSmiod #define	DFLDSIZ			(128 * 1024 * 1024)
6695c7671fSmiod #endif
6795c7671fSmiod /* initial stack size limit */
6895c7671fSmiod #ifndef	DFLSSIZ
6995c7671fSmiod #define	DFLSSIZ			(2 * 1024 * 1024)
7095c7671fSmiod #endif
7195c7671fSmiod 
7295c7671fSmiod #define	STACKGAP_RANDOM		(256 * 1024)
7395c7671fSmiod 
7495c7671fSmiod /*
7595c7671fSmiod  * Size of shared memory map
7695c7671fSmiod  */
7795c7671fSmiod #ifndef SHMMAXPGS
7895c7671fSmiod #define	SHMMAXPGS		1024
7995c7671fSmiod #endif
8095c7671fSmiod 
8195c7671fSmiod /* Size of user raw I/O map */
8295c7671fSmiod #ifndef USRIOSIZE
8395c7671fSmiod #define	USRIOSIZE		(MAXBSIZE / PAGE_SIZE * 8)
8495c7671fSmiod #endif
8595c7671fSmiod 
8695c7671fSmiod #define	VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
8795c7671fSmiod 
8895c7671fSmiod #endif /* !_SH_VMPARAM_H_ */
89