1 1.12 skrll /* $NetBSD: param.h,v 1.12 2023/10/06 11:45:37 skrll Exp $ */ 2 1.1 cherry 3 1.1 cherry /*- 4 1.1 cherry * Copyright (c) 1990 The Regents of the University of California. 5 1.1 cherry * All rights reserved. 6 1.1 cherry * 7 1.1 cherry * This code is derived from software contributed to Berkeley by 8 1.1 cherry * William Jolitz. 9 1.1 cherry * 10 1.1 cherry * Redistribution and use in source and binary forms, with or without 11 1.1 cherry * modification, are permitted provided that the following conditions 12 1.1 cherry * are met: 13 1.1 cherry * 1. Redistributions of source code must retain the above copyright 14 1.1 cherry * notice, this list of conditions and the following disclaimer. 15 1.1 cherry * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 cherry * notice, this list of conditions and the following disclaimer in the 17 1.1 cherry * documentation and/or other materials provided with the distribution. 18 1.1 cherry * 3. Neither the name of the University nor the names of its contributors 19 1.1 cherry * may be used to endorse or promote products derived from this software 20 1.1 cherry * without specific prior written permission. 21 1.1 cherry * 22 1.1 cherry * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 1.1 cherry * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 1.1 cherry * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 1.1 cherry * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 1.1 cherry * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 1.1 cherry * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 1.1 cherry * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 1.1 cherry * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 1.1 cherry * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 1.1 cherry * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 1.1 cherry * SUCH DAMAGE. 33 1.1 cherry * 34 1.1 cherry * @(#)param.h 5.8 (Berkeley) 6/28/91 35 1.1 cherry */ 36 1.1 cherry 37 1.1 cherry #ifndef _IA64_PARAM_H_ 38 1.1 cherry #define _IA64_PARAM_H_ 39 1.1 cherry 40 1.11 simonb #ifdef _KERNEL_OPT 41 1.11 simonb #include "opt_param.h" 42 1.11 simonb #endif 43 1.11 simonb 44 1.1 cherry /* 45 1.1 cherry * Machine dependent constants for Intel Itanium. 46 1.1 cherry */ 47 1.1 cherry 48 1.5 chs #ifdef _KERNEL 49 1.5 chs #include <machine/cpu.h> 50 1.5 chs #endif 51 1.5 chs 52 1.1 cherry #define _MACHINE ia64 53 1.1 cherry #define MACHINE "ia64" 54 1.1 cherry #define _MACHINE_ARCH ia64 55 1.1 cherry #define MACHINE_ARCH "ia64" 56 1.1 cherry #define MID_MACHINE MID_IA64 57 1.1 cherry 58 1.5 chs #ifdef MULTIPROCESSOR 59 1.1 cherry #define MAXCPU 16 60 1.1 cherry #else 61 1.1 cherry #define MAXCPU 1 62 1.1 cherry #endif 63 1.1 cherry 64 1.1 cherry #define UPAGES 4 65 1.1 cherry #define USPACE (UPAGES * NBPG) /* total size of u-area */ 66 1.1 cherry 67 1.1 cherry #ifndef MSGBUFSIZE 68 1.1 cherry #define MSGBUFSIZE NBPG /* default message buffer size */ 69 1.1 cherry #endif 70 1.1 cherry 71 1.1 cherry #ifndef KSTACK_PAGES 72 1.1 cherry #define KSTACK_PAGES 4 /* pages of kernel stack */ 73 1.1 cherry #endif 74 1.1 cherry #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ 75 1.1 cherry 76 1.1 cherry #define ALIGNBYTES32 (sizeof(int) - 1) 77 1.1 cherry #define ALIGN32(p) (((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32) 78 1.1 cherry 79 1.9 scole #ifndef LOG2_PAGE_SIZE 80 1.9 scole #define LOG2_PAGE_SIZE 14 /* 16K pages by default. */ 81 1.9 scole #endif 82 1.1 cherry #define PGSHIFT 14 /* LOG2(NBPG) */ 83 1.1 cherry #define NBPG (1 << PGSHIFT) /* bytes/page */ 84 1.1 cherry #define PGOFSET (NBPG-1) /* byte offset into page */ 85 1.1 cherry #define NPTEPG (NBPG/(sizeof (pt_entry_t))) 86 1.1 cherry /* 87 1.1 cherry * Constants related to network buffer management. 88 1.1 cherry * MCLBYTES must be no larger than NBPG (the software page size), and, 89 1.1 cherry * on machines that exchange pages of input or output buffers with mbuf 90 1.1 cherry * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 91 1.1 cherry * of the hardware page size. 92 1.1 cherry */ 93 1.1 cherry #define MSIZE 256 /* size of an mbuf */ 94 1.1 cherry 95 1.1 cherry #ifndef MCLSHIFT 96 1.1 cherry #define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 97 1.1 cherry /* 2K cluster can hold Ether frame */ 98 1.1 cherry #endif /* MCLSHIFT */ 99 1.1 cherry 100 1.1 cherry #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 101 1.1 cherry 102 1.1 cherry /* 103 1.1 cherry * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 104 1.1 cherry * logical pages. 105 1.8 para * No enforced maxmimum an ia64 106 1.1 cherry */ 107 1.8 para #define NKMEMPAGES_MIN_DEFAULT ((32 * 1024 * 1024) >> PAGE_SHIFT) 108 1.8 para #define NKMEMPAGES_MAX_UNLIMITED 1 109 1.1 cherry 110 1.9 scole /* The default size of identity mappings in region 6 & 7. */ 111 1.9 scole #ifndef LOG2_ID_PAGE_SIZE 112 1.9 scole #define LOG2_ID_PAGE_SIZE 16 113 1.9 scole #endif 114 1.9 scole 115 1.1 cherry /* 116 1.1 cherry * Mach derived conversion macros 117 1.1 cherry */ 118 1.1 cherry 119 1.1 cherry #define ia64_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG - 1)) 120 1.1 cherry #define ia64_trunc_page(x) ((unsigned long)(x) & ~(NBPG - 1)) 121 1.12 skrll 122 1.1 cherry #define ia64_btop(x) ((unsigned long)(x) >> PGSHIFT) 123 1.12 skrll #define ia64_ptob(x) ((unsigned long)(x) << PGSHIFT) 124 1.12 skrll 125 1.1 cherry #ifdef _KERNEL 126 1.1 cherry #ifndef _LOCORE 127 1.1 cherry 128 1.1 cherry #include <machine/intr.h> 129 1.1 cherry 130 1.3 kiyohara static __inline void delay(unsigned int us) {} /* XXXXX */ 131 1.3 kiyohara 132 1.1 cherry #endif /* _LOCORE */ 133 1.1 cherry #endif /* _KERNEL */ 134 1.1 cherry 135 1.1 cherry #endif /* _IA64_PARAM_H_ */ 136