param.h revision 1.23
11.23Stsutsui/* $NetBSD: param.h,v 1.23 2005/11/06 11:15:40 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.23Stsutsui#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */ 1061.1Sjonathan 1071.1Sjonathan#define SSIZE 1 /* initial stack size/NBPG */ 1081.1Sjonathan#define SINCR 1 /* increment of stack/NBPG */ 1091.1Sjonathan 1101.1Sjonathan#define UPAGES 2 /* pages of u-area */ 1111.11Ssoda#if defined(_LOCORE) && defined(notyet) 1121.11Ssoda#define UADDR 0xffffffffffffc000 /* address of u */ 1131.11Ssoda#else 1141.1Sjonathan#define UADDR 0xffffc000 /* address of u */ 1151.11Ssoda#endif 1161.1Sjonathan#define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ 1171.1Sjonathan#define UVPN (UADDR>>PGSHIFT)/* virtual page number of u */ 1181.1Sjonathan#define KERNELSTACK (UADDR+UPAGES*NBPG) /* top of kernel stack */ 1191.1Sjonathan 1201.1Sjonathan/* 1211.1Sjonathan * Constants related to network buffer management. 1221.16Ssimonb * MCLBYTES must be no larger than NBPG (the software page size), and, 1231.1Sjonathan * on machines that exchange pages of input or output buffers with mbuf 1241.1Sjonathan * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 1251.1Sjonathan * of the hardware page size. 1261.1Sjonathan */ 1271.14Sitojun#define MSIZE 256 /* size of an mbuf */ 1281.16Ssimonb 1291.16Ssimonb#ifndef MCLSHIFT 1301.16Ssimonb#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 1311.16Ssimonb /* 2K cluster can hold Ether frame */ 1321.16Ssimonb#endif /* MCLSHIFT */ 1331.16Ssimonb 1341.16Ssimonb#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 1351.16Ssimonb 1361.1Sjonathan#ifndef NMBCLUSTERS 1371.15Smrg#if defined(_KERNEL_OPT) 1381.8Sthorpej#include "opt_gateway.h" 1391.15Smrg#endif 1401.8Sthorpej 1411.1Sjonathan#ifdef GATEWAY 1421.1Sjonathan#define NMBCLUSTERS 2048 /* map size, max cluster allocation */ 1431.1Sjonathan#else 1441.1Sjonathan#define NMBCLUSTERS 1024 /* map size, max cluster allocation */ 1451.1Sjonathan#endif 1461.1Sjonathan#endif 1471.1Sjonathan 1481.1Sjonathan/* bytes to disk blocks */ 1491.1Sjonathan#define btodb(x) ((x) >> DEV_BSHIFT) 1501.1Sjonathan#define dbtob(x) ((x) << DEV_BSHIFT) 1511.1Sjonathan 1521.1Sjonathan#ifdef _KERNEL 1531.3Sjonathan#ifndef _LOCORE 1541.11Ssoda 1551.11Ssodaextern int cpuspeed; 1561.22Stsutsuivoid delay(unsigned int n); 1571.11Ssoda 1581.22Stsutsui#define DELAY(n) delay(n) 1591.12Ssoda 1601.12Ssoda#include <machine/intr.h> 1611.11Ssoda 1621.11Ssoda#endif /* _LOCORE */ 1631.11Ssoda#endif /* _KERNEL */ 1641.1Sjonathan 1651.11Ssoda#endif /* _ARC_PARAM_H_ */ 166