xref: /openbsd/sys/arch/macppc/include/vmparam.h (revision a201ab69)
1*a201ab69Stedu /*	$OpenBSD: vmparam.h,v 1.30 2015/02/10 10:02:55 tedu Exp $	*/
252c13d20Sdrahn /*	$NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $	*/
352c13d20Sdrahn 
452c13d20Sdrahn /*-
552c13d20Sdrahn  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
652c13d20Sdrahn  * Copyright (C) 1995, 1996 TooLs GmbH.
752c13d20Sdrahn  * All rights reserved.
852c13d20Sdrahn  *
952c13d20Sdrahn  * Redistribution and use in source and binary forms, with or without
1052c13d20Sdrahn  * modification, are permitted provided that the following conditions
1152c13d20Sdrahn  * are met:
1252c13d20Sdrahn  * 1. Redistributions of source code must retain the above copyright
1352c13d20Sdrahn  *    notice, this list of conditions and the following disclaimer.
1452c13d20Sdrahn  * 2. Redistributions in binary form must reproduce the above copyright
1552c13d20Sdrahn  *    notice, this list of conditions and the following disclaimer in the
1652c13d20Sdrahn  *    documentation and/or other materials provided with the distribution.
1752c13d20Sdrahn  * 3. All advertising materials mentioning features or use of this software
1852c13d20Sdrahn  *    must display the following acknowledgement:
1952c13d20Sdrahn  *	This product includes software developed by TooLs GmbH.
2052c13d20Sdrahn  * 4. The name of TooLs GmbH may not be used to endorse or promote products
2152c13d20Sdrahn  *    derived from this software without specific prior written permission.
2252c13d20Sdrahn  *
2352c13d20Sdrahn  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
2452c13d20Sdrahn  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2552c13d20Sdrahn  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2652c13d20Sdrahn  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2752c13d20Sdrahn  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2852c13d20Sdrahn  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2952c13d20Sdrahn  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3052c13d20Sdrahn  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3152c13d20Sdrahn  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3252c13d20Sdrahn  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3352c13d20Sdrahn  */
3452c13d20Sdrahn 
3552c13d20Sdrahn #ifndef MACHINE_VMPARAM_H
3652c13d20Sdrahn #define MACHINE_VMPARAM_H
3752c13d20Sdrahn 
3852c13d20Sdrahn #define	USRTEXT		PAGE_SIZE
3952c13d20Sdrahn #define	USRSTACK	VM_MAXUSER_ADDRESS
4052c13d20Sdrahn 
4152c13d20Sdrahn #ifndef	MAXTSIZ
4265a37b56Smarco #define	MAXTSIZ		(64*1024*1024)		/* max text size */
4352c13d20Sdrahn #endif
4452c13d20Sdrahn 
4552c13d20Sdrahn #ifndef	DFLDSIZ
4665a37b56Smarco #define	DFLDSIZ		(64*1024*1024)		/* default data size */
4752c13d20Sdrahn #endif
4852c13d20Sdrahn 
4952c13d20Sdrahn #ifndef	MAXDSIZ
504e38a0c4Sajacoutot #define	MAXDSIZ		(2UL*1024*1024*1024)	/* max data size */
5152c13d20Sdrahn #endif
5252c13d20Sdrahn 
5301d0831fStedu #ifndef BRKSIZ
5401d0831fStedu #define	BRKSIZ		MAXDSIZ			/* heap gap size */
5501d0831fStedu #endif
5601d0831fStedu 
5752c13d20Sdrahn #ifndef	DFLSSIZ
58cfd52802Sbrad #define	DFLSSIZ		(2*1024*1024)		/* default stack size */
5952c13d20Sdrahn #endif
6052c13d20Sdrahn 
6152c13d20Sdrahn #ifndef	MAXSSIZ
6252c13d20Sdrahn #define	MAXSSIZ		(32*1024*1024)		/* max stack size */
6352c13d20Sdrahn #endif
6452c13d20Sdrahn 
65a489ea08Sderaadt #define STACKGAP_RANDOM	256*1024
66a489ea08Sderaadt 
6752c13d20Sdrahn /*
6852c13d20Sdrahn  * Size of shared memory map
6952c13d20Sdrahn  */
7052c13d20Sdrahn #ifndef	SHMMAXPGS
7147adadefSmillert #define	SHMMAXPGS       8192			/* 32mb */
7252c13d20Sdrahn #endif
7352c13d20Sdrahn 
7452c13d20Sdrahn /*
7552c13d20Sdrahn  * Size of User Raw I/O map
7652c13d20Sdrahn  */
7752c13d20Sdrahn #define	USRIOSIZE	1024
7852c13d20Sdrahn 
7952c13d20Sdrahn /*
8052c13d20Sdrahn  * Would like to have MAX addresses = 0, but this doesn't (currently) work
8152c13d20Sdrahn  */
82*a201ab69Stedu #define	VM_MIN_ADDRESS		((vaddr_t)PAGE_SIZE)
83e02071cfSmiod #define	VM_MAXUSER_ADDRESS	((vaddr_t)0xfffff000)
8452c13d20Sdrahn #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
85e02071cfSmiod #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)(PPC_KERNEL_SR << ADDR_SR_SHIFT))
8652c13d20Sdrahn 
87c62276a4Skurt /* map PIE into approximately the first quarter of user va space */
88c62276a4Skurt #define VM_PIE_MIN_ADDR		PAGE_SIZE
89c62276a4Skurt #define VM_PIE_MAX_ADDR		0x40000000
90c62276a4Skurt 
91e8788ae9Sdrahn /* ppc_kvm_stolen is so that vm space can be stolen before vm is fully
9252c13d20Sdrahn  * initialized.
9352c13d20Sdrahn  */
94e02071cfSmiod extern vaddr_t ppc_kvm_stolen;
953d1403a8Sdrahn #define VM_KERN_ADDRESS_SIZE  (PPC_SEGMENT_LENGTH - (32 * 1024 * 1024))
96e8788ae9Sdrahn #define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + VM_KERN_ADDRESS_SIZE)
9752c13d20Sdrahn 
9852c13d20Sdrahn #define	VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
9952c13d20Sdrahn 
10052c13d20Sdrahn #define	VM_PHYSSEG_MAX	32	/* actually we could have this many segments */
10152c13d20Sdrahn #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
10252c13d20Sdrahn #define	VM_PHYSSEG_NOADD	/* can't add RAM after vm_mem_init */
10352c13d20Sdrahn 
10469b9ef50Sdrahn #endif
105