param.h revision 1.6
11.6Schs/* $NetBSD: param.h,v 1.6 2002/11/03 19:56:32 chs Exp $ */ 21.1Stsutsui 31.1Stsutsui/* 41.1Stsutsui * Copyright (c) 1988 University of Utah. 51.1Stsutsui * Copyright (c) 1982, 1986, 1990, 1993 61.1Stsutsui * The Regents of the University of California. All rights reserved. 71.1Stsutsui * 81.1Stsutsui * This code is derived from software contributed to Berkeley by 91.1Stsutsui * the Systems Programming Group of the University of Utah Computer 101.1Stsutsui * Science Department. 111.1Stsutsui * 121.1Stsutsui * Redistribution and use in source and binary forms, with or without 131.1Stsutsui * modification, are permitted provided that the following conditions 141.1Stsutsui * are met: 151.1Stsutsui * 1. Redistributions of source code must retain the above copyright 161.1Stsutsui * notice, this list of conditions and the following disclaimer. 171.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 181.1Stsutsui * notice, this list of conditions and the following disclaimer in the 191.1Stsutsui * documentation and/or other materials provided with the distribution. 201.1Stsutsui * 3. All advertising materials mentioning features or use of this software 211.1Stsutsui * must display the following acknowledgement: 221.1Stsutsui * This product includes software developed by the University of 231.1Stsutsui * California, Berkeley and its contributors. 241.1Stsutsui * 4. Neither the name of the University nor the names of its contributors 251.1Stsutsui * may be used to endorse or promote products derived from this software 261.1Stsutsui * without specific prior written permission. 271.1Stsutsui * 281.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Stsutsui * SUCH DAMAGE. 391.1Stsutsui * 401.1Stsutsui * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 411.1Stsutsui * 421.1Stsutsui * @(#)param.h 8.1 (Berkeley) 6/10/93 431.1Stsutsui */ 441.1Stsutsui 451.1Stsutsui#ifndef _MACHINE_PARAM_H_ 461.1Stsutsui#define _MACHINE_PARAM_H_ 471.1Stsutsui 481.1Stsutsui/* 491.1Stsutsui * Interrupt glue. 501.1Stsutsui */ 511.1Stsutsui#include <machine/intr.h> 521.1Stsutsui 531.1Stsutsui/* 541.1Stsutsui * Machine dependent constants for m68k NEWS. 551.1Stsutsui */ 561.1Stsutsui#define _MACHINE news68k 571.1Stsutsui#define MACHINE "news68k" 581.1Stsutsui 591.1Stsutsui 601.1Stsutsui#define PGSHIFT 12 /* LOG2(NBPG) */ 611.1Stsutsui#define KERNBASE 0x00000000 /* start of kernel virtual */ 621.1Stsutsui 631.1Stsutsui#define SEGSHIFT 22 /* LOG2(NBSEG) */ 641.6Schs#if defined(M68030) && !defined(M68040) && !defined(M68060) 651.1Stsutsui#define NBSEG (1 << SEGSHIFT) /* bytes/segment */ 661.6Schs#elif (defined(M68040) || defined(M68060)) && !defined(M68030) 671.6Schs#define NBSEG (32 * (1 << PGSHIFT)) 681.6Schs#else 691.6Schs#define NBSEG ((mmutype == MMU_68040) ? \ 701.6Schs (32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT))) 711.6Schs#endif 721.1Stsutsui#define SEGOFSET (NBSEG-1) /* byte offset into segment */ 731.1Stsutsui 741.4Stsutsui#define UPAGES 2 /* pages of u-area */ 751.1Stsutsui 761.1Stsutsui#include <m68k/param.h> 771.1Stsutsui 781.1Stsutsui#define NPTEPG (NBPG/(sizeof (pt_entry_t))) 791.1Stsutsui 801.1Stsutsui/* 811.2Sthorpej * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 821.2Sthorpej * logical pages. 831.1Stsutsui */ 841.3Stsutsui#define NKMEMPAGES_MIN_DEFAULT ((3 * 1024 * 1024) >> PAGE_SHIFT) 851.2Sthorpej#define NKMEMPAGES_MAX_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT) 861.1Stsutsui 871.1Stsutsui#if defined(_KERNEL) && !defined(_LOCORE) 881.1Stsutsui#define delay(us) _delay((us) << 8) 891.1Stsutsui#define DELAY(us) delay(us) 901.1Stsutsui 911.1Stsutsuivoid _delay __P((u_int)); 921.1Stsutsui#endif /* _KERNEL && !_LOCORE */ 931.1Stsutsui 941.5Smrg#if defined(_KERNEL_OPT) 951.1Stsutsui#include "opt_compat_hpux.h" 961.1Stsutsui#endif 971.1Stsutsui 981.1Stsutsui#ifdef COMPAT_HPUX 991.1Stsutsui/* 1001.1Stsutsui * Constants/macros for HPUX multiple mapping of user address space. 1011.1Stsutsui * Pages in the first 256Mb are mapped in at every 256Mb segment. 1021.1Stsutsui */ 1031.1Stsutsui#define HPMMMASK 0xF0000000 1041.1Stsutsui#define ISHPMMADDR(v) \ 1051.1Stsutsui ((curproc->p_md.md_flags & MDP_HPUXMMAP) && \ 1061.1Stsutsui ((unsigned)(v) & HPMMMASK) && \ 1071.1Stsutsui ((unsigned)(v) & HPMMMASK) != HPMMMASK) 1081.1Stsutsui#define HPMMBASEADDR(v) \ 1091.1Stsutsui ((unsigned)(v) & ~HPMMMASK) 1101.1Stsutsui#endif 1111.1Stsutsui 1121.1Stsutsui#endif /* !_MACHINE_PARAM_H_ */ 113