param.h revision 1.15
11.15Smrg/* $NetBSD: param.h,v 1.15 2001/05/30 12:28:39 mrg 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) 1988 University of Utah. 61.1Sjonathan * Copyright (c) 1992, 1993 71.1Sjonathan * The Regents of the University of California. All rights reserved. 81.1Sjonathan * 91.1Sjonathan * This code is derived from software contributed to Berkeley by 101.1Sjonathan * the Systems Programming Group of the University of Utah Computer 111.1Sjonathan * Science Department and Ralph Campbell. 121.1Sjonathan * 131.1Sjonathan * Redistribution and use in source and binary forms, with or without 141.1Sjonathan * modification, are permitted provided that the following conditions 151.1Sjonathan * are met: 161.1Sjonathan * 1. Redistributions of source code must retain the above copyright 171.1Sjonathan * notice, this list of conditions and the following disclaimer. 181.1Sjonathan * 2. Redistributions in binary form must reproduce the above copyright 191.1Sjonathan * notice, this list of conditions and the following disclaimer in the 201.1Sjonathan * documentation and/or other materials provided with the distribution. 211.1Sjonathan * 3. All advertising materials mentioning features or use of this software 221.1Sjonathan * must display the following acknowledgement: 231.1Sjonathan * This product includes software developed by the University of 241.1Sjonathan * California, Berkeley and its contributors. 251.1Sjonathan * 4. Neither the name of the University nor the names of its contributors 261.1Sjonathan * may be used to endorse or promote products derived from this software 271.1Sjonathan * without specific prior written permission. 281.1Sjonathan * 291.1Sjonathan * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 301.1Sjonathan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 311.1Sjonathan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 321.1Sjonathan * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 331.1Sjonathan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 341.1Sjonathan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 351.1Sjonathan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 361.1Sjonathan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 371.1Sjonathan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 381.1Sjonathan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 391.1Sjonathan * SUCH DAMAGE. 401.1Sjonathan * 411.11Ssoda * from: Utah Hdr: machparam.h 1.11 89/08/14 421.1Sjonathan * from: @(#)param.h 8.1 (Berkeley) 6/10/93 431.1Sjonathan */ 441.1Sjonathan 451.11Ssoda#ifndef _ARC_PARAM_H_ 461.11Ssoda#define _ARC_PARAM_H_ 471.11Ssoda 481.1Sjonathan/* 491.3Sjonathan * Machine-dependent constants (VM, etc) common across MIPS cpus 501.3Sjonathan */ 511.3Sjonathan#include <mips/mips_param.h> 521.3Sjonathan 531.3Sjonathan/* 541.11Ssoda * Machine dependent constants for ARC BIOS MIPS machines: 551.11Ssoda * Acer Labs PICA_61 561.11Ssoda * Deskstation rPC44 571.11Ssoda * Deskstation Tyne 581.11Ssoda * Etc 591.11Ssoda */ 601.12Ssoda#define _MACHINE_ARCH mipsel 611.12Ssoda#define MACHINE_ARCH "mipsel" 621.11Ssoda#define _MACHINE arc 631.11Ssoda#define MACHINE "arc" 641.12Ssoda#define MID_MACHINE MID_PMAX /* XXX Bogus, but needed for now... */ 651.1Sjonathan 661.1Sjonathan#define KERNBASE 0x80000000 /* start of kernel virtual */ 671.1Sjonathan#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) 681.1Sjonathan 691.1Sjonathan#define DEV_BSIZE 512 701.1Sjonathan#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ 711.1Sjonathan#define BLKDEV_IOSIZE 2048 721.11Ssoda/* XXX Maxphys temporary changed to 32K while SCSI driver is fixed. */ 731.11Ssoda#define MAXPHYS (32 * 1024) /* max raw I/O transfer size */ 741.1Sjonathan 751.1Sjonathan#define SSIZE 1 /* initial stack size/NBPG */ 761.1Sjonathan#define SINCR 1 /* increment of stack/NBPG */ 771.1Sjonathan 781.1Sjonathan#define UPAGES 2 /* pages of u-area */ 791.11Ssoda#if defined(_LOCORE) && defined(notyet) 801.11Ssoda#define UADDR 0xffffffffffffc000 /* address of u */ 811.11Ssoda#else 821.1Sjonathan#define UADDR 0xffffc000 /* address of u */ 831.11Ssoda#endif 841.1Sjonathan#define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ 851.1Sjonathan#define UVPN (UADDR>>PGSHIFT)/* virtual page number of u */ 861.1Sjonathan#define KERNELSTACK (UADDR+UPAGES*NBPG) /* top of kernel stack */ 871.1Sjonathan 881.1Sjonathan/* 891.1Sjonathan * Constants related to network buffer management. 901.1Sjonathan * MCLBYTES must be no larger than CLBYTES (the software page size), and, 911.1Sjonathan * on machines that exchange pages of input or output buffers with mbuf 921.1Sjonathan * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 931.1Sjonathan * of the hardware page size. 941.1Sjonathan */ 951.14Sitojun#define MSIZE 256 /* size of an mbuf */ 961.11Ssoda#define MCLSHIFT 11 971.11Ssoda#define MCLBYTES (1 << MCLSHIFT) /* enough for whole Ethernet packet */ 981.1Sjonathan#define MCLOFSET (MCLBYTES - 1) 991.1Sjonathan#ifndef NMBCLUSTERS 1001.8Sthorpej 1011.15Smrg#if defined(_KERNEL_OPT) 1021.8Sthorpej#include "opt_gateway.h" 1031.15Smrg#endif 1041.8Sthorpej 1051.1Sjonathan#ifdef GATEWAY 1061.1Sjonathan#define NMBCLUSTERS 2048 /* map size, max cluster allocation */ 1071.1Sjonathan#else 1081.1Sjonathan#define NMBCLUSTERS 1024 /* map size, max cluster allocation */ 1091.1Sjonathan#endif 1101.1Sjonathan#endif 1111.1Sjonathan 1121.1Sjonathan/* bytes to disk blocks */ 1131.1Sjonathan#define btodb(x) ((x) >> DEV_BSHIFT) 1141.1Sjonathan#define dbtob(x) ((x) << DEV_BSHIFT) 1151.1Sjonathan 1161.1Sjonathan#ifdef _KERNEL 1171.3Sjonathan#ifndef _LOCORE 1181.11Ssoda 1191.11Ssodaextern int cpuspeed; 1201.11Ssodaextern void delay __P((int n)); 1211.11Ssoda 1221.11Ssoda#if 0 /* XXX: should use mips_mcclock.c */ 1231.11Ssoda#define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } 1241.11Ssoda#else 1251.1Sjonathan/* 1261.1Sjonathan * Delay is based on an assumtion that each time in the loop 1271.1Sjonathan * takes 3 clocks. Three is for branch and subtract in the delay slot. 1281.1Sjonathan */ 1291.1Sjonathan#define DELAY(n) { register int N = cpuspeed * (n); while ((N -= 3) > 0); } 1301.11Ssoda#endif 1311.12Ssoda 1321.12Ssoda#include <machine/intr.h> 1331.11Ssoda 1341.11Ssoda#endif /* _LOCORE */ 1351.11Ssoda#endif /* _KERNEL */ 1361.1Sjonathan 1371.11Ssoda#endif /* _ARC_PARAM_H_ */ 138