xref: /minix3/sys/arch/arm/include/arm32/vmparam.h (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc /*	$NetBSD: vmparam.h,v 1.29 2013/02/27 17:50:07 matt Exp $	*/
281473dbbSBen Gras 
381473dbbSBen Gras /*
481473dbbSBen Gras  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
581473dbbSBen Gras  * All rights reserved.
681473dbbSBen Gras  *
781473dbbSBen Gras  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
881473dbbSBen Gras  *
981473dbbSBen Gras  * Redistribution and use in source and binary forms, with or without
1081473dbbSBen Gras  * modification, are permitted provided that the following conditions
1181473dbbSBen Gras  * are met:
1281473dbbSBen Gras  * 1. Redistributions of source code must retain the above copyright
1381473dbbSBen Gras  *    notice, this list of conditions and the following disclaimer.
1481473dbbSBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
1581473dbbSBen Gras  *    notice, this list of conditions and the following disclaimer in the
1681473dbbSBen Gras  *    documentation and/or other materials provided with the distribution.
1781473dbbSBen Gras  * 3. All advertising materials mentioning features or use of this software
1881473dbbSBen Gras  *    must display the following acknowledgement:
1981473dbbSBen Gras  *	This product includes software developed for the NetBSD Project by
2081473dbbSBen Gras  *	Wasabi Systems, Inc.
2181473dbbSBen Gras  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
2281473dbbSBen Gras  *    or promote products derived from this software without specific prior
2381473dbbSBen Gras  *    written permission.
2481473dbbSBen Gras  *
2581473dbbSBen Gras  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
2681473dbbSBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2781473dbbSBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2881473dbbSBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
2981473dbbSBen Gras  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3081473dbbSBen Gras  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3181473dbbSBen Gras  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3281473dbbSBen Gras  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3381473dbbSBen Gras  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3481473dbbSBen Gras  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3581473dbbSBen Gras  * POSSIBILITY OF SUCH DAMAGE.
3681473dbbSBen Gras  */
3781473dbbSBen Gras 
38f6aac1c3SLionel Sambuc #ifndef _ARM_ARM32_VMPARAM_H_
39f6aac1c3SLionel Sambuc #define	_ARM_ARM32_VMPARAM_H_
40f6aac1c3SLionel Sambuc 
4181473dbbSBen Gras #if defined(_KERNEL) || defined(_KMEMUSER) || defined(__minix)
4281473dbbSBen Gras 
43f6aac1c3SLionel Sambuc /*
44f6aac1c3SLionel Sambuc  * Virtual Memory parameters common to all arm32 platforms.
45f6aac1c3SLionel Sambuc  */
46f6aac1c3SLionel Sambuc 
4781473dbbSBen Gras #ifndef __ASSEMBLER__
4881473dbbSBen Gras #include <sys/simplelock.h>	/* struct simplelock */
4981473dbbSBen Gras #endif /* __ASSEMBLER__ */
5081473dbbSBen Gras #include <arm/arm32/pte.h>	/* pt_entry_t */
5181473dbbSBen Gras 
5281473dbbSBen Gras #define	USRSTACK	VM_MAXUSER_ADDRESS
5381473dbbSBen Gras 
5481473dbbSBen Gras /*
5581473dbbSBen Gras  * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler
5681473dbbSBen Gras  * would have to be changed to not generate "bl" instructions.
5781473dbbSBen Gras  */
58*84d9c625SLionel Sambuc #define	MAXTSIZ		(64*1024*1024)		/* max text size */
5981473dbbSBen Gras #ifndef	DFLDSIZ
6081473dbbSBen Gras #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
6181473dbbSBen Gras #endif
6281473dbbSBen Gras #ifndef	MAXDSIZ
63*84d9c625SLionel Sambuc #define	MAXDSIZ		(1024*1024*1024)	/* max data size */
6481473dbbSBen Gras #endif
6581473dbbSBen Gras #ifndef	DFLSSIZ
6681473dbbSBen Gras #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
6781473dbbSBen Gras #endif
6881473dbbSBen Gras #ifndef	MAXSSIZ
69*84d9c625SLionel Sambuc #define	MAXSSIZ		(32*1024*1024)		/* max stack size */
7081473dbbSBen Gras #endif
7181473dbbSBen Gras 
7281473dbbSBen Gras /*
7381473dbbSBen Gras  * While the ARM architecture defines Section mappings, large pages,
7481473dbbSBen Gras  * and small pages, the standard page size is (and will always be) 4K.
7581473dbbSBen Gras  */
76*84d9c625SLionel Sambuc #define	PAGE_SHIFT	PGSHIFT
77f6aac1c3SLionel Sambuc #define	PAGE_SIZE	(1 << PAGE_SHIFT)
78f6aac1c3SLionel Sambuc #define	PAGE_MASK	(PAGE_SIZE - 1)
79f6aac1c3SLionel Sambuc 
8081473dbbSBen Gras /*
8181473dbbSBen Gras  * Mach derived constants
8281473dbbSBen Gras  */
8381473dbbSBen Gras #define	VM_MIN_ADDRESS		((vaddr_t) 0x00001000)
8481473dbbSBen Gras #define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - 0x1000)
8581473dbbSBen Gras #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
8681473dbbSBen Gras 
8781473dbbSBen Gras #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)
8881473dbbSBen Gras #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) 0xffffefff)
8981473dbbSBen Gras 
9081473dbbSBen Gras #ifndef __ASSEMBLER__
9181473dbbSBen Gras /* XXX max. amount of KVM to be used by buffers. */
9281473dbbSBen Gras #ifndef VM_MAX_KERNEL_BUF
9381473dbbSBen Gras extern vaddr_t virtual_avail;
9481473dbbSBen Gras extern vaddr_t virtual_end;
9581473dbbSBen Gras 
9681473dbbSBen Gras #define	VM_MAX_KERNEL_BUF	\
9781473dbbSBen Gras 	((virtual_end - virtual_avail) * 4 / 10)
9881473dbbSBen Gras #endif
9981473dbbSBen Gras #endif /* __ASSEMBLER__ */
10081473dbbSBen Gras 
10181473dbbSBen Gras #endif /* _KERNEL || _KMEMUSER */
10281473dbbSBen Gras 
103f6aac1c3SLionel Sambuc #endif /* _ARM_ARM32_VMPARAM_H_ */
104