1*b1b36fc1Ssimonb /* $NetBSD: param.h,v 1.24 2021/05/31 14:38:55 simonb Exp $ */ 2451bfcbcSveego 3451bfcbcSveego /* 49b6bd2d9Srmind * Copyright (c) 1988 University of Utah. 5451bfcbcSveego * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 6451bfcbcSveego * All rights reserved. 7451bfcbcSveego * 8451bfcbcSveego * This code is derived from software contributed to Berkeley by 9451bfcbcSveego * the Systems Programming Group of the University of Utah Computer 10451bfcbcSveego * Science Department. 11451bfcbcSveego * 12451bfcbcSveego * Redistribution and use in source and binary forms, with or without 13451bfcbcSveego * modification, are permitted provided that the following conditions 14451bfcbcSveego * are met: 15451bfcbcSveego * 1. Redistributions of source code must retain the above copyright 16451bfcbcSveego * notice, this list of conditions and the following disclaimer. 17451bfcbcSveego * 2. Redistributions in binary form must reproduce the above copyright 18451bfcbcSveego * notice, this list of conditions and the following disclaimer in the 19451bfcbcSveego * documentation and/or other materials provided with the distribution. 20aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 21aad01611Sagc * may be used to endorse or promote products derived from this software 22aad01611Sagc * without specific prior written permission. 23aad01611Sagc * 24aad01611Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25aad01611Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26aad01611Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27aad01611Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28aad01611Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29aad01611Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30aad01611Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31aad01611Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32aad01611Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33aad01611Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34aad01611Sagc * SUCH DAMAGE. 35aad01611Sagc * 36aad01611Sagc * from: Utah $Hdr: machparam.h 1.16 92/12/20$ 37aad01611Sagc * 38aad01611Sagc * @(#)param.h 8.1 (Berkeley) 6/10/93 39aad01611Sagc */ 409b6bd2d9Srmind 41451bfcbcSveego #ifndef _M68K_PARAM_H_ 42451bfcbcSveego #define _M68K_PARAM_H_ 43451bfcbcSveego 44*b1b36fc1Ssimonb #ifdef _KERNEL_OPT 45*b1b36fc1Ssimonb #include "opt_param.h" 46*b1b36fc1Ssimonb #endif 47*b1b36fc1Ssimonb 48451bfcbcSveego /* 49451bfcbcSveego * Machine independent constants for m68k 50451bfcbcSveego */ 5153b83715Sfredette #ifndef MACHINE_ARCH 52451bfcbcSveego #define _MACHINE_ARCH m68k 53451bfcbcSveego #define MACHINE_ARCH "m68k" 5453b83715Sfredette #endif 5553b83715Sfredette #ifndef MID_MACHINE 56451bfcbcSveego #define MID_MACHINE MID_M68K 5753b83715Sfredette #endif 58e3bce9ddSmatt #ifndef _KERNEL 59e3bce9ddSmatt #undef MACHINE 60e3bce9ddSmatt #define MACHINE "m68k" 61e3bce9ddSmatt #endif 62451bfcbcSveego 63451bfcbcSveego #define NBPG (1 << PGSHIFT) /* bytes/page */ 64451bfcbcSveego #define PGOFSET (NBPG-1) /* byte offset into page */ 65451bfcbcSveego 66451bfcbcSveego #define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) 67451bfcbcSveego 68451bfcbcSveego #define SSIZE 1 /* initial stack size/NBPG */ 69451bfcbcSveego #define SINCR 1 /* increment of stack/NBPG */ 70451bfcbcSveego 71451bfcbcSveego #define USPACE (UPAGES * NBPG) 72451bfcbcSveego 73c5ba7a31Sleo #ifndef MSGBUFSIZE 74c5ba7a31Sleo #define MSGBUFSIZE NBPG /* default message buffer size */ 75c5ba7a31Sleo #endif 76c5ba7a31Sleo 77451bfcbcSveego /* 78451bfcbcSveego * Constants related to network buffer management. 79d9ab16baSsimonb * MCLBYTES must be no larger than NBPG (the software page size), and, 80451bfcbcSveego * on machines that exchange pages of input or output buffers with mbuf 81451bfcbcSveego * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 82451bfcbcSveego * of the hardware page size. 83451bfcbcSveego */ 84d738f90fSitojun #define MSIZE 256 /* size of an mbuf */ 85451bfcbcSveego 86451bfcbcSveego #ifndef MCLSHIFT 87451bfcbcSveego #define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 88d9ab16baSsimonb /* 2K cluster can hold Ether frame */ 89451bfcbcSveego #endif /* MCLSHIFT */ 90451bfcbcSveego 91d9ab16baSsimonb #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 921686aca0Sthorpej 93f7d1a9f1Sveego /* 948759c4e9Sscottr * Mach-derived conversion macros 95f7d1a9f1Sveego */ 96465857f0Stsutsui #define m68k_round_page(x) ((((vaddr_t)(x)) + PGOFSET) & ~PGOFSET) 97465857f0Stsutsui #define m68k_trunc_page(x) ((vaddr_t)(x) & ~PGOFSET) 98465857f0Stsutsui #define m68k_page_offset(x) ((vaddr_t)(x) & PGOFSET) 99465857f0Stsutsui #define m68k_btop(x) ((vaddr_t)(x) >> PGSHIFT) 100465857f0Stsutsui #define m68k_ptob(x) ((vaddr_t)(x) << PGSHIFT) 101f7d1a9f1Sveego 10223a77a73Sisaki /* Default audio blocksize in msec. See sys/dev/audio/audio.c */ 10323a77a73Sisaki #if defined(_KERNEL) 10423a77a73Sisaki #define __AUDIO_BLK_MS (40) 10523a77a73Sisaki #endif 10623a77a73Sisaki 107451bfcbcSveego #endif /* !_M68K_PARAM_H_ */ 108