Home | History | Annotate | Line # | Download | only in include
vmparam.h revision 1.19.2.5
      1  1.19.2.5  nathanw /*	$NetBSD: vmparam.h,v 1.19.2.5 2002/04/17 00:04:30 nathanw Exp $ */
      2  1.19.2.2   petrov 
      3  1.19.2.2   petrov /*
      4  1.19.2.2   petrov  * Copyright (c) 1992, 1993
      5  1.19.2.2   petrov  *	The Regents of the University of California.  All rights reserved.
      6  1.19.2.2   petrov  *
      7  1.19.2.2   petrov  * This software was developed by the Computer Systems Engineering group
      8  1.19.2.2   petrov  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
      9  1.19.2.2   petrov  * contributed to Berkeley.
     10  1.19.2.2   petrov  *
     11  1.19.2.2   petrov  * All advertising materials mentioning features or use of this software
     12  1.19.2.2   petrov  * must display the following acknowledgement:
     13  1.19.2.2   petrov  *	This product includes software developed by the University of
     14  1.19.2.2   petrov  *	California, Lawrence Berkeley Laboratory.
     15  1.19.2.2   petrov  *
     16  1.19.2.2   petrov  * Redistribution and use in source and binary forms, with or without
     17  1.19.2.2   petrov  * modification, are permitted provided that the following conditions
     18  1.19.2.2   petrov  * are met:
     19  1.19.2.2   petrov  * 1. Redistributions of source code must retain the above copyright
     20  1.19.2.2   petrov  *    notice, this list of conditions and the following disclaimer.
     21  1.19.2.2   petrov  * 2. Redistributions in binary form must reproduce the above copyright
     22  1.19.2.2   petrov  *    notice, this list of conditions and the following disclaimer in the
     23  1.19.2.2   petrov  *    documentation and/or other materials provided with the distribution.
     24  1.19.2.2   petrov  * 3. All advertising materials mentioning features or use of this software
     25  1.19.2.2   petrov  *    must display the following acknowledgement:
     26  1.19.2.2   petrov  *	This product includes software developed by the University of
     27  1.19.2.2   petrov  *	California, Berkeley and its contributors.
     28  1.19.2.2   petrov  * 4. Neither the name of the University nor the names of its contributors
     29  1.19.2.2   petrov  *    may be used to endorse or promote products derived from this software
     30  1.19.2.2   petrov  *    without specific prior written permission.
     31  1.19.2.2   petrov  *
     32  1.19.2.2   petrov  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     33  1.19.2.2   petrov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     34  1.19.2.2   petrov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     35  1.19.2.2   petrov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     36  1.19.2.2   petrov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     37  1.19.2.2   petrov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     38  1.19.2.2   petrov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     39  1.19.2.2   petrov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     40  1.19.2.2   petrov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     41  1.19.2.2   petrov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     42  1.19.2.2   petrov  * SUCH DAMAGE.
     43  1.19.2.2   petrov  *
     44  1.19.2.2   petrov  *	@(#)vmparam.h	8.1 (Berkeley) 6/11/93
     45  1.19.2.2   petrov  */
     46  1.19.2.2   petrov 
     47  1.19.2.2   petrov /*
     48  1.19.2.2   petrov  * Machine dependent constants for Sun-4c SPARC
     49  1.19.2.2   petrov  */
     50  1.19.2.2   petrov 
     51  1.19.2.2   petrov #ifndef VMPARAM_H
     52  1.19.2.2   petrov #define VMPARAM_H
     53  1.19.2.2   petrov 
     54  1.19.2.2   petrov /*
     55  1.19.2.2   petrov  * USRTEXT is the start of the user text/data space, while USRSTACK
     56  1.19.2.2   petrov  * is the top (end) of the user stack.
     57  1.19.2.2   petrov  */
     58  1.19.2.2   petrov #define	USRTEXT		0x2000			/* Start of user text */
     59  1.19.2.2   petrov #define USRSTACK32	0xffffe000L
     60  1.19.2.2   petrov #ifdef __arch64__
     61  1.19.2.2   petrov #define USRSTACK	0xffffffffffffe000L
     62  1.19.2.2   petrov #else
     63  1.19.2.2   petrov #define USRSTACK	USRSTACK32
     64  1.19.2.2   petrov #endif
     65  1.19.2.2   petrov 
     66  1.19.2.2   petrov /*
     67  1.19.2.2   petrov  * Virtual memory related constants, all in bytes
     68  1.19.2.2   petrov  */
     69  1.19.2.2   petrov /* #ifdef __arch64__ */
     70  1.19.2.2   petrov #if 0
     71  1.19.2.2   petrov /*
     72  1.19.2.2   petrov  * 64-bit limits:
     73  1.19.2.2   petrov  *
     74  1.19.2.2   petrov  * Since the compiler generates `call' instructions we can't
     75  1.19.2.2   petrov  * have more than 4GB in a single text segment.
     76  1.19.2.2   petrov  *
     77  1.19.2.2   petrov  * And since we only have a 40-bit adderss space, allow half
     78  1.19.2.2   petrov  * of that for data and the other half for stack.
     79  1.19.2.2   petrov  */
     80  1.19.2.2   petrov #ifndef MAXTSIZ
     81  1.19.2.2   petrov #define	MAXTSIZ		(4L*1024*1024*1024)	/* max text size */
     82  1.19.2.2   petrov #endif
     83  1.19.2.2   petrov #ifndef DFLDSIZ
     84  1.19.2.2   petrov #define	DFLDSIZ		(128L*1024*1024)	/* initial data size limit */
     85  1.19.2.2   petrov #endif
     86  1.19.2.2   petrov #ifndef MAXDSIZ
     87  1.19.2.2   petrov #define	MAXDSIZ		(1L<<39)		/* max data size */
     88  1.19.2.2   petrov #endif
     89  1.19.2.2   petrov #ifndef	DFLSSIZ
     90  1.19.2.2   petrov #define	DFLSSIZ		(1024*1024)		/* initial stack size limit */
     91  1.19.2.2   petrov #endif
     92  1.19.2.2   petrov #ifndef	MAXSSIZ
     93  1.19.2.2   petrov #define	MAXSSIZ		MAXDSIZ			/* max stack size */
     94  1.19.2.2   petrov #endif
     95  1.19.2.2   petrov #else
     96  1.19.2.2   petrov /*
     97  1.19.2.2   petrov  * 32-bit limits:
     98  1.19.2.2   petrov  *
     99  1.19.2.2   petrov  * We only have 4GB to play with.  Limit stack, data, and text
    100  1.19.2.2   petrov  * each to half of that.
    101  1.19.2.2   petrov  *
    102  1.19.2.2   petrov  * This is silly.  Apparently if we go above these numbers
    103  1.19.2.2   petrov  * integer overflows in other parts of the kernel cause hangs.
    104  1.19.2.2   petrov  */
    105  1.19.2.2   petrov #ifndef MAXTSIZ
    106  1.19.2.2   petrov #define	MAXTSIZ		(1*1024*1024*1024)	/* max text size */
    107  1.19.2.2   petrov #endif
    108  1.19.2.2   petrov #ifndef DFLDSIZ
    109  1.19.2.2   petrov #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
    110  1.19.2.2   petrov #endif
    111  1.19.2.2   petrov #ifndef MAXDSIZ
    112  1.19.2.2   petrov #define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
    113  1.19.2.2   petrov #endif
    114  1.19.2.2   petrov #ifndef	DFLSSIZ
    115  1.19.2.2   petrov #define	DFLSSIZ		(1024*1024)		/* initial stack size limit */
    116  1.19.2.2   petrov #endif
    117  1.19.2.2   petrov #ifndef	MAXSSIZ
    118  1.19.2.2   petrov #define	MAXSSIZ		(8*1024*1024)			/* max stack size */
    119  1.19.2.2   petrov #endif
    120  1.19.2.2   petrov #endif
    121  1.19.2.2   petrov /*
    122  1.19.2.2   petrov  * Size of shared memory map
    123  1.19.2.2   petrov  */
    124  1.19.2.2   petrov #ifndef SHMMAXPGS
    125  1.19.2.2   petrov #define SHMMAXPGS	1024
    126  1.19.2.2   petrov #endif
    127  1.19.2.2   petrov 
    128  1.19.2.2   petrov /*
    129  1.19.2.2   petrov  * Mach derived constants
    130  1.19.2.2   petrov  */
    131  1.19.2.2   petrov 
    132  1.19.2.2   petrov /*
    133  1.19.2.2   petrov  * User/kernel map constants.
    134  1.19.2.2   petrov  */
    135  1.19.2.2   petrov #define VM_MIN_ADDRESS		((vaddr_t)0)
    136  1.19.2.2   petrov #define VM_MAX_ADDRESS		((vaddr_t)-1)
    137  1.19.2.2   petrov #define VM_MAXUSER_ADDRESS	((vaddr_t)-1)
    138  1.19.2.2   petrov #define VM_MAXUSER_ADDRESS32	((vaddr_t)(0x00000000ffffffffL&~PGOFSET))
    139  1.19.2.2   petrov 
    140  1.19.2.2   petrov #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)
    141  1.19.2.2   petrov #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)KERNEND)
    142  1.19.2.2   petrov 
    143  1.19.2.2   petrov #define VM_PHYSSEG_MAX          32       /* up to 32 segments */
    144  1.19.2.2   petrov #define VM_PHYSSEG_STRAT        VM_PSTRAT_BSEARCH
    145  1.19.2.2   petrov #define VM_PHYSSEG_NOADD                /* can't add RAM after vm_mem_init */
    146  1.19.2.2   petrov 
    147  1.19.2.2   petrov #define	VM_NFREELIST		1
    148  1.19.2.2   petrov #define	VM_FREELIST_DEFAULT	0
    149  1.19.2.2   petrov 
    150  1.19.2.2   petrov #define	__HAVE_PMAP_PHYSSEG
    151  1.19.2.2   petrov 
    152  1.19.2.2   petrov /*
    153  1.19.2.2   petrov  * pmap specific data stored in the vm_physmem[] array
    154  1.19.2.2   petrov  */
    155  1.19.2.2   petrov 
    156  1.19.2.2   petrov struct pmap_physseg {
    157  1.19.2.2   petrov 	struct pv_entry *pvent;
    158  1.19.2.2   petrov };
    159  1.19.2.2   petrov 
    160  1.19.2.2   petrov #if defined (_KERNEL) && !defined(_LOCORE)
    161  1.19.2.2   petrov struct vm_map;
    162  1.19.2.2   petrov vaddr_t		dvma_mapin __P((struct vm_map *, vaddr_t, int, int));
    163  1.19.2.2   petrov void		dvma_mapout __P((vaddr_t, vaddr_t, int));
    164  1.19.2.2   petrov #endif
    165  1.19.2.2   petrov #endif
    166