1*b1b36fc1Ssimonb /* $NetBSD: param.h,v 1.64 2021/05/31 14:38:56 simonb Exp $ */ 28026fb53Sragge /*- 38026fb53Sragge * Copyright (c) 1990 The Regents of the University of California. 48026fb53Sragge * All rights reserved. 58026fb53Sragge * 68026fb53Sragge * This code is derived from software contributed to Berkeley by 78026fb53Sragge * William Jolitz. 88026fb53Sragge * 98026fb53Sragge * Redistribution and use in source and binary forms, with or without 108026fb53Sragge * modification, are permitted provided that the following conditions 118026fb53Sragge * are met: 128026fb53Sragge * 1. Redistributions of source code must retain the above copyright 138026fb53Sragge * notice, this list of conditions and the following disclaimer. 148026fb53Sragge * 2. Redistributions in binary form must reproduce the above copyright 158026fb53Sragge * notice, this list of conditions and the following disclaimer in the 168026fb53Sragge * documentation and/or other materials provided with the distribution. 17aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 188026fb53Sragge * may be used to endorse or promote products derived from this software 198026fb53Sragge * without specific prior written permission. 208026fb53Sragge * 218026fb53Sragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 228026fb53Sragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 238026fb53Sragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 248026fb53Sragge * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 258026fb53Sragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 268026fb53Sragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 278026fb53Sragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 288026fb53Sragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 298026fb53Sragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 308026fb53Sragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 318026fb53Sragge * SUCH DAMAGE. 328026fb53Sragge * 33d62187c0Scgd * @(#)param.h 5.8 (Berkeley) 6/28/91 348026fb53Sragge */ 358026fb53Sragge 36ca490941Sragge #ifndef _VAX_PARAM_H_ 37ca490941Sragge #define _VAX_PARAM_H_ 388026fb53Sragge 39*b1b36fc1Ssimonb #ifdef _KERNEL_OPT 40*b1b36fc1Ssimonb #include "opt_param.h" 41*b1b36fc1Ssimonb #endif 42*b1b36fc1Ssimonb 438026fb53Sragge /* 448026fb53Sragge * Machine dependent constants for VAX. 458026fb53Sragge */ 468026fb53Sragge 4718ec26aaScgd #define _MACHINE vax 488026fb53Sragge #define MACHINE "vax" 4918ec26aaScgd #define _MACHINE_ARCH vax 5031f199d4Sragge #define MACHINE_ARCH "vax" 518026fb53Sragge #define MID_MACHINE MID_VAX 528026fb53Sragge 53d0e7a99aSragge #define PGSHIFT 12 /* LOG2(NBPG) */ 548026fb53Sragge #define NBPG (1 << PGSHIFT) /* (1 << PGSHIFT) bytes/page */ 558026fb53Sragge #define PGOFSET (NBPG - 1) /* byte offset into page */ 56d0e7a99aSragge 57d0e7a99aSragge #define VAX_PGSHIFT 9 58d0e7a99aSragge #define VAX_NBPG (1 << VAX_PGSHIFT) 59d0e7a99aSragge #define VAX_PGOFSET (VAX_NBPG - 1) 60e8c7c2f8Smatt #define VAX_NPTEPG (VAX_NBPG / 4) 618026fb53Sragge 628026fb53Sragge #define KERNBASE 0x80000000 /* start of kernel virtual */ 638026fb53Sragge 64a5ce96e9Sragge #define UPAGES 2 /* pages of u-area */ 65d0e7a99aSragge #define USPACE (NBPG*UPAGES) 668065606aSrmind #define REDZONEADDR (VAX_NBPG*3) /* Must be > sizeof(struct pcb) */ 678026fb53Sragge 68d4713d24Sleo #ifndef MSGBUFSIZE 69d0e7a99aSragge #define MSGBUFSIZE NBPG /* default message buffer size */ 70d4713d24Sleo #endif 71d4713d24Sleo 728026fb53Sragge /* 73abc9dff1Sjdolecek * KVA is very tight on vax, reduce the amount of KVA used by pipe 74abc9dff1Sjdolecek * "direct" write code to reasonably low value. 75abc9dff1Sjdolecek */ 76abc9dff1Sjdolecek #ifndef PIPE_DIRECT_CHUNK 77abc9dff1Sjdolecek #define PIPE_DIRECT_CHUNK 65536 78abc9dff1Sjdolecek #endif 79abc9dff1Sjdolecek 80abc9dff1Sjdolecek /* 818026fb53Sragge * Constants related to network buffer management. 82d0e7a99aSragge * MCLBYTES must be no larger than NBPG (the software page size), and, 838026fb53Sragge * on machines that exchange pages of input or output buffers with mbuf 848026fb53Sragge * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 858026fb53Sragge * of the hardware page size. 868026fb53Sragge */ 87d738f90fSitojun #define MSIZE 256 /* size of an mbuf */ 888026fb53Sragge 898026fb53Sragge #ifndef MCLSHIFT 90218681f3Sragge #define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 91d9ab16baSsimonb /* 2K cluster can hold Ether frame */ 928026fb53Sragge #endif /* MCLSHIFT */ 93d9ab16baSsimonb 94d9ab16baSsimonb #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 958026fb53Sragge 968026fb53Sragge /* 97dded044fSthorpej * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 98dded044fSthorpej * logical pages. 998026fb53Sragge */ 100dded044fSthorpej #define NKMEMPAGES_MIN_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT) 101dded044fSthorpej #define NKMEMPAGES_MAX_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT) 1028026fb53Sragge 1038026fb53Sragge /* 1048026fb53Sragge * Some macros for units conversion 1058026fb53Sragge */ 1068026fb53Sragge 10704ef5573Smatt #define btop(x) ((x) >> PGSHIFT) 1088026fb53Sragge 109d0e7a99aSragge /* MD conversion macros */ 110d0e7a99aSragge #define vax_btoc(x) (((unsigned)(x) + VAX_PGOFSET) >> VAX_PGSHIFT) 111d0e7a99aSragge #define vax_btop(x) (((unsigned)(x)) >> VAX_PGSHIFT) 112f07a586dSragge 113f07a586dSragge #ifdef _KERNEL 114b8cccfafSmatt #include <machine/intr.h> 11502d0803cSragge 11626d151d2Sragge /* Prototype needed for delay() */ 11726d151d2Sragge #ifndef _LOCORE 118dfba8166Smatt void delay(int); 119b3574d39Sragge /* inline macros used inside kernel */ 120b3574d39Sragge #include <machine/macros.h> 12126d151d2Sragge #endif 12226d151d2Sragge 12331f199d4Sragge #define DELAY(x) delay(x) 124b94f79f0Sad #define MAXEXEC 1 12523a77a73Sisaki 12623a77a73Sisaki /* Default audio blocksize in msec. See sys/dev/audio/audio.c */ 12723a77a73Sisaki #define __AUDIO_BLK_MS (40) 12823a77a73Sisaki 129cd0d651dSragge #endif /* _KERNEL */ 130a412d480Sragge 131ca490941Sragge #endif /* _VAX_PARAM_H_ */ 132