param.h revision 1.27
11.27Srmind/*	$NetBSD: param.h,v 1.27 2011/02/08 20:20:09 rmind Exp $	*/
21.11Ssoda/*      $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
31.2Sthorpej
41.1Sjonathan/*
51.27Srmind * Copyright (c) 1988 University of Utah.
61.1Sjonathan * Copyright (c) 1992, 1993
71.1Sjonathan *	The Regents of the University of California.  All rights reserved.
81.19Sagc *
91.19Sagc * This code is derived from software contributed to Berkeley by
101.19Sagc * the Systems Programming Group of the University of Utah Computer
111.19Sagc * Science Department and Ralph Campbell.
121.19Sagc *
131.19Sagc * Redistribution and use in source and binary forms, with or without
141.19Sagc * modification, are permitted provided that the following conditions
151.19Sagc * are met:
161.19Sagc * 1. Redistributions of source code must retain the above copyright
171.19Sagc *    notice, this list of conditions and the following disclaimer.
181.19Sagc * 2. Redistributions in binary form must reproduce the above copyright
191.19Sagc *    notice, this list of conditions and the following disclaimer in the
201.19Sagc *    documentation and/or other materials provided with the distribution.
211.19Sagc * 3. Neither the name of the University nor the names of its contributors
221.19Sagc *    may be used to endorse or promote products derived from this software
231.19Sagc *    without specific prior written permission.
241.19Sagc *
251.19Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
261.19Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
271.19Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
281.19Sagc * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
291.19Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
301.19Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
311.19Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
321.19Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
331.19Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
341.19Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
351.19Sagc * SUCH DAMAGE.
361.19Sagc *
371.19Sagc *	from: Utah Hdr: machparam.h 1.11 89/08/14
381.19Sagc *	from: @(#)param.h	8.1 (Berkeley) 6/10/93
391.19Sagc */
401.1Sjonathan
411.11Ssoda#ifndef _ARC_PARAM_H_
421.11Ssoda#define _ARC_PARAM_H_
431.11Ssoda
441.1Sjonathan/*
451.3Sjonathan * Machine-dependent constants (VM, etc) common across MIPS cpus
461.3Sjonathan */
471.3Sjonathan#include <mips/mips_param.h>
481.3Sjonathan
491.3Sjonathan/*
501.11Ssoda * Machine dependent constants for ARC BIOS MIPS machines:
511.11Ssoda *	Acer Labs PICA_61
521.11Ssoda *	Deskstation rPC44
531.11Ssoda *	Deskstation Tyne
541.11Ssoda *	Etc
551.11Ssoda */
561.12Ssoda#define	_MACHINE_ARCH	mipsel
571.12Ssoda#define	MACHINE_ARCH	"mipsel"
581.11Ssoda#define	_MACHINE	arc
591.11Ssoda#define	MACHINE		"arc"
601.1Sjonathan
611.1Sjonathan#define	KERNBASE	0x80000000	/* start of kernel virtual */
621.1Sjonathan#define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
631.1Sjonathan
641.1Sjonathan#define	DEV_BSIZE	512
651.1Sjonathan#define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
661.1Sjonathan#define BLKDEV_IOSIZE	2048
671.23Stsutsui#define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
681.1Sjonathan
691.1Sjonathan#define	SSIZE		1		/* initial stack size/NBPG */
701.1Sjonathan#define	SINCR		1		/* increment of stack/NBPG */
711.1Sjonathan
721.1Sjonathan#define	UPAGES		2		/* pages of u-area */
731.11Ssoda#if defined(_LOCORE) && defined(notyet)
741.11Ssoda#define	UADDR		0xffffffffffffc000	/* address of u */
751.11Ssoda#else
761.1Sjonathan#define	UADDR		0xffffc000	/* address of u */
771.11Ssoda#endif
781.1Sjonathan#define USPACE		(UPAGES*NBPG)	/* size of u-area in bytes */
791.1Sjonathan#define	UVPN		(UADDR>>PGSHIFT)/* virtual page number of u */
801.1Sjonathan#define	KERNELSTACK	(UADDR+UPAGES*NBPG)	/* top of kernel stack */
811.1Sjonathan
821.1Sjonathan/*
831.1Sjonathan * Constants related to network buffer management.
841.16Ssimonb * MCLBYTES must be no larger than NBPG (the software page size), and,
851.1Sjonathan * on machines that exchange pages of input or output buffers with mbuf
861.1Sjonathan * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
871.1Sjonathan * of the hardware page size.
881.1Sjonathan */
891.14Sitojun#define	MSIZE		256		/* size of an mbuf */
901.16Ssimonb
911.16Ssimonb#ifndef MCLSHIFT
921.16Ssimonb#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
931.16Ssimonb					/* 2K cluster can hold Ether frame */
941.16Ssimonb#endif	/* MCLSHIFT */
951.16Ssimonb
961.16Ssimonb#define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
971.16Ssimonb
981.1Sjonathan/* bytes to disk blocks */
991.1Sjonathan#define	btodb(x)	((x) >> DEV_BSHIFT)
1001.1Sjonathan#define dbtob(x)	((x) << DEV_BSHIFT)
1011.1Sjonathan
1021.1Sjonathan#ifdef _KERNEL
1031.3Sjonathan#ifndef _LOCORE
1041.11Ssoda
1051.11Ssodaextern int cpuspeed;
1061.22Stsutsuivoid delay(unsigned int n);
1071.11Ssoda
1081.22Stsutsui#define	DELAY(n)	delay(n)
1091.12Ssoda
1101.12Ssoda#include <machine/intr.h>
1111.11Ssoda
1121.11Ssoda#endif /* _LOCORE */
1131.11Ssoda#endif /* _KERNEL */
1141.1Sjonathan
1151.11Ssoda#endif /* _ARC_PARAM_H_ */
116