param.h revision 1.8
11.8Sagc/* $NetBSD: param.h,v 1.8 2003/08/07 16:28:50 agc Exp $ */ 21.1Stsutsui 31.1Stsutsui/* 41.1Stsutsui * Copyright (c) 1982, 1986, 1990, 1993 51.1Stsutsui * The Regents of the University of California. All rights reserved. 61.8Sagc * 71.8Sagc * This code is derived from software contributed to Berkeley by 81.8Sagc * the Systems Programming Group of the University of Utah Computer 91.8Sagc * Science Department. 101.8Sagc * 111.8Sagc * Redistribution and use in source and binary forms, with or without 121.8Sagc * modification, are permitted provided that the following conditions 131.8Sagc * are met: 141.8Sagc * 1. Redistributions of source code must retain the above copyright 151.8Sagc * notice, this list of conditions and the following disclaimer. 161.8Sagc * 2. Redistributions in binary form must reproduce the above copyright 171.8Sagc * notice, this list of conditions and the following disclaimer in the 181.8Sagc * documentation and/or other materials provided with the distribution. 191.8Sagc * 3. Neither the name of the University nor the names of its contributors 201.8Sagc * may be used to endorse or promote products derived from this software 211.8Sagc * without specific prior written permission. 221.8Sagc * 231.8Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.8Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.8Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.8Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.8Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.8Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.8Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.8Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.8Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.8Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.8Sagc * SUCH DAMAGE. 341.8Sagc * 351.8Sagc * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 361.8Sagc * 371.8Sagc * @(#)param.h 8.1 (Berkeley) 6/10/93 381.8Sagc */ 391.8Sagc/* 401.8Sagc * Copyright (c) 1988 University of Utah. 411.1Stsutsui * 421.1Stsutsui * This code is derived from software contributed to Berkeley by 431.1Stsutsui * the Systems Programming Group of the University of Utah Computer 441.1Stsutsui * Science Department. 451.1Stsutsui * 461.1Stsutsui * Redistribution and use in source and binary forms, with or without 471.1Stsutsui * modification, are permitted provided that the following conditions 481.1Stsutsui * are met: 491.1Stsutsui * 1. Redistributions of source code must retain the above copyright 501.1Stsutsui * notice, this list of conditions and the following disclaimer. 511.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 521.1Stsutsui * notice, this list of conditions and the following disclaimer in the 531.1Stsutsui * documentation and/or other materials provided with the distribution. 541.1Stsutsui * 3. All advertising materials mentioning features or use of this software 551.1Stsutsui * must display the following acknowledgement: 561.1Stsutsui * This product includes software developed by the University of 571.1Stsutsui * California, Berkeley and its contributors. 581.1Stsutsui * 4. Neither the name of the University nor the names of its contributors 591.1Stsutsui * may be used to endorse or promote products derived from this software 601.1Stsutsui * without specific prior written permission. 611.1Stsutsui * 621.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 631.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 641.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 651.1Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 661.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 671.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 681.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 691.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 701.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 711.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 721.1Stsutsui * SUCH DAMAGE. 731.1Stsutsui * 741.1Stsutsui * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 751.1Stsutsui * 761.1Stsutsui * @(#)param.h 8.1 (Berkeley) 6/10/93 771.1Stsutsui */ 781.1Stsutsui 791.1Stsutsui#ifndef _MACHINE_PARAM_H_ 801.1Stsutsui#define _MACHINE_PARAM_H_ 811.1Stsutsui 821.1Stsutsui/* 831.1Stsutsui * Interrupt glue. 841.1Stsutsui */ 851.1Stsutsui#include <machine/intr.h> 861.1Stsutsui 871.1Stsutsui/* 881.1Stsutsui * Machine dependent constants for m68k NEWS. 891.1Stsutsui */ 901.1Stsutsui#define _MACHINE news68k 911.1Stsutsui#define MACHINE "news68k" 921.1Stsutsui 931.1Stsutsui 941.1Stsutsui#define PGSHIFT 12 /* LOG2(NBPG) */ 951.1Stsutsui#define KERNBASE 0x00000000 /* start of kernel virtual */ 961.1Stsutsui 971.1Stsutsui#define SEGSHIFT 22 /* LOG2(NBSEG) */ 981.6Schs#if defined(M68030) && !defined(M68040) && !defined(M68060) 991.1Stsutsui#define NBSEG (1 << SEGSHIFT) /* bytes/segment */ 1001.6Schs#elif (defined(M68040) || defined(M68060)) && !defined(M68030) 1011.6Schs#define NBSEG (32 * (1 << PGSHIFT)) 1021.6Schs#else 1031.6Schs#define NBSEG ((mmutype == MMU_68040) ? \ 1041.6Schs (32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT))) 1051.6Schs#endif 1061.1Stsutsui#define SEGOFSET (NBSEG-1) /* byte offset into segment */ 1071.1Stsutsui 1081.4Stsutsui#define UPAGES 2 /* pages of u-area */ 1091.1Stsutsui 1101.1Stsutsui#include <m68k/param.h> 1111.1Stsutsui 1121.1Stsutsui#define NPTEPG (NBPG/(sizeof (pt_entry_t))) 1131.1Stsutsui 1141.1Stsutsui/* 1151.2Sthorpej * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 1161.2Sthorpej * logical pages. 1171.1Stsutsui */ 1181.3Stsutsui#define NKMEMPAGES_MIN_DEFAULT ((3 * 1024 * 1024) >> PAGE_SHIFT) 1191.2Sthorpej#define NKMEMPAGES_MAX_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT) 1201.1Stsutsui 1211.1Stsutsui#if defined(_KERNEL) && !defined(_LOCORE) 1221.1Stsutsui#define delay(us) _delay((us) << 8) 1231.1Stsutsui#define DELAY(us) delay(us) 1241.1Stsutsui 1251.7Stsutsuivoid _delay(u_int); 1261.1Stsutsui#endif /* _KERNEL && !_LOCORE */ 1271.1Stsutsui 1281.5Smrg#if defined(_KERNEL_OPT) 1291.1Stsutsui#include "opt_compat_hpux.h" 1301.1Stsutsui#endif 1311.1Stsutsui 1321.1Stsutsui#ifdef COMPAT_HPUX 1331.1Stsutsui/* 1341.1Stsutsui * Constants/macros for HPUX multiple mapping of user address space. 1351.1Stsutsui * Pages in the first 256Mb are mapped in at every 256Mb segment. 1361.1Stsutsui */ 1371.1Stsutsui#define HPMMMASK 0xF0000000 1381.1Stsutsui#define ISHPMMADDR(v) \ 1391.1Stsutsui ((curproc->p_md.md_flags & MDP_HPUXMMAP) && \ 1401.1Stsutsui ((unsigned)(v) & HPMMMASK) && \ 1411.1Stsutsui ((unsigned)(v) & HPMMMASK) != HPMMMASK) 1421.1Stsutsui#define HPMMBASEADDR(v) \ 1431.1Stsutsui ((unsigned)(v) & ~HPMMMASK) 1441.1Stsutsui#endif 1451.1Stsutsui 1461.1Stsutsui#endif /* !_MACHINE_PARAM_H_ */ 147