param.h revision 1.6
11.6Sagc/* $NetBSD: param.h,v 1.6 2003/08/07 16:27:16 agc Exp $ */ 21.1Sdrochner 31.1Sdrochner/* 41.1Sdrochner * Copyright (c) 1982, 1986, 1990, 1993 51.1Sdrochner * The Regents of the University of California. All rights reserved. 61.6Sagc * 71.6Sagc * This code is derived from software contributed to Berkeley by 81.6Sagc * the Systems Programming Group of the University of Utah Computer 91.6Sagc * Science Department. 101.6Sagc * 111.6Sagc * Redistribution and use in source and binary forms, with or without 121.6Sagc * modification, are permitted provided that the following conditions 131.6Sagc * are met: 141.6Sagc * 1. Redistributions of source code must retain the above copyright 151.6Sagc * notice, this list of conditions and the following disclaimer. 161.6Sagc * 2. Redistributions in binary form must reproduce the above copyright 171.6Sagc * notice, this list of conditions and the following disclaimer in the 181.6Sagc * documentation and/or other materials provided with the distribution. 191.6Sagc * 3. Neither the name of the University nor the names of its contributors 201.6Sagc * may be used to endorse or promote products derived from this software 211.6Sagc * without specific prior written permission. 221.6Sagc * 231.6Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.6Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.6Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.6Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.6Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.6Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.6Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.6Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.6Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.6Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.6Sagc * SUCH DAMAGE. 341.6Sagc * 351.6Sagc * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 361.6Sagc * 371.6Sagc * @(#)param.h 8.1 (Berkeley) 6/10/93 381.6Sagc */ 391.6Sagc/* 401.6Sagc * Copyright (c) 1988 University of Utah. 411.1Sdrochner * 421.1Sdrochner * This code is derived from software contributed to Berkeley by 431.1Sdrochner * the Systems Programming Group of the University of Utah Computer 441.1Sdrochner * Science Department. 451.1Sdrochner * 461.1Sdrochner * Redistribution and use in source and binary forms, with or without 471.1Sdrochner * modification, are permitted provided that the following conditions 481.1Sdrochner * are met: 491.1Sdrochner * 1. Redistributions of source code must retain the above copyright 501.1Sdrochner * notice, this list of conditions and the following disclaimer. 511.1Sdrochner * 2. Redistributions in binary form must reproduce the above copyright 521.1Sdrochner * notice, this list of conditions and the following disclaimer in the 531.1Sdrochner * documentation and/or other materials provided with the distribution. 541.1Sdrochner * 3. All advertising materials mentioning features or use of this software 551.1Sdrochner * must display the following acknowledgement: 561.1Sdrochner * This product includes software developed by the University of 571.1Sdrochner * California, Berkeley and its contributors. 581.1Sdrochner * 4. Neither the name of the University nor the names of its contributors 591.1Sdrochner * may be used to endorse or promote products derived from this software 601.1Sdrochner * without specific prior written permission. 611.1Sdrochner * 621.1Sdrochner * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 631.1Sdrochner * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 641.1Sdrochner * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 651.1Sdrochner * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 661.1Sdrochner * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 671.1Sdrochner * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 681.1Sdrochner * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 691.1Sdrochner * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 701.1Sdrochner * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 711.1Sdrochner * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 721.1Sdrochner * SUCH DAMAGE. 731.1Sdrochner * 741.1Sdrochner * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 751.1Sdrochner * 761.1Sdrochner * @(#)param.h 8.1 (Berkeley) 6/10/93 771.1Sdrochner */ 781.1Sdrochner 791.1Sdrochner/* 801.1Sdrochner * Machine dependent constants for CES FIC8234. 811.1Sdrochner */ 821.1Sdrochner#define _MACHINE cesfic 831.1Sdrochner#define MACHINE "cesfic" 841.1Sdrochner 851.1Sdrochner/* 861.1Sdrochner * Round p (pointer or byte index) up to a correctly-aligned value for all 871.1Sdrochner * data types (int, long, ...). The result is u_int and must be cast to 881.1Sdrochner * any desired pointer type. 891.1Sdrochner * 901.1Sdrochner * ALIGNED_POINTER is a boolean macro that checks whether an address 911.1Sdrochner * is valid to fetch data elements of type t from on this architecture. 921.1Sdrochner * This does not reflect the optimal alignment, just the possibility 931.1Sdrochner * (within reasonable limits). 941.1Sdrochner * 951.1Sdrochner */ 961.1Sdrochner 971.1Sdrochner#define PGSHIFT 12 /* LOG2(NBPG) */ 981.1Sdrochner#define NPTEPG (NBPG/(sizeof (pt_entry_t))) 991.1Sdrochner 1001.1Sdrochner#define SEGSHIFT 22 /* LOG2(NBSEG) */ 1011.5Schs#if defined(M68030) && !defined(M68040) && !defined(M68060) 1021.1Sdrochner#define NBSEG (1 << SEGSHIFT) /* bytes/segment */ 1031.5Schs#elif (defined(M68040) || defined(M68060)) && !defined(M68030) 1041.5Schs#define NBSEG (32 * (1 << PGSHIFT)) 1051.5Schs#else 1061.5Schs#define NBSEG ((mmutype == MMU_68040) ? \ 1071.5Schs (32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT))) 1081.5Schs#endif 1091.1Sdrochner#define SEGOFSET (NBSEG-1) /* byte offset into segment */ 1101.1Sdrochner 1111.1Sdrochner#define KERNBASE 0x00002000 /* start of kernel virtual */ 1121.1Sdrochner 1131.1Sdrochner#define UPAGES 2 /* pages of u-area */ 1141.1Sdrochner 1151.1Sdrochner#include <m68k/param.h> 1161.1Sdrochner 1171.1Sdrochner/* 1181.1Sdrochner * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 1191.1Sdrochner * logical pages. 1201.1Sdrochner */ 1211.1Sdrochner#define NKMEMPAGES_MIN_DEFAULT ((3 * 1024 * 1024) >> PAGE_SHIFT) 1221.1Sdrochner#define NKMEMPAGES_MAX_DEFAULT ((3 * 1024 * 1024) >> PAGE_SHIFT) 1231.1Sdrochner 1241.1Sdrochner/* 1251.3Skleink * Interrupt glue. 1261.1Sdrochner */ 1271.3Skleink#include <machine/intr.h> 1281.1Sdrochner 1291.1Sdrochner#if defined(_KERNEL) && !defined(_LOCORE) 1301.1Sdrochner#define delay(us) _delay((us) << 8) 1311.1Sdrochner#define DELAY(us) delay(us) 1321.1Sdrochner 1331.1Sdrochnervoid _delay __P((u_int)); 1341.1Sdrochner#endif /* _KERNEL && !_LOCORE */ 135