1*aad01611Sagc /* $NetBSD: param.h,v 1.8 2003/08/07 16:28:50 agc Exp $ */ 2a1099430Stsutsui 3a1099430Stsutsui /* 4a1099430Stsutsui * Copyright (c) 1982, 1986, 1990, 1993 5a1099430Stsutsui * The Regents of the University of California. All rights reserved. 6a1099430Stsutsui * 7a1099430Stsutsui * This code is derived from software contributed to Berkeley by 8a1099430Stsutsui * the Systems Programming Group of the University of Utah Computer 9a1099430Stsutsui * Science Department. 10a1099430Stsutsui * 11a1099430Stsutsui * Redistribution and use in source and binary forms, with or without 12a1099430Stsutsui * modification, are permitted provided that the following conditions 13a1099430Stsutsui * are met: 14a1099430Stsutsui * 1. Redistributions of source code must retain the above copyright 15a1099430Stsutsui * notice, this list of conditions and the following disclaimer. 16a1099430Stsutsui * 2. Redistributions in binary form must reproduce the above copyright 17a1099430Stsutsui * notice, this list of conditions and the following disclaimer in the 18a1099430Stsutsui * documentation and/or other materials provided with the distribution. 19*aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 20*aad01611Sagc * may be used to endorse or promote products derived from this software 21*aad01611Sagc * without specific prior written permission. 22*aad01611Sagc * 23*aad01611Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24*aad01611Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25*aad01611Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26*aad01611Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27*aad01611Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28*aad01611Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29*aad01611Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30*aad01611Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31*aad01611Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32*aad01611Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33*aad01611Sagc * SUCH DAMAGE. 34*aad01611Sagc * 35*aad01611Sagc * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 36*aad01611Sagc * 37*aad01611Sagc * @(#)param.h 8.1 (Berkeley) 6/10/93 38*aad01611Sagc */ 39*aad01611Sagc /* 40*aad01611Sagc * Copyright (c) 1988 University of Utah. 41*aad01611Sagc * 42*aad01611Sagc * This code is derived from software contributed to Berkeley by 43*aad01611Sagc * the Systems Programming Group of the University of Utah Computer 44*aad01611Sagc * Science Department. 45*aad01611Sagc * 46*aad01611Sagc * Redistribution and use in source and binary forms, with or without 47*aad01611Sagc * modification, are permitted provided that the following conditions 48*aad01611Sagc * are met: 49*aad01611Sagc * 1. Redistributions of source code must retain the above copyright 50*aad01611Sagc * notice, this list of conditions and the following disclaimer. 51*aad01611Sagc * 2. Redistributions in binary form must reproduce the above copyright 52*aad01611Sagc * notice, this list of conditions and the following disclaimer in the 53*aad01611Sagc * documentation and/or other materials provided with the distribution. 54a1099430Stsutsui * 3. All advertising materials mentioning features or use of this software 55a1099430Stsutsui * must display the following acknowledgement: 56a1099430Stsutsui * This product includes software developed by the University of 57a1099430Stsutsui * California, Berkeley and its contributors. 58a1099430Stsutsui * 4. Neither the name of the University nor the names of its contributors 59a1099430Stsutsui * may be used to endorse or promote products derived from this software 60a1099430Stsutsui * without specific prior written permission. 61a1099430Stsutsui * 62a1099430Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 63a1099430Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 64a1099430Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 65a1099430Stsutsui * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 66a1099430Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 67a1099430Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 68a1099430Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 69a1099430Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 70a1099430Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 71a1099430Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72a1099430Stsutsui * SUCH DAMAGE. 73a1099430Stsutsui * 74a1099430Stsutsui * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 75a1099430Stsutsui * 76a1099430Stsutsui * @(#)param.h 8.1 (Berkeley) 6/10/93 77a1099430Stsutsui */ 78a1099430Stsutsui 79a1099430Stsutsui #ifndef _MACHINE_PARAM_H_ 80a1099430Stsutsui #define _MACHINE_PARAM_H_ 81a1099430Stsutsui 82a1099430Stsutsui /* 83a1099430Stsutsui * Interrupt glue. 84a1099430Stsutsui */ 85a1099430Stsutsui #include <machine/intr.h> 86a1099430Stsutsui 87a1099430Stsutsui /* 88a1099430Stsutsui * Machine dependent constants for m68k NEWS. 89a1099430Stsutsui */ 90a1099430Stsutsui #define _MACHINE news68k 91a1099430Stsutsui #define MACHINE "news68k" 92a1099430Stsutsui 93a1099430Stsutsui 94a1099430Stsutsui #define PGSHIFT 12 /* LOG2(NBPG) */ 95a1099430Stsutsui #define KERNBASE 0x00000000 /* start of kernel virtual */ 96a1099430Stsutsui 97a1099430Stsutsui #define SEGSHIFT 22 /* LOG2(NBSEG) */ 9863486740Schs #if defined(M68030) && !defined(M68040) && !defined(M68060) 99a1099430Stsutsui #define NBSEG (1 << SEGSHIFT) /* bytes/segment */ 10063486740Schs #elif (defined(M68040) || defined(M68060)) && !defined(M68030) 10163486740Schs #define NBSEG (32 * (1 << PGSHIFT)) 10263486740Schs #else 10363486740Schs #define NBSEG ((mmutype == MMU_68040) ? \ 10463486740Schs (32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT))) 10563486740Schs #endif 106a1099430Stsutsui #define SEGOFSET (NBSEG-1) /* byte offset into segment */ 107a1099430Stsutsui 1087dc077e6Stsutsui #define UPAGES 2 /* pages of u-area */ 109a1099430Stsutsui 110a1099430Stsutsui #include <m68k/param.h> 111a1099430Stsutsui 112a1099430Stsutsui #define NPTEPG (NBPG/(sizeof (pt_entry_t))) 113a1099430Stsutsui 114a1099430Stsutsui /* 115dded044fSthorpej * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 116dded044fSthorpej * logical pages. 117a1099430Stsutsui */ 11896deb058Stsutsui #define NKMEMPAGES_MIN_DEFAULT ((3 * 1024 * 1024) >> PAGE_SHIFT) 119dded044fSthorpej #define NKMEMPAGES_MAX_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT) 120a1099430Stsutsui 121a1099430Stsutsui #if defined(_KERNEL) && !defined(_LOCORE) 122a1099430Stsutsui #define delay(us) _delay((us) << 8) 123a1099430Stsutsui #define DELAY(us) delay(us) 124a1099430Stsutsui 1252cac3aaeStsutsui void _delay(u_int); 126a1099430Stsutsui #endif /* _KERNEL && !_LOCORE */ 127a1099430Stsutsui 12867afbd62Smrg #if defined(_KERNEL_OPT) 129a1099430Stsutsui #include "opt_compat_hpux.h" 130a1099430Stsutsui #endif 131a1099430Stsutsui 132a1099430Stsutsui #ifdef COMPAT_HPUX 133a1099430Stsutsui /* 134a1099430Stsutsui * Constants/macros for HPUX multiple mapping of user address space. 135a1099430Stsutsui * Pages in the first 256Mb are mapped in at every 256Mb segment. 136a1099430Stsutsui */ 137a1099430Stsutsui #define HPMMMASK 0xF0000000 138a1099430Stsutsui #define ISHPMMADDR(v) \ 139a1099430Stsutsui ((curproc->p_md.md_flags & MDP_HPUXMMAP) && \ 140a1099430Stsutsui ((unsigned)(v) & HPMMMASK) && \ 141a1099430Stsutsui ((unsigned)(v) & HPMMMASK) != HPMMMASK) 142a1099430Stsutsui #define HPMMBASEADDR(v) \ 143a1099430Stsutsui ((unsigned)(v) & ~HPMMMASK) 144a1099430Stsutsui #endif 145a1099430Stsutsui 146a1099430Stsutsui #endif /* !_MACHINE_PARAM_H_ */ 147