Home | History | Annotate | Line # | Download | only in include
param.h revision 1.2.4.1
      1  1.2.4.1  nathanw /*	$NetBSD: param.h,v 1.2.4.1 2001/06/21 19:17:53 nathanw Exp $	*/
      2      1.1       is 
      3      1.1       is /*
      4      1.1       is  * Copyright (c) 1988 University of Utah.
      5      1.1       is  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
      6      1.1       is  * All rights reserved.
      7      1.1       is  *
      8      1.1       is  * This code is derived from software contributed to Berkeley by
      9      1.1       is  * the Systems Programming Group of the University of Utah Computer
     10      1.1       is  * Science Department.
     11      1.1       is  *
     12      1.1       is  * Redistribution and use in source and binary forms, with or without
     13      1.1       is  * modification, are permitted provided that the following conditions
     14      1.1       is  * are met:
     15      1.1       is  * 1. Redistributions of source code must retain the above copyright
     16      1.1       is  *    notice, this list of conditions and the following disclaimer.
     17      1.1       is  * 2. Redistributions in binary form must reproduce the above copyright
     18      1.1       is  *    notice, this list of conditions and the following disclaimer in the
     19      1.1       is  *    documentation and/or other materials provided with the distribution.
     20      1.1       is  * 3. All advertising materials mentioning features or use of this software
     21      1.1       is  *    must display the following acknowledgement:
     22      1.1       is  *	This product includes software developed by the University of
     23      1.1       is  *	California, Berkeley and its contributors.
     24      1.1       is  * 4. Neither the name of the University nor the names of its contributors
     25      1.1       is  *    may be used to endorse or promote products derived from this software
     26      1.1       is  *    without specific prior written permission.
     27      1.1       is  *
     28      1.1       is  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     29      1.1       is  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     30      1.1       is  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     31      1.1       is  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     32      1.1       is  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     33      1.1       is  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     34      1.1       is  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     35      1.1       is  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     36      1.1       is  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     37      1.1       is  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     38      1.1       is  * SUCH DAMAGE.
     39      1.1       is  *
     40      1.1       is  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
     41      1.1       is  *
     42      1.1       is  *	@(#)param.h	7.8 (Berkeley) 6/28/91
     43      1.1       is  */
     44      1.1       is 
     45      1.1       is #ifndef	_MACHINE_PARAM_H_
     46      1.1       is #define	_MACHINE_PARAM_H_
     47      1.1       is 
     48      1.1       is #ifdef	_KERNEL
     49      1.1       is #ifndef	_LOCORE
     50      1.1       is #include <machine/cpu.h>
     51      1.1       is #endif	/* _LOCORE */
     52      1.1       is #endif
     53      1.1       is 
     54      1.1       is /*
     55      1.1       is  * Machine dependent constants for Amiga PowerPC (32-bit only currently)
     56      1.1       is  */
     57      1.1       is #define	MACHINE		"amigappc"
     58      1.1       is #define MACHINE_ARCH	"powerpc"
     59      1.1       is #define	MID_MACHINE	MID_POWERPC
     60      1.1       is 
     61      1.1       is #define	ALIGNBYTES		(sizeof(double) - 1)
     62      1.1       is #define	ALIGN(p)		(((u_int)(p) + ALIGNBYTES) & ~ALIGNBYTES)
     63      1.1       is #define ALIGNED_POINTER(p,t)	((((u_long)(p)) & (sizeof(t)-1)) == 0)
     64      1.1       is 
     65      1.1       is #define	PGSHIFT		12
     66      1.1       is #define	NBPG		(1 << PGSHIFT)	/* Page size */
     67      1.1       is #define	PGOFSET		(NBPG - 1)
     68      1.1       is 
     69      1.1       is #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
     70      1.1       is #define	DEV_BSIZE	(1 << DEV_BSHIFT)
     71      1.1       is #define	BLKDEV_IOSIZE	NBPG
     72      1.1       is #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
     73      1.1       is 
     74      1.1       is #define	UPAGES		4
     75      1.1       is #define	USPACE		(UPAGES * NBPG)
     76      1.1       is 
     77      1.1       is #ifndef	MSGBUFSIZE
     78      1.1       is #define	MSGBUFSIZE	NBPG		/* default message buffer size */
     79      1.1       is #endif
     80      1.1       is 
     81      1.1       is #define	KERNBASE	0x00000000	/* start of kernel virtual */
     82      1.1       is 
     83      1.1       is /*
     84      1.1       is  * Constants related to network buffer management.
     85      1.1       is  * MCLBYTES must be no larger than NBPG (the software page size), and,
     86      1.1       is  * on machines that exchange pages of input or output buffers with mbuf
     87      1.1       is  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
     88      1.1       is  * of the hardware page size.
     89      1.1       is  */
     90      1.2   itojun #define	MSIZE		256		/* size of an mbuf */
     91      1.1       is #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
     92      1.1       is #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
     93      1.1       is 
     94      1.1       is #ifndef NMBCLUSTERS
     95      1.1       is 
     96  1.2.4.1  nathanw #if defined(_KERNEL_OPT)
     97      1.1       is #include "opt_gateway.h"
     98  1.2.4.1  nathanw #endif
     99      1.1       is 
    100      1.1       is #ifdef GATEWAY
    101      1.1       is #define	NMBCLUSTERS	512		/* map size, max cluster allocation */
    102      1.1       is #else
    103      1.1       is #define	NMBCLUSTERS	256		/* map size, max cluster allocation */
    104      1.1       is #endif
    105      1.1       is #endif
    106      1.1       is 
    107      1.1       is /*
    108      1.1       is  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
    109      1.1       is  * logical pages.
    110      1.1       is  */
    111      1.1       is #define NKMEMPAGES_MIN_DEFAULT  ((128 * 1024 * 1024) >> PAGE_SHIFT)
    112      1.1       is #define NKMEMPAGES_MAX_DEFAULT  ((128 * 1024 * 1024) >> PAGE_SHIFT)
    113      1.1       is 
    114      1.1       is /*
    115      1.1       is  * pages ("clicks") to disk blocks
    116      1.1       is  */
    117      1.1       is #define	ctod(x)		((x) << (PGSHIFT - DEV_BSHIFT))
    118      1.1       is #define	dtoc(x)		((x) >> (PGSHIFT - DEV_BSHIFT))
    119      1.1       is /*
    120      1.1       is  * bytes to pages
    121      1.1       is  */
    122      1.1       is #define	ctob(x)		((x) << PGSHIFT)
    123      1.1       is #define	btoc(x)		(((x) + PGOFSET) >> PGSHIFT)
    124      1.1       is 
    125      1.1       is /*
    126      1.1       is  * bytes to disk blocks
    127      1.1       is  */
    128      1.1       is #define	dbtob(x)	((x) << DEV_BSHIFT)
    129      1.1       is #define	btodb(x)	((x) >> DEV_BSHIFT)
    130      1.1       is 
    131      1.1       is /*
    132      1.1       is  * Segment handling stuff
    133      1.1       is  */
    134      1.1       is #define	SEGMENT_LENGTH	0x10000000
    135      1.1       is #define	SEGMENT_MASK	0xf0000000
    136      1.1       is 
    137      1.1       is /*
    138      1.1       is  * Fixed segments
    139      1.1       is  */
    140      1.1       is #define	USER_SR		13
    141      1.1       is #define	KERNEL_SR	14
    142      1.1       is #define	KERNEL_SEGMENT	(0xf0000 + KERNEL_SR)
    143      1.1       is #define	EMPTY_SEGMENT	0xfffff0
    144      1.1       is #define	USER_ADDR	((void *)(USER_SR << ADDR_SR_SHFT))
    145      1.1       is 
    146      1.1       is /*
    147      1.1       is  * Some system constants
    148      1.1       is  */
    149      1.1       is #ifndef	NPMAPS
    150      1.1       is #define	NPMAPS		32768	/* Number of pmaps in system */
    151      1.1       is #endif
    152      1.1       is 
    153      1.1       is #ifdef	_KERNEL
    154      1.1       is /*
    155      1.1       is  * point to the custom.intenar and custom.intenaw respectively.
    156      1.1       is extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
    157      1.1       is */
    158      1.1       is 
    159      1.1       is /* ADAM: redefiniton of cpu.h */
    160      1.1       is /*
    161      1.1       is #ifndef	_LOCORE
    162      1.1       is void delay __P((int));
    163      1.1       is void DELAY __P((int));
    164      1.1       is #endif*/	/* !_LOCORE */
    165      1.1       is #endif	/* _KERNEL */
    166      1.1       is 
    167      1.1       is #endif /* def _MACHINE_PARAM_H_ */
    168