genassym.cf revision 1.88
1# $NetBSD: genassym.cf,v 1.88 2020/02/18 10:33:38 skrll Exp $ 2 3# Copyright (c) 1982, 1990 The Regents of the University of California. 4# All rights reserved. 5# 6# This code is derived from software contributed to Berkeley by 7# William Jolitz. 8# 9# Redistribution and use in source and binary forms, with or without 10# modification, are permitted provided that the following conditions 11# are met: 12# 1. Redistributions of source code must retain the above copyright 13# notice, this list of conditions and the following disclaimer. 14# 2. Redistributions in binary form must reproduce the above copyright 15# notice, this list of conditions and the following disclaimer in the 16# documentation and/or other materials provided with the distribution. 17# 3. Neither the name of the University nor the names of its contributors 18# may be used to endorse or promote products derived from this software 19# without specific prior written permission. 20# 21# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31# SUCH DAMAGE. 32 33if defined(_KERNEL_OPT) 34include "opt_multiprocessor.h" 35include "opt_compat_netbsd.h" 36include "opt_execfmt.h" 37endif 38 39include <sys/param.h> 40include <sys/systm.h> 41include <sys/mbuf.h> 42include <sys/proc.h> 43include <sys/resourcevar.h> 44include <sys/device.h> 45include <sys/signal.h> 46include <netinet/in.h> 47include <netinet/in_systm.h> 48include <netinet/ip.h> 49include <netinet/ip6.h> 50include <netinet/ip_var.h> 51 52include <uvm/uvm_extern.h> 53 54include <arm/fiq.h> 55include <arm/vfpreg.h> 56include <arm/locore.h> 57include <arm/undefined.h> 58 59include <arm/arm32/pte.h> 60include <machine/pmap.h> 61include <machine/pcb.h> 62include <machine/vmparam.h> 63 64define __PROG32 1 65ifdef __ARM_FIQ_INDIRECT 66define __ARM_FIQ_INDIRECT 1 67endif 68 69ifdef __HAVE_PREEMPTION 70define __HAVE_PREEMPTION 1 71endif 72 73ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS 74define __HAVE_MM_MD_DIRECT_MAPPED_PHYS 1 75endif 76 77ifdef __HAVE_FAST_SOFTINTS 78define __HAVE_FAST_SOFTINTS 1 79endif 80 81ifdef __HAVE_PIC_FAST_SOFTINTS 82define __HAVE_PIC_FAST_SOFTINTS 1 83endif 84 85ifdef ARM_MMU_EXTENDED 86define ARM_MMU_EXTENDED 1 87endif 88 89ifdef VERBOSE_INIT_ARM 90define VERBOSE_INIT_ARM 1 91endif 92 93define KERNEL_BASE KERNEL_BASE 94define VM_MIN_ADDRESS VM_MIN_ADDRESS 95define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS 96 97define PMAP_DOMAIN_KERNEL PMAP_DOMAIN_KERNEL 98define DOMAIN_CLIENT DOMAIN_CLIENT 99define DOMAIN_DEFAULT DOMAIN_DEFAULT 100 101define L1_S_PROTO_generic L1_S_PROTO_generic 102define L1_S_PROTO_armv7 L1_S_PROTO_armv7 103 104define L1_S_PROTO_xscale L1_S_PROTO_xscale 105if ARM_NMMUS == 1 106define L1_S_PROTO L1_S_PROTO 107endif 108define L1_S_FRAME L1_S_FRAME 109define L1_S_SHIFT L1_S_SHIFT 110define L1_S_SIZE L1_S_SIZE 111define L1_S_CACHEABLE L1_S_C|L1_S_B|L1_S_V6_S 112define L1_S_B L1_S_B 113define L1_S_C L1_S_C 114define L1_S_V6_S L1_S_V6_S 115define L1_S_V6_XN L1_S_V6_XN 116define L1_S_AP_KR L1_S_AP(AP_KR) 117define L1_S_AP_KRW L1_S_AP(AP_KRW) 118define L1_S_APv7_KRW L1_S_AP(AP7_KRW) 119define L1_S_DOM_MASK L1_S_DOM_MASK 120define L1_TABLE_SIZE L1_TABLE_SIZE 121define L1_TYPE_S L1_TYPE_S 122define L1_S_DOM_KERNEL L1_S_DOM(PMAP_DOMAIN_KERNEL) 123define L2_S_SIZE L2_S_SIZE 124 125define L1_C_PROTO_generic L1_C_PROTO_generic 126 127define L2_S_PROTO_generic L2_S_PROTO_generic 128define L2_S_SHIFT L2_S_SHIFT 129define L2_S_SIZE L2_S_SIZE 130define L2_C L2_C 131define L2_AP_KRW L2_AP(AP_KRW) 132 133define TTBCR_S_N_1 __SHIFTIN(1, TTBCR_S_N) 134 135define TTBR_UPATTR TTBR_UPATTR 136define TTBR_MPATTR TTBR_MPATTR 137 138ifdef PMAP_INCLUDE_PTE_SYNC 139define PMAP_INCLUDE_PTE_SYNC 1 140endif 141 142define PAGE_MASK PAGE_MASK 143define PAGE_SIZE PAGE_SIZE 144define UPAGES UPAGES 145define PGSHIFT PGSHIFT 146 147define MAXCPUS MAXCPUS 148 149#define PSR_HYP32_MODE PSR_HYP32_MODE 150#define PSR_SVC32_MODE PSR_SVC32_MODE 151#define PSR_MODE PSR_MODE 152#define CPU_CONTROL_DC_ENABLE CPU_CONTROL_DC_ENABLE 153#define TTBCR_S_PD0 TTBCR_S_PD0 154 155# Important offsets into the lwp and proc structs & associated constants 156define L_PCB offsetof(struct lwp, l_addr) 157define L_CPU offsetof(struct lwp, l_cpu) 158define L_PROC offsetof(struct lwp, l_proc) 159define L_PRIVATE offsetof(struct lwp, l_private) 160define L_FLAG offsetof(struct lwp, l_flag) 161define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) 162define L_MD_TF offsetof(struct lwp, l_md.md_tf) 163define MDLWP_NOALIGNFLT MDLWP_NOALIGNFLT 164 165define LW_SYSTEM LW_SYSTEM 166 167define P_RASLIST offsetof(struct proc, p_raslist) 168 169define PCB_R8 offsetof(struct pcb, pcb_r8) 170define PCB_R9 offsetof(struct pcb, pcb_r9) 171define PCB_R10 offsetof(struct pcb, pcb_r10) 172define PCB_R11 offsetof(struct pcb, pcb_r11) 173define PCB_R12 offsetof(struct pcb, pcb_r12) 174define PCB_KSP offsetof(struct pcb, pcb_sp) 175define PCB_LR offsetof(struct pcb, pcb_lr) 176define PCB_PC offsetof(struct pcb, pcb_pc) 177define PCB_USER_PID_RW offsetof(struct pcb, pcb_user_pid_rw) 178define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 179define PCB_VFP_FPEXC offsetof(struct pcb, pcb_vfp.vfp_fpexc) 180 181define PCB_SIZE sizeof(struct pcb) 182 183define VM_MAP offsetof(struct vmspace, vm_map) 184define VM_PMAP offsetof(struct vmspace, vm_map.pmap) 185 186define PR_BASE offsetof(struct uprof, pr_base) 187define PR_SIZE offsetof(struct uprof, pr_size) 188define PR_OFF offsetof(struct uprof, pr_off) 189define PR_SCALE offsetof(struct uprof, pr_scale) 190 191define SIGTRAP SIGTRAP 192define SIGEMT SIGEMT 193 194define TF_SPSR offsetof(struct trapframe, tf_spsr) 195define TF_FILL offsetof(struct trapframe, tf_fill) 196define TF_R0 offsetof(struct trapframe, tf_r0) 197define TF_R4 offsetof(struct trapframe, tf_r4) 198define TF_R6 offsetof(struct trapframe, tf_r6) 199define TF_R8 offsetof(struct trapframe, tf_r8) 200define TF_R10 offsetof(struct trapframe, tf_r10) 201define TF_R12 offsetof(struct trapframe, tf_r12) 202define TF_USR_SP offsetof(struct trapframe, tf_usr_sp) 203define TF_USR_LR offsetof(struct trapframe, tf_usr_lr) 204define TF_SVC_SP offsetof(struct trapframe, tf_svc_sp) 205define TF_SVC_LR offsetof(struct trapframe, tf_svc_lr) 206define TF_PC offsetof(struct trapframe, tf_pc) 207 208define PROCSIZE sizeof(struct proc) 209define TRAPFRAMESIZE sizeof(struct trapframe) 210 211define CF_IDCACHE_WBINV_ALL offsetof(struct cpu_functions, cf_idcache_wbinv_all) 212define CF_DCACHE_WB_RANGE offsetof(struct cpu_functions, cf_dcache_wb_range) 213define CF_TLB_FLUSHID_SE offsetof(struct cpu_functions, cf_tlb_flushID_SE) 214define CF_CONTEXT_SWITCH offsetof(struct cpu_functions, cf_context_switch) 215define CF_SLEEP offsetof(struct cpu_functions, cf_sleep) 216define CF_CONTROL offsetof(struct cpu_functions, cf_control) 217 218define CPU_INFO_SIZE sizeof(struct cpu_info) 219define CI_ARM_CPUID offsetof(struct cpu_info, ci_arm_cpuid) 220define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending) 221define CI_CPL offsetof(struct cpu_info, ci_cpl) 222define CI_CURLWP offsetof(struct cpu_info, ci_curlwp) 223define CI_INTR_DEPTH offsetof(struct cpu_info, ci_intr_depth) 224define CI_MIDR offsetof(struct cpu_info, ci_midr) 225define CI_MPIDR offsetof(struct cpu_info, ci_mpidr) 226define CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count) 227define CI_LASTLWP offsetof(struct cpu_info, ci_lastlwp) 228define CI_UNDEFSAVE offsetof(struct cpu_info, ci_undefsave[0]) 229define CI_IDLELWP offsetof(struct cpu_info, ci_data.cpu_idlelwp) 230define CI_CC_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) 231if defined(EXEC_AOUT) 232define CI_CTRL offsetof(struct cpu_info, ci_ctrl) 233endif 234ifdef __HAVE_FAST_SOFTINTS 235define CI_SOFTINTS offsetof(struct cpu_info, ci_softints) 236endif 237ifdef FPU_VFP 238define CI_VFP_ID offsetof(struct cpu_info, ci_vfp_id) 239endif 240 241define VFP_FPEXC_EN VFP_FPEXC_EN 242 243define NSACR_VFPCP NSACR_CPn(VFP_COPROC)|NSACR_CPn(VFP_COPROC2) 244 245# Constants required for in_cksum() and friends. 246define M_LEN offsetof(struct mbuf, m_len) 247define M_DATA offsetof(struct mbuf, m_data) 248define M_NEXT offsetof(struct mbuf, m_next) 249define IP_SRC offsetof(struct ip, ip_src) 250define IP_DST offsetof(struct ip, ip_dst) 251 252# Cache information 253define DCACHE_LINE_SIZE offsetof(struct arm_cache_info, dcache_line_size) 254define DCACHE_SIZE offsetof(struct arm_cache_info, dcache_size) 255