param.h revision 1.22
11.22Stsutsui/*	$NetBSD: param.h,v 1.22 2005/10/30 07:53:16 tsutsui Exp $	*/
21.11Ssoda/*      $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
31.2Sthorpej
41.1Sjonathan/*
51.1Sjonathan * Copyright (c) 1992, 1993
61.1Sjonathan *	The Regents of the University of California.  All rights reserved.
71.19Sagc *
81.19Sagc * This code is derived from software contributed to Berkeley by
91.19Sagc * the Systems Programming Group of the University of Utah Computer
101.19Sagc * Science Department and Ralph Campbell.
111.19Sagc *
121.19Sagc * Redistribution and use in source and binary forms, with or without
131.19Sagc * modification, are permitted provided that the following conditions
141.19Sagc * are met:
151.19Sagc * 1. Redistributions of source code must retain the above copyright
161.19Sagc *    notice, this list of conditions and the following disclaimer.
171.19Sagc * 2. Redistributions in binary form must reproduce the above copyright
181.19Sagc *    notice, this list of conditions and the following disclaimer in the
191.19Sagc *    documentation and/or other materials provided with the distribution.
201.19Sagc * 3. Neither the name of the University nor the names of its contributors
211.19Sagc *    may be used to endorse or promote products derived from this software
221.19Sagc *    without specific prior written permission.
231.19Sagc *
241.19Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
251.19Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
261.19Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
271.19Sagc * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
281.19Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
291.19Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
301.19Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
311.19Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
321.19Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
331.19Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
341.19Sagc * SUCH DAMAGE.
351.19Sagc *
361.19Sagc *	from: Utah Hdr: machparam.h 1.11 89/08/14
371.19Sagc *	from: @(#)param.h	8.1 (Berkeley) 6/10/93
381.19Sagc */
391.19Sagc/*
401.19Sagc * Copyright (c) 1988 University of Utah.
411.1Sjonathan *
421.1Sjonathan * This code is derived from software contributed to Berkeley by
431.1Sjonathan * the Systems Programming Group of the University of Utah Computer
441.1Sjonathan * Science Department and Ralph Campbell.
451.1Sjonathan *
461.1Sjonathan * Redistribution and use in source and binary forms, with or without
471.1Sjonathan * modification, are permitted provided that the following conditions
481.1Sjonathan * are met:
491.1Sjonathan * 1. Redistributions of source code must retain the above copyright
501.1Sjonathan *    notice, this list of conditions and the following disclaimer.
511.1Sjonathan * 2. Redistributions in binary form must reproduce the above copyright
521.1Sjonathan *    notice, this list of conditions and the following disclaimer in the
531.1Sjonathan *    documentation and/or other materials provided with the distribution.
541.1Sjonathan * 3. All advertising materials mentioning features or use of this software
551.1Sjonathan *    must display the following acknowledgement:
561.1Sjonathan *	This product includes software developed by the University of
571.1Sjonathan *	California, Berkeley and its contributors.
581.1Sjonathan * 4. Neither the name of the University nor the names of its contributors
591.1Sjonathan *    may be used to endorse or promote products derived from this software
601.1Sjonathan *    without specific prior written permission.
611.1Sjonathan *
621.1Sjonathan * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
631.1Sjonathan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
641.1Sjonathan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
651.1Sjonathan * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
661.1Sjonathan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
671.1Sjonathan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
681.1Sjonathan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
691.1Sjonathan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
701.1Sjonathan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
711.1Sjonathan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
721.1Sjonathan * SUCH DAMAGE.
731.1Sjonathan *
741.11Ssoda *	from: Utah Hdr: machparam.h 1.11 89/08/14
751.1Sjonathan *	from: @(#)param.h	8.1 (Berkeley) 6/10/93
761.1Sjonathan */
771.1Sjonathan
781.11Ssoda#ifndef _ARC_PARAM_H_
791.11Ssoda#define _ARC_PARAM_H_
801.11Ssoda
811.1Sjonathan/*
821.3Sjonathan * Machine-dependent constants (VM, etc) common across MIPS cpus
831.3Sjonathan */
841.3Sjonathan#include <mips/mips_param.h>
851.3Sjonathan
861.3Sjonathan/*
871.11Ssoda * Machine dependent constants for ARC BIOS MIPS machines:
881.11Ssoda *	Acer Labs PICA_61
891.11Ssoda *	Deskstation rPC44
901.11Ssoda *	Deskstation Tyne
911.11Ssoda *	Etc
921.11Ssoda */
931.12Ssoda#define	_MACHINE_ARCH	mipsel
941.12Ssoda#define	MACHINE_ARCH	"mipsel"
951.11Ssoda#define	_MACHINE	arc
961.11Ssoda#define	MACHINE		"arc"
971.12Ssoda#define	MID_MACHINE	MID_PMAX	/* XXX Bogus, but needed for now... */
981.1Sjonathan
991.1Sjonathan#define	KERNBASE	0x80000000	/* start of kernel virtual */
1001.1Sjonathan#define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
1011.1Sjonathan
1021.1Sjonathan#define	DEV_BSIZE	512
1031.1Sjonathan#define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
1041.1Sjonathan#define BLKDEV_IOSIZE	2048
1051.11Ssoda/* XXX Maxphys temporary changed to 32K while SCSI driver is fixed. */
1061.11Ssoda#define	MAXPHYS		(32 * 1024)	/* max raw I/O transfer size */
1071.1Sjonathan
1081.1Sjonathan#define	SSIZE		1		/* initial stack size/NBPG */
1091.1Sjonathan#define	SINCR		1		/* increment of stack/NBPG */
1101.1Sjonathan
1111.1Sjonathan#define	UPAGES		2		/* pages of u-area */
1121.11Ssoda#if defined(_LOCORE) && defined(notyet)
1131.11Ssoda#define	UADDR		0xffffffffffffc000	/* address of u */
1141.11Ssoda#else
1151.1Sjonathan#define	UADDR		0xffffc000	/* address of u */
1161.11Ssoda#endif
1171.1Sjonathan#define USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
1181.1Sjonathan#define	UVPN		(UADDR>>PGSHIFT)/* virtual page number of u */
1191.1Sjonathan#define	KERNELSTACK	(UADDR+UPAGES*NBPG)	/* top of kernel stack */
1201.1Sjonathan
1211.1Sjonathan/*
1221.1Sjonathan * Constants related to network buffer management.
1231.16Ssimonb * MCLBYTES must be no larger than NBPG (the software page size), and,
1241.1Sjonathan * on machines that exchange pages of input or output buffers with mbuf
1251.1Sjonathan * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
1261.1Sjonathan * of the hardware page size.
1271.1Sjonathan */
1281.14Sitojun#define	MSIZE		256		/* size of an mbuf */
1291.16Ssimonb
1301.16Ssimonb#ifndef MCLSHIFT
1311.16Ssimonb#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
1321.16Ssimonb					/* 2K cluster can hold Ether frame */
1331.16Ssimonb#endif	/* MCLSHIFT */
1341.16Ssimonb
1351.16Ssimonb#define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
1361.16Ssimonb
1371.1Sjonathan#ifndef NMBCLUSTERS
1381.15Smrg#if defined(_KERNEL_OPT)
1391.8Sthorpej#include "opt_gateway.h"
1401.15Smrg#endif
1411.8Sthorpej
1421.1Sjonathan#ifdef GATEWAY
1431.1Sjonathan#define	NMBCLUSTERS	2048		/* map size, max cluster allocation */
1441.1Sjonathan#else
1451.1Sjonathan#define	NMBCLUSTERS	1024		/* map size, max cluster allocation */
1461.1Sjonathan#endif
1471.1Sjonathan#endif
1481.1Sjonathan
1491.1Sjonathan/* bytes to disk blocks */
1501.1Sjonathan#define	btodb(x)	((x) >> DEV_BSHIFT)
1511.1Sjonathan#define dbtob(x)	((x) << DEV_BSHIFT)
1521.1Sjonathan
1531.1Sjonathan#ifdef _KERNEL
1541.3Sjonathan#ifndef _LOCORE
1551.11Ssoda
1561.11Ssodaextern int cpuspeed;
1571.22Stsutsuivoid delay(unsigned int n);
1581.11Ssoda
1591.22Stsutsui#define	DELAY(n)	delay(n)
1601.12Ssoda
1611.12Ssoda#include <machine/intr.h>
1621.11Ssoda
1631.11Ssoda#endif /* _LOCORE */
1641.11Ssoda#endif /* _KERNEL */
1651.1Sjonathan
1661.11Ssoda#endif /* _ARC_PARAM_H_ */
167