Home | History | Annotate | Line # | Download | only in include
param.h revision 1.8
      1  1.8      para /*	$NetBSD: param.h,v 1.8 2012/02/10 17:35:49 para Exp $	*/
      2  1.1    cherry 
      3  1.1    cherry /*-
      4  1.1    cherry  * Copyright (c) 1990 The Regents of the University of California.
      5  1.1    cherry  * All rights reserved.
      6  1.1    cherry  *
      7  1.1    cherry  * This code is derived from software contributed to Berkeley by
      8  1.1    cherry  * William Jolitz.
      9  1.1    cherry  *
     10  1.1    cherry  * Redistribution and use in source and binary forms, with or without
     11  1.1    cherry  * modification, are permitted provided that the following conditions
     12  1.1    cherry  * are met:
     13  1.1    cherry  * 1. Redistributions of source code must retain the above copyright
     14  1.1    cherry  *    notice, this list of conditions and the following disclaimer.
     15  1.1    cherry  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1    cherry  *    notice, this list of conditions and the following disclaimer in the
     17  1.1    cherry  *    documentation and/or other materials provided with the distribution.
     18  1.1    cherry  * 3. Neither the name of the University nor the names of its contributors
     19  1.1    cherry  *    may be used to endorse or promote products derived from this software
     20  1.1    cherry  *    without specific prior written permission.
     21  1.1    cherry  *
     22  1.1    cherry  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  1.1    cherry  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  1.1    cherry  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  1.1    cherry  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26  1.1    cherry  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  1.1    cherry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  1.1    cherry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  1.1    cherry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  1.1    cherry  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  1.1    cherry  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  1.1    cherry  * SUCH DAMAGE.
     33  1.1    cherry  *
     34  1.1    cherry  *	@(#)param.h	5.8 (Berkeley) 6/28/91
     35  1.1    cherry  */
     36  1.1    cherry 
     37  1.1    cherry #ifndef _IA64_PARAM_H_
     38  1.1    cherry #define _IA64_PARAM_H_
     39  1.1    cherry 
     40  1.1    cherry /*
     41  1.1    cherry  * Machine dependent constants for Intel Itanium.
     42  1.1    cherry  */
     43  1.1    cherry 
     44  1.5       chs #ifdef _KERNEL
     45  1.5       chs #include <machine/cpu.h>
     46  1.5       chs #endif
     47  1.5       chs 
     48  1.1    cherry #define	_MACHINE	ia64
     49  1.1    cherry #define	MACHINE		"ia64"
     50  1.1    cherry #define	_MACHINE_ARCH	ia64
     51  1.1    cherry #define	MACHINE_ARCH	"ia64"
     52  1.1    cherry #define	MID_MACHINE	MID_IA64
     53  1.1    cherry 
     54  1.5       chs #ifdef MULTIPROCESSOR
     55  1.1    cherry #define	MAXCPU		16
     56  1.1    cherry #else
     57  1.1    cherry #define MAXCPU		1
     58  1.1    cherry #endif
     59  1.1    cherry 
     60  1.1    cherry #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
     61  1.1    cherry #define	DEV_BSIZE	(1<<DEV_BSHIFT)
     62  1.1    cherry #define	BLKDEV_IOSIZE	2048
     63  1.1    cherry 
     64  1.1    cherry #ifndef MAXPHYS
     65  1.1    cherry #define MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
     66  1.1    cherry #endif
     67  1.1    cherry 
     68  1.1    cherry #define UPAGES		4
     69  1.1    cherry #define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
     70  1.1    cherry 
     71  1.1    cherry #ifndef MSGBUFSIZE
     72  1.1    cherry #define MSGBUFSIZE	NBPG		/* default message buffer size */
     73  1.1    cherry #endif
     74  1.1    cherry 
     75  1.1    cherry #ifndef	KSTACK_PAGES
     76  1.1    cherry #define	KSTACK_PAGES	4		/* pages of kernel stack */
     77  1.1    cherry #endif
     78  1.1    cherry #define	KSTACK_GUARD_PAGES 0		/* pages of kstack guard; 0 disables */
     79  1.1    cherry 
     80  1.1    cherry #define ALIGNBYTES32		(sizeof(int) - 1)
     81  1.1    cherry #define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
     82  1.1    cherry 
     83  1.1    cherry #define	PGSHIFT		14		/* LOG2(NBPG) */
     84  1.1    cherry #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
     85  1.1    cherry #define	PGOFSET		(NBPG-1)	/* byte offset into page */
     86  1.1    cherry #define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
     87  1.1    cherry /*
     88  1.1    cherry  * Constants related to network buffer management.
     89  1.1    cherry  * MCLBYTES must be no larger than NBPG (the software page size), and,
     90  1.1    cherry  * on machines that exchange pages of input or output buffers with mbuf
     91  1.1    cherry  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
     92  1.1    cherry  * of the hardware page size.
     93  1.1    cherry  */
     94  1.1    cherry #define	MSIZE		256		/* size of an mbuf */
     95  1.1    cherry 
     96  1.1    cherry #ifndef MCLSHIFT
     97  1.1    cherry #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
     98  1.1    cherry 					/* 2K cluster can hold Ether frame */
     99  1.1    cherry #endif	/* MCLSHIFT */
    100  1.1    cherry 
    101  1.1    cherry #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
    102  1.1    cherry 
    103  1.1    cherry /*
    104  1.1    cherry  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
    105  1.1    cherry  * logical pages.
    106  1.8      para  * No enforced maxmimum an ia64
    107  1.1    cherry  */
    108  1.8      para #define	NKMEMPAGES_MIN_DEFAULT	((32 * 1024 * 1024) >> PAGE_SHIFT)
    109  1.8      para #define	NKMEMPAGES_MAX_UNLIMITED 1
    110  1.1    cherry 
    111  1.1    cherry /*
    112  1.1    cherry  * Mach derived conversion macros
    113  1.1    cherry  */
    114  1.1    cherry 
    115  1.1    cherry #define ia64_round_page(x)   ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG - 1))
    116  1.1    cherry #define ia64_trunc_page(x)   ((unsigned long)(x) & ~(NBPG - 1))
    117  1.1    cherry 
    118  1.1    cherry #define ia64_btop(x)            ((unsigned long)(x) >> PGSHIFT)
    119  1.1    cherry #define ia64_ptob(x)            ((unsigned long)(x) << PGSHIFT)
    120  1.1    cherry 
    121  1.1    cherry #ifdef _KERNEL
    122  1.1    cherry #ifndef _LOCORE
    123  1.1    cherry 
    124  1.1    cherry #include <machine/intr.h>
    125  1.1    cherry 
    126  1.3  kiyohara static __inline void delay(unsigned int us) {}	/* XXXXX */
    127  1.3  kiyohara 
    128  1.1    cherry #endif /* _LOCORE */
    129  1.1    cherry #endif /* _KERNEL */
    130  1.1    cherry 
    131  1.1    cherry #endif /* _IA64_PARAM_H_ */
    132