genassym.cf revision 1.70
11.70Smatt# $NetBSD: genassym.cf,v 1.70 2015/03/23 17:28:14 matt Exp $ 21.1Schris 31.1Schris# Copyright (c) 1982, 1990 The Regents of the University of California. 41.1Schris# All rights reserved. 51.1Schris# 61.1Schris# This code is derived from software contributed to Berkeley by 71.1Schris# William Jolitz. 81.1Schris# 91.1Schris# Redistribution and use in source and binary forms, with or without 101.1Schris# modification, are permitted provided that the following conditions 111.1Schris# are met: 121.1Schris# 1. Redistributions of source code must retain the above copyright 131.1Schris# notice, this list of conditions and the following disclaimer. 141.1Schris# 2. Redistributions in binary form must reproduce the above copyright 151.1Schris# notice, this list of conditions and the following disclaimer in the 161.1Schris# documentation and/or other materials provided with the distribution. 171.41Stsutsui# 3. Neither the name of the University nor the names of its contributors 181.1Schris# may be used to endorse or promote products derived from this software 191.1Schris# without specific prior written permission. 201.1Schris# 211.1Schris# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221.1Schris# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231.1Schris# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241.1Schris# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251.1Schris# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261.1Schris# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271.1Schris# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281.1Schris# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291.1Schris# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301.1Schris# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311.1Schris# SUCH DAMAGE. 321.1Schris 331.1Schrisinclude <sys/param.h> 341.1Schrisinclude <sys/systm.h> 351.25Sscwinclude <sys/mbuf.h> 361.1Schrisinclude <sys/proc.h> 371.1Schrisinclude <sys/resourcevar.h> 381.1Schrisinclude <sys/device.h> 391.1Schrisinclude <sys/signal.h> 401.25Sscwinclude <netinet/in.h> 411.25Sscwinclude <netinet/in_systm.h> 421.25Sscwinclude <netinet/ip.h> 431.25Sscwinclude <netinet/ip6.h> 441.25Sscwinclude <netinet/ip_var.h> 451.1Schris 461.1Schrisinclude <uvm/uvm_extern.h> 471.8Sthorpej 481.8Sthorpejinclude <arm/fiq.h> 491.58Smattinclude <arm/vfpreg.h> 501.65Smattinclude <arm/locore.h> 511.68Smattinclude <arm/undefined.h> 521.1Schris 531.45Smattinclude <arm/arm32/pte.h> 541.1Schrisinclude <machine/pmap.h> 551.49Smattinclude <machine/pcb.h> 561.1Schrisinclude <machine/vmparam.h> 571.6Sthorpej 581.66Sjmcneillif defined(_KERNEL_OPT) 591.16Sbjh21include "opt_multiprocessor.h" 601.26Sscwinclude "opt_compat_netbsd.h" 611.26Sscwinclude "opt_execfmt.h" 621.66Sjmcneillendif 631.16Sbjh21 641.6Sthorpejdefine __PROG32 1 651.10Sthorpejifdef __ARM_FIQ_INDIRECT 661.10Sthorpejdefine __ARM_FIQ_INDIRECT 1 671.10Sthorpejendif 681.1Schris 691.59Smattifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS 701.59Smattdefine __HAVE_MM_MD_DIRECT_MAPPED_PHYS 1 711.59Smattendif 721.59Smatt 731.37Smattifdef __HAVE_FAST_SOFTINTS 741.37Smattdefine __HAVE_FAST_SOFTINTS 1 751.37Smattendif 761.37Smatt 771.52Smattifdef __HAVE_PIC_FAST_SOFTINTS 781.52Smattdefine __HAVE_PIC_FAST_SOFTINTS 1 791.52Smattendif 801.52Smatt 811.40Smattifdef __HAVE_UNNESTED_INTRS 821.40Smattdefine __HAVE_UNNESTED_INTRS 1 831.40Smattendif 841.40Smatt 851.68Smattifdef ARM_MMU_EXTENDED 861.68Smattdefine ARM_MMU_EXTENDED 1 871.68Smattendif 881.68Smatt 891.69Smattifdef VERBOSE_INIT_ARM 901.69Smattdefine VERBOSE_INIT_ARM 1 911.69Smattendif 921.69Smatt 931.31Smattdefine KERNEL_BASE KERNEL_BASE 941.1Schrisdefine VM_MIN_ADDRESS VM_MIN_ADDRESS 951.1Schrisdefine VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS 961.22Sscw 971.54Smattdefine DCACHE_LINE_SIZE offsetof(struct arm_cache_info, dcache_line_size) 981.54Smatt 991.51Smattdefine PV_PA offsetof(pv_addr_t, pv_pa) 1001.22Sscwdefine PMAP_DOMAIN_KERNEL PMAP_DOMAIN_KERNEL 1011.45Smattdefine DOMAIN_CLIENT DOMAIN_CLIENT 1021.68Smattifdef ARM_MMU_EXTENDED 1031.68Smattdefine DOMAIN_DEFAULT ((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | (DOMAIN_CLIENT << (PMAP_DOMAIN_USER*2))) 1041.68Smattelse 1051.68Smattdefine DOMAIN_DEFAULT ((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) 1061.68Smattendif 1071.68Smatt 1081.45Smattdefine L1_S_PROTO_generic L1_S_PROTO_generic 1091.45Smattdefine L1_S_PROTO_armv7 L1_S_PROTO_armv7 1101.45Smattdefine L1_S_PROTO_xscale L1_S_PROTO_xscale 1111.45Smattif ARM_NMMUS == 1 1121.45Smattdefine L1_S_PROTO L1_S_PROTO 1131.45Smattendif 1141.45Smattdefine L1_S_FRAME L1_S_FRAME 1151.45Smattdefine L1_S_SHIFT L1_S_SHIFT 1161.45Smattdefine L1_S_SIZE L1_S_SIZE 1171.68Smattdefine L1_S_CACHEABLE L1_S_C|L1_S_B|L1_S_V6_S 1181.45Smattdefine L1_S_B L1_S_B 1191.45Smattdefine L1_S_C L1_S_C 1201.62Smattdefine L1_S_V6_S L1_S_V6_S 1211.68Smattdefine L1_S_V6_XN L1_S_V6_XN 1221.53Smattdefine L1_S_AP_KR L1_S_AP(AP_KR) 1231.45Smattdefine L1_S_AP_KRW L1_S_AP(AP_KRW) 1241.45Smattdefine L1_S_APv7_KRW L1_S_AP(AP7_KRW) 1251.68Smattdefine L1_S_DOM_MASK L1_S_DOM_MASK 1261.45Smattdefine L1_TABLE_SIZE L1_TABLE_SIZE 1271.45Smattdefine L1_TYPE_S L1_TYPE_S 1281.45Smattdefine L1_S_DOM_KERNEL L1_S_DOM(PMAP_DOMAIN_KERNEL) 1291.63Smattdefine L2_S_SIZE L2_S_SIZE 1301.23Sthorpej 1311.61Skiyoharadefine L1_C_PROTO_generic L1_C_PROTO_generic 1321.61Skiyohara 1331.61Skiyoharadefine L2_S_PROTO_generic L2_S_PROTO_generic 1341.61Skiyoharadefine L2_S_SHIFT L2_S_SHIFT 1351.61Skiyoharadefine L2_S_SIZE L2_S_SIZE 1361.61Skiyoharadefine L2_C L2_C 1371.61Skiyoharadefine L2_AP_KRW L2_AP(AP_KRW) 1381.61Skiyohara 1391.68Smattdefine TTBCR_S_N_1 __SHIFTIN(1, TTBCR_S_N) 1401.68Smatt 1411.23Sthorpejifdef PMAP_INCLUDE_PTE_SYNC 1421.23Sthorpejdefine PMAP_INCLUDE_PTE_SYNC 1 1431.22Sscwendif 1441.1Schris 1451.54Smattdefine PAGE_MASK PAGE_MASK 1461.21Sthorpejdefine PAGE_SIZE PAGE_SIZE 1471.1Schrisdefine UPAGES UPAGES 1481.1Schrisdefine PGSHIFT PGSHIFT 1491.1Schris 1501.20Sthorpej# Important offsets into the lwp and proc structs & associated constants 1511.42Srminddefine L_PCB offsetof(struct lwp, l_addr) 1521.20Sthorpejdefine L_CPU offsetof(struct lwp, l_cpu) 1531.20Sthorpejdefine L_PRIORITY offsetof(struct lwp, l_priority) 1541.20Sthorpejdefine L_WCHAN offsetof(struct lwp, l_wchan) 1551.20Sthorpejdefine L_STAT offsetof(struct lwp, l_stat) 1561.20Sthorpejdefine L_PROC offsetof(struct lwp, l_proc) 1571.39Smattdefine L_CTXSWTCH offsetof(struct lwp, l_ctxswtch) 1581.46Smattdefine L_PRIVATE offsetof(struct lwp, l_private) 1591.70Smattdefine L_FLAG offsetof(struct lwp, l_flag) 1601.49Smattdefine L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) 1611.49Smattdefine L_MD_TF offsetof(struct lwp, l_md.md_tf) 1621.49Smattdefine MDLWP_NOALIGNFLT MDLWP_NOALIGNFLT 1631.49Smatt 1641.70Smattdefine LW_SYSTEM LW_SYSTEM 1651.70Smatt 1661.27Sdsldefine P_RASLIST offsetof(struct proc, p_raslist) 1671.1Schris 1681.19Sbjh21define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8) 1691.19Sbjh21define PCB_R9 offsetof(struct pcb, pcb_un.un_32.pcb32_r9) 1701.19Sbjh21define PCB_R10 offsetof(struct pcb, pcb_un.un_32.pcb32_r10) 1711.5Stoshiidefine PCB_R11 offsetof(struct pcb, pcb_un.un_32.pcb32_r11) 1721.5Stoshiidefine PCB_R12 offsetof(struct pcb, pcb_un.un_32.pcb32_r12) 1731.57Smattdefine PCB_KSP offsetof(struct pcb, pcb_un.un_32.pcb32_sp) 1741.5Stoshiidefine PCB_LR offsetof(struct pcb, pcb_un.un_32.pcb32_lr) 1751.5Stoshiidefine PCB_PC offsetof(struct pcb, pcb_un.un_32.pcb32_pc) 1761.39Smattdefine PCB_USER_PID_RW offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_rw) 1771.1Schrisdefine PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 1781.60Smattdefine PCB_VFP_FPEXC offsetof(struct pcb, pcb_vfp.vfp_fpexc) 1791.1Schris 1801.44Srminddefine PCB_SIZE sizeof(struct pcb) 1811.1Schris 1821.1Schrisdefine VM_MAP offsetof(struct vmspace, vm_map) 1831.1Schrisdefine VM_PMAP offsetof(struct vmspace, vm_map.pmap) 1841.1Schris 1851.1Schrisdefine PR_BASE offsetof(struct uprof, pr_base) 1861.1Schrisdefine PR_SIZE offsetof(struct uprof, pr_size) 1871.1Schrisdefine PR_OFF offsetof(struct uprof, pr_off) 1881.1Schrisdefine PR_SCALE offsetof(struct uprof, pr_scale) 1891.1Schris 1901.1Schrisdefine SIGTRAP SIGTRAP 1911.1Schrisdefine SIGEMT SIGEMT 1921.1Schris 1931.64Smattdefine TF_SPSR offsetof(struct trapframe, tf_spsr) 1941.50Smattdefine TF_FILL offsetof(struct trapframe, tf_fill) 1951.1Schrisdefine TF_R0 offsetof(struct trapframe, tf_r0) 1961.55Smattdefine TF_R4 offsetof(struct trapframe, tf_r4) 1971.55Smattdefine TF_R6 offsetof(struct trapframe, tf_r6) 1981.64Smattdefine TF_R8 offsetof(struct trapframe, tf_r8) 1991.1Schrisdefine TF_R10 offsetof(struct trapframe, tf_r10) 2001.64Smattdefine TF_R12 offsetof(struct trapframe, tf_r12) 2011.56Smattdefine TF_USR_SP offsetof(struct trapframe, tf_usr_sp) 2021.64Smattdefine TF_USR_LR offsetof(struct trapframe, tf_usr_lr) 2031.56Smattdefine TF_SVC_SP offsetof(struct trapframe, tf_svc_sp) 2041.64Smattdefine TF_SVC_LR offsetof(struct trapframe, tf_svc_lr) 2051.1Schrisdefine TF_PC offsetof(struct trapframe, tf_pc) 2061.1Schris 2071.1Schrisdefine PROCSIZE sizeof(struct proc) 2081.1Schrisdefine TRAPFRAMESIZE sizeof(struct trapframe) 2091.1Schris 2101.9Sthorpejdefine CF_IDCACHE_WBINV_ALL offsetof(struct cpu_functions, cf_idcache_wbinv_all) 2111.22Sscwdefine CF_DCACHE_WB_RANGE offsetof(struct cpu_functions, cf_dcache_wb_range) 2121.22Sscwdefine CF_TLB_FLUSHID_SE offsetof(struct cpu_functions, cf_tlb_flushID_SE) 2131.1Schrisdefine CF_CONTEXT_SWITCH offsetof(struct cpu_functions, cf_context_switch) 2141.1Schrisdefine CF_SLEEP offsetof(struct cpu_functions, cf_sleep) 2151.26Sscwdefine CF_CONTROL offsetof(struct cpu_functions, cf_control) 2161.1Schris 2171.1Schrisdefine CI_CURPRIORITY offsetof(struct cpu_info, ci_schedstate.spc_curpriority) 2181.50Smattdefine CI_ARM_CPUID offsetof(struct cpu_info, ci_arm_cpuid) 2191.20Sthorpejdefine CI_CURLWP offsetof(struct cpu_info, ci_curlwp) 2201.39Smattdefine CI_CPL offsetof(struct cpu_info, ci_cpl) 2211.39Smattdefine CI_ASTPENDING offsetof(struct cpu_info, ci_astpending) 2221.39Smattdefine CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched) 2231.39Smattdefine CI_INTR_DEPTH offsetof(struct cpu_info, ci_intr_depth) 2241.39Smattdefine CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count) 2251.51Smattdefine CI_UNDEFSAVE offsetof(struct cpu_info, ci_undefsave[0]) 2261.29Smanuif defined(EXEC_AOUT) 2271.26Sscwdefine CI_CTRL offsetof(struct cpu_info, ci_ctrl) 2281.16Sbjh21endif 2291.40Smattifdef __HAVE_FAST_SOFTINTS 2301.40Smattdefine CI_SOFTINTS offsetof(struct cpu_info, ci_softints) 2311.40Smattendif 2321.51Smattdefine CI_IDLELWP offsetof(struct cpu_info, ci_data.cpu_idlelwp) 2331.43Smattdefine CI_CC_NTRAP offsetof(struct cpu_info, ci_data.cpu_ntrap) 2341.43Smattdefine CI_CC_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) 2351.43Smattdefine CI_CC_NSOFT offsetof(struct cpu_info, ci_data.cpu_nsoft) 2361.60Smattifdef FPU_VFP 2371.60Smattdefine CI_VFP_ID offsetof(struct cpu_info, ci_vfp_id) 2381.60Smattendif 2391.67Smattdefine CI_LASTLWP offsetof(struct cpu_info, ci_lastlwp) 2401.43Smatt 2411.58Smattdefine VFP_FPEXC_EN VFP_FPEXC_EN 2421.25Sscw 2431.68Smattdefine NSACR_VFPCP NSACR_CPn(VFP_COPROC)|NSACR_CPn(VFP_COPROC2) 2441.68Smatt 2451.25Sscw# Constants required for in_cksum() and friends. 2461.25Sscwdefine M_LEN offsetof(struct mbuf, m_len) 2471.25Sscwdefine M_DATA offsetof(struct mbuf, m_data) 2481.25Sscwdefine M_NEXT offsetof(struct mbuf, m_next) 2491.25Sscwdefine IP_SRC offsetof(struct ip, ip_src) 2501.25Sscwdefine IP_DST offsetof(struct ip, ip_dst) 251