1 1.24 christos /* $NetBSD: param.h,v 1.24 2021/07/19 10:28:58 christos Exp $ */ 2 1.1 bjh21 3 1.1 bjh21 /* 4 1.1 bjh21 * Copyright (c) 1994,1995 Mark Brinicombe. 5 1.1 bjh21 * All rights reserved. 6 1.1 bjh21 * 7 1.1 bjh21 * Redistribution and use in source and binary forms, with or without 8 1.1 bjh21 * modification, are permitted provided that the following conditions 9 1.1 bjh21 * are met: 10 1.1 bjh21 * 1. Redistributions of source code must retain the above copyright 11 1.1 bjh21 * notice, this list of conditions and the following disclaimer. 12 1.1 bjh21 * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 bjh21 * notice, this list of conditions and the following disclaimer in the 14 1.1 bjh21 * documentation and/or other materials provided with the distribution. 15 1.1 bjh21 * 3. All advertising materials mentioning features or use of this software 16 1.1 bjh21 * must display the following acknowledgement: 17 1.1 bjh21 * This product includes software developed by the RiscBSD team. 18 1.1 bjh21 * 4. The name "RiscBSD" nor the name of the author may be used to 19 1.1 bjh21 * endorse or promote products derived from this software without specific 20 1.1 bjh21 * prior written permission. 21 1.1 bjh21 * 22 1.1 bjh21 * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 1.1 bjh21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 1.1 bjh21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 1.1 bjh21 * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 26 1.1 bjh21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 1.1 bjh21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 1.1 bjh21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 1.1 bjh21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 1.1 bjh21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 1.1 bjh21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 1.1 bjh21 * SUCH DAMAGE. 33 1.1 bjh21 */ 34 1.1 bjh21 35 1.1 bjh21 #ifndef _ARM_PARAM_H_ 36 1.1 bjh21 #define _ARM_PARAM_H_ 37 1.1 bjh21 38 1.1 bjh21 /* 39 1.1 bjh21 * Machine dependent constants for all ARM processors 40 1.1 bjh21 */ 41 1.1 bjh21 42 1.3 matt /* 43 1.3 matt * For KERNEL code: 44 1.5 thorpej * MACHINE must be defined by the individual port. This is so that 45 1.5 thorpej * uname returns the correct thing, etc. 46 1.5 thorpej * 47 1.5 thorpej * MACHINE_ARCH may be defined by individual ports as a temporary 48 1.5 thorpej * measure while we're finishing the conversion to ELF. 49 1.3 matt * 50 1.3 matt * For non-KERNEL code: 51 1.8 scw * If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb". 52 1.3 matt */ 53 1.3 matt 54 1.5 thorpej #if defined(_KERNEL) 55 1.18 matt # ifndef MACHINE_ARCH /* XXX For now */ 56 1.18 matt # ifndef __ARMEB__ 57 1.18 matt # ifdef __ARM_EABI__ 58 1.18 matt # define _MACHINE_ARCH earm 59 1.18 matt # define MACHINE_ARCH "earm" 60 1.18 matt # else 61 1.18 matt # define _MACHINE_ARCH arm 62 1.18 matt # define MACHINE_ARCH "arm" 63 1.18 matt # endif 64 1.18 matt # else 65 1.18 matt # ifdef __ARM_EABI__ 66 1.18 matt # define _MACHINE_ARCH earmeb 67 1.18 matt # define MACHINE_ARCH "earmeb" 68 1.18 matt # else 69 1.18 matt # define _MACHINE_ARCH armeb 70 1.18 matt # define MACHINE_ARCH "armeb" 71 1.18 matt # endif 72 1.18 matt # endif /* __ARMEB__ */ 73 1.18 matt # endif /* MACHINE_ARCH */ 74 1.7 scw #else 75 1.18 matt # undef _MACHINE 76 1.18 matt # undef MACHINE 77 1.18 matt # undef _MACHINE_ARCH 78 1.18 matt # undef MACHINE_ARCH 79 1.18 matt # define _MACHINE arm 80 1.18 matt # define MACHINE "arm" 81 1.18 matt # ifndef __ARMEB__ 82 1.18 matt # ifdef __ARM_EABI__ 83 1.19 matt # ifdef __ARM_PCS_VFP 84 1.19 matt # ifdef _ARM_ARCH_7 85 1.19 matt # define _MACHINE_ARCH earmv7hf 86 1.19 matt # define MACHINE_ARCH "earmv7hf" 87 1.19 matt # elif defined(_ARM_ARCH_6) 88 1.19 matt # define _MACHINE_ARCH earmv6hf 89 1.19 matt # define MACHINE_ARCH "earmv6hf" 90 1.19 matt # else 91 1.19 matt # define _MACHINE_ARCH earmhf 92 1.19 matt # define MACHINE_ARCH "earmhf" 93 1.19 matt # endif 94 1.19 matt # else 95 1.19 matt # ifdef _ARM_ARCH_7 96 1.19 matt # define _MACHINE_ARCH earmv7 97 1.19 matt # define MACHINE_ARCH "earmv7" 98 1.19 matt # elif defined(_ARM_ARCH_6) 99 1.19 matt # define _MACHINE_ARCH earmv6 100 1.19 matt # define MACHINE_ARCH "earmv6" 101 1.19 matt # elif !defined(_ARM_ARCH_5T) 102 1.19 matt # define _MACHINE_ARCH earmv4 103 1.19 matt # define MACHINE_ARCH "earmv4" 104 1.19 matt # else 105 1.19 matt # define _MACHINE_ARCH earm 106 1.19 matt # define MACHINE_ARCH "earm" 107 1.19 matt # endif 108 1.19 matt # endif 109 1.18 matt # else 110 1.18 matt # define _MACHINE_ARCH arm 111 1.18 matt # define MACHINE_ARCH "arm" 112 1.18 matt # endif 113 1.18 matt # else 114 1.18 matt # ifdef __ARM_EABI__ 115 1.19 matt # ifdef __ARM_PCS_VFP 116 1.19 matt # ifdef _ARM_ARCH_7 117 1.19 matt # define _MACHINE_ARCH earmv7hfeb 118 1.19 matt # define MACHINE_ARCH "earmv7hfeb" 119 1.19 matt # elif defined(_ARM_ARCH_6) 120 1.19 matt # define _MACHINE_ARCH earmv6hfeb 121 1.19 matt # define MACHINE_ARCH "earmv6hfeb" 122 1.19 matt # else 123 1.19 matt # define _MACHINE_ARCH earmhfeb 124 1.19 matt # define MACHINE_ARCH "earmhfeb" 125 1.19 matt # endif 126 1.19 matt # else 127 1.19 matt # ifdef _ARM_ARCH_7 128 1.19 matt # define _MACHINE_ARCH earmv7eb 129 1.19 matt # define MACHINE_ARCH "earmv7eb" 130 1.19 matt # elif defined(_ARM_ARCH_6) 131 1.19 matt # define _MACHINE_ARCH earmv6eb 132 1.19 matt # define MACHINE_ARCH "earmv6eb" 133 1.19 matt # elif !defined(_ARM_ARCH_5T) 134 1.19 matt # define _MACHINE_ARCH earmv4eb 135 1.19 matt # define MACHINE_ARCH "earmv4eb" 136 1.19 matt # else 137 1.19 matt # define _MACHINE_ARCH earmeb 138 1.19 matt # define MACHINE_ARCH "earmeb" 139 1.19 matt # endif 140 1.19 matt # endif 141 1.18 matt # else 142 1.18 matt # define _MACHINE_ARCH armeb 143 1.18 matt # define MACHINE_ARCH "armeb" 144 1.18 matt # endif 145 1.18 matt # endif /* __ARMEB__ */ 146 1.12 matt #endif /* !_KERNEL */ 147 1.1 bjh21 148 1.21 skrll #define MAXCPUS 8 149 1.21 skrll 150 1.1 bjh21 #define MID_MACHINE MID_ARM6 151 1.1 bjh21 152 1.4 bjh21 /* ARM-specific macro to align a stack pointer (downwards). */ 153 1.15 christos #define STACK_ALIGNBYTES (8 - 1) 154 1.17 matt #ifdef __ARM_EABI__ 155 1.16 matt #define ALIGNBYTES32 3 156 1.17 matt #else 157 1.17 matt #define ALIGNBYTES32 7 158 1.17 matt #endif 159 1.1 bjh21 160 1.2 matt /* 161 1.2 matt * Constants related to network buffer management. 162 1.2 matt * MCLBYTES must be no larger than NBPG (the software page size), and, 163 1.2 matt * on machines that exchange pages of input or output buffers with mbuf 164 1.2 matt * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 165 1.2 matt * of the hardware page size. 166 1.2 matt */ 167 1.2 matt #define MSIZE 256 /* size of an mbuf */ 168 1.6 simonb 169 1.6 simonb #ifndef MCLSHIFT 170 1.2 matt #define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 171 1.6 simonb /* 2K cluster can hold Ether frame */ 172 1.6 simonb #endif /* MCLSHIFT */ 173 1.6 simonb 174 1.2 matt #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 175 1.1 bjh21 176 1.13 joerg #ifndef NMBCLUSTERS_MAX 177 1.20 mlelstv #define NMBCLUSTERS_MAX (0x4000000 / MCLBYTES) /* Limit to 64MB for clusters */ 178 1.13 joerg #endif 179 1.13 joerg 180 1.9 jdolecek /* 181 1.9 jdolecek * Compatibility /dev/zero mapping. 182 1.9 jdolecek */ 183 1.9 jdolecek #ifdef _KERNEL 184 1.9 jdolecek #ifdef COMPAT_16 185 1.9 jdolecek #define COMPAT_ZERODEV(x) (x == makedev(0, _DEV_ZERO_oARM)) 186 1.9 jdolecek #endif 187 1.9 jdolecek #endif /* _KERNEL */ 188 1.9 jdolecek 189 1.1 bjh21 #endif /* _ARM_PARAM_H_ */ 190