param.h revision 1.29
11.29Stsutsui/* $NetBSD: param.h,v 1.29 2011/03/18 16:17:22 tsutsui 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.29Stsutsui#define _MACHINE arc 481.29Stsutsui#define MACHINE "arc" 491.29Stsutsui 501.3Sjonathan#include <mips/mips_param.h> 511.3Sjonathan 521.3Sjonathan/* 531.11Ssoda * Machine dependent constants for ARC BIOS MIPS machines: 541.11Ssoda * Acer Labs PICA_61 551.11Ssoda * Deskstation rPC44 561.11Ssoda * Deskstation Tyne 571.11Ssoda * Etc 581.11Ssoda */ 591.1Sjonathan#define KERNBASE 0x80000000 /* start of kernel virtual */ 601.1Sjonathan#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) 611.1Sjonathan 621.1Sjonathan#define DEV_BSIZE 512 631.1Sjonathan#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ 641.1Sjonathan#define BLKDEV_IOSIZE 2048 651.23Stsutsui#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */ 661.1Sjonathan 671.1Sjonathan#define SSIZE 1 /* initial stack size/NBPG */ 681.1Sjonathan#define SINCR 1 /* increment of stack/NBPG */ 691.1Sjonathan 701.1Sjonathan#define UPAGES 2 /* pages of u-area */ 711.11Ssoda#if defined(_LOCORE) && defined(notyet) 721.11Ssoda#define UADDR 0xffffffffffffc000 /* address of u */ 731.11Ssoda#else 741.1Sjonathan#define UADDR 0xffffc000 /* address of u */ 751.11Ssoda#endif 761.1Sjonathan#define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ 771.1Sjonathan#define UVPN (UADDR>>PGSHIFT)/* virtual page number of u */ 781.1Sjonathan#define KERNELSTACK (UADDR+UPAGES*NBPG) /* top of kernel stack */ 791.1Sjonathan 801.1Sjonathan/* 811.1Sjonathan * Constants related to network buffer management. 821.16Ssimonb * MCLBYTES must be no larger than NBPG (the software page size), and, 831.1Sjonathan * on machines that exchange pages of input or output buffers with mbuf 841.1Sjonathan * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 851.1Sjonathan * of the hardware page size. 861.1Sjonathan */ 871.14Sitojun#define MSIZE 256 /* size of an mbuf */ 881.16Ssimonb 891.16Ssimonb#ifndef MCLSHIFT 901.16Ssimonb#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 911.16Ssimonb /* 2K cluster can hold Ether frame */ 921.16Ssimonb#endif /* MCLSHIFT */ 931.16Ssimonb 941.16Ssimonb#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 951.16Ssimonb 961.1Sjonathan/* bytes to disk blocks */ 971.1Sjonathan#define btodb(x) ((x) >> DEV_BSHIFT) 981.1Sjonathan#define dbtob(x) ((x) << DEV_BSHIFT) 991.1Sjonathan 1001.1Sjonathan#ifdef _KERNEL 1011.3Sjonathan#ifndef _LOCORE 1021.11Ssoda 1031.11Ssodaextern int cpuspeed; 1041.22Stsutsuivoid delay(unsigned int n); 1051.11Ssoda 1061.22Stsutsui#define DELAY(n) delay(n) 1071.12Ssoda 1081.12Ssoda#include <machine/intr.h> 1091.11Ssoda 1101.11Ssoda#endif /* _LOCORE */ 1111.11Ssoda#endif /* _KERNEL */ 1121.1Sjonathan 1131.11Ssoda#endif /* _ARC_PARAM_H_ */ 114