genassym.cf revision 1.93
11.93Sskrll#	$NetBSD: genassym.cf,v 1.93 2020/07/08 10:18:00 skrll 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.82Sskrllif defined(_KERNEL_OPT)
341.93Sskrllinclude "opt_arm_start.h"
351.82Sskrllinclude "opt_execfmt.h"
361.91Sskrllinclude "opt_multiprocessor.h"
371.82Sskrllendif
381.82Sskrll
391.1Schrisinclude <sys/param.h>
401.90Sskrll
411.90Sskrllinclude <sys/device.h>
421.25Sscwinclude <sys/mbuf.h>
431.1Schrisinclude <sys/proc.h>
441.1Schrisinclude <sys/resourcevar.h>
451.1Schrisinclude <sys/signal.h>
461.90Sskrllinclude <sys/systm.h>
471.90Sskrll
481.25Sscwinclude <netinet/in.h>
491.25Sscwinclude <netinet/in_systm.h>
501.25Sscwinclude <netinet/ip.h>
511.25Sscwinclude <netinet/ip6.h>
521.25Sscwinclude <netinet/ip_var.h>
531.1Schris
541.1Schrisinclude <uvm/uvm_extern.h>
551.8Sthorpej
561.8Sthorpejinclude <arm/fiq.h>
571.90Sskrllinclude <arm/locore.h>
581.58Smattinclude <arm/vfpreg.h>
591.68Smattinclude <arm/undefined.h>
601.1Schris
611.45Smattinclude <arm/arm32/pte.h>
621.90Sskrll
631.1Schrisinclude <machine/pmap.h>
641.49Smattinclude <machine/pcb.h>
651.1Schrisinclude <machine/vmparam.h>
661.6Sthorpej
671.6Sthorpejdefine	__PROG32		1
681.10Sthorpejifdef __ARM_FIQ_INDIRECT
691.10Sthorpejdefine	__ARM_FIQ_INDIRECT	1
701.10Sthorpejendif
711.1Schris
721.92Sskrllifdef __HAVE_FAST_SOFTINTS
731.92Sskrlldefine	__HAVE_FAST_SOFTINTS	1
741.72Smattendif
751.72Smatt
761.93Sskrllifdef __HAVE_GENERIC_START
771.93Sskrlldefine	__HAVE_GENERIC_START	1
781.93Sskrllendif
791.93Sskrll
801.59Smattifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
811.59Smattdefine	__HAVE_MM_MD_DIRECT_MAPPED_PHYS	1
821.59Smattendif
831.59Smatt
841.92Sskrllifdef __HAVE_PIC_FAST_SOFTINTS
851.92Sskrlldefine	__HAVE_PIC_FAST_SOFTINTS	1
861.37Smattendif
871.37Smatt
881.92Sskrllifdef __HAVE_PREEMPTION
891.92Sskrlldefine	__HAVE_PREEMPTION	1
901.52Smattendif
911.52Smatt
921.68Smattifdef ARM_MMU_EXTENDED
931.68Smattdefine  ARM_MMU_EXTENDED	1
941.68Smattendif
951.68Smatt
961.69Smattifdef VERBOSE_INIT_ARM
971.69Smattdefine	VERBOSE_INIT_ARM	1
981.69Smattendif
991.69Smatt
1001.31Smattdefine	KERNEL_BASE		KERNEL_BASE
1011.1Schrisdefine	VM_MIN_ADDRESS		VM_MIN_ADDRESS
1021.1Schrisdefine	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS
1031.22Sscw
1041.22Sscwdefine	PMAP_DOMAIN_KERNEL	PMAP_DOMAIN_KERNEL
1051.45Smattdefine	DOMAIN_CLIENT		DOMAIN_CLIENT
1061.80Sskrlldefine	DOMAIN_DEFAULT		DOMAIN_DEFAULT
1071.68Smatt
1081.45Smattdefine	L1_S_PROTO_generic	L1_S_PROTO_generic
1091.45Smattdefine	L1_S_PROTO_armv7	L1_S_PROTO_armv7
1101.80Sskrll
1111.45Smattdefine	L1_S_PROTO_xscale	L1_S_PROTO_xscale
1121.45Smattif ARM_NMMUS == 1
1131.45Smattdefine	L1_S_PROTO		L1_S_PROTO
1141.45Smattendif
1151.45Smattdefine	L1_S_FRAME		L1_S_FRAME
1161.45Smattdefine	L1_S_SHIFT		L1_S_SHIFT
1171.45Smattdefine	L1_S_SIZE		L1_S_SIZE
1181.68Smattdefine	L1_S_CACHEABLE		L1_S_C|L1_S_B|L1_S_V6_S
1191.89Sskrlldefine	L1_S_NOCACHE		L1_S_XS_TEX(1)
1201.45Smattdefine	L1_S_B			L1_S_B
1211.45Smattdefine	L1_S_C			L1_S_C
1221.62Smattdefine	L1_S_V6_S		L1_S_V6_S
1231.68Smattdefine	L1_S_V6_XN		L1_S_V6_XN
1241.53Smattdefine	L1_S_AP_KR		L1_S_AP(AP_KR)
1251.45Smattdefine	L1_S_AP_KRW		L1_S_AP(AP_KRW)
1261.45Smattdefine	L1_S_APv7_KRW		L1_S_AP(AP7_KRW)
1271.68Smattdefine	L1_S_DOM_MASK		L1_S_DOM_MASK
1281.45Smattdefine	L1_TABLE_SIZE		L1_TABLE_SIZE
1291.45Smattdefine	L1_TYPE_S		L1_TYPE_S
1301.45Smattdefine	L1_S_DOM_KERNEL		L1_S_DOM(PMAP_DOMAIN_KERNEL)
1311.63Smattdefine	L2_S_SIZE		L2_S_SIZE
1321.23Sthorpej
1331.61Skiyoharadefine	L1_C_PROTO_generic	L1_C_PROTO_generic
1341.61Skiyohara
1351.61Skiyoharadefine	L2_S_PROTO_generic	L2_S_PROTO_generic
1361.61Skiyoharadefine	L2_S_SHIFT		L2_S_SHIFT
1371.61Skiyoharadefine	L2_S_SIZE		L2_S_SIZE
1381.61Skiyoharadefine	L2_C			L2_C
1391.61Skiyoharadefine	L2_AP_KRW		L2_AP(AP_KRW)
1401.61Skiyohara
1411.68Smattdefine	TTBCR_S_N_1		__SHIFTIN(1, TTBCR_S_N)
1421.68Smatt
1431.73Sskrlldefine	TTBR_UPATTR		TTBR_UPATTR
1441.73Sskrlldefine	TTBR_MPATTR		TTBR_MPATTR
1451.73Sskrll
1461.23Sthorpejifdef PMAP_INCLUDE_PTE_SYNC
1471.23Sthorpejdefine	PMAP_INCLUDE_PTE_SYNC	1
1481.22Sscwendif
1491.1Schris
1501.54Smattdefine	PAGE_MASK		PAGE_MASK
1511.21Sthorpejdefine	PAGE_SIZE		PAGE_SIZE
1521.1Schrisdefine	UPAGES			UPAGES
1531.1Schrisdefine	PGSHIFT			PGSHIFT
1541.1Schris
1551.78Sryodefine	MAXCPUS			MAXCPUS
1561.78Sryo
1571.80Sskrll#define	PSR_HYP32_MODE		PSR_HYP32_MODE
1581.80Sskrll#define	PSR_SVC32_MODE		PSR_SVC32_MODE
1591.80Sskrll#define	PSR_MODE		PSR_MODE
1601.80Sskrll#define	CPU_CONTROL_DC_ENABLE	CPU_CONTROL_DC_ENABLE
1611.80Sskrll#define	TTBCR_S_PD0		TTBCR_S_PD0
1621.80Sskrll
1631.20Sthorpej# Important offsets into the lwp and proc structs & associated constants
1641.42Srminddefine	L_PCB			offsetof(struct lwp, l_addr)
1651.20Sthorpejdefine	L_CPU			offsetof(struct lwp, l_cpu)
1661.20Sthorpejdefine	L_PROC			offsetof(struct lwp, l_proc)
1671.46Smattdefine	L_PRIVATE		offsetof(struct lwp, l_private)
1681.70Smattdefine	L_FLAG			offsetof(struct lwp, l_flag)
1691.49Smattdefine	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
1701.49Smattdefine	L_MD_TF			offsetof(struct lwp, l_md.md_tf)
1711.49Smattdefine	MDLWP_NOALIGNFLT	MDLWP_NOALIGNFLT
1721.49Smatt
1731.70Smattdefine	LW_SYSTEM		LW_SYSTEM
1741.70Smatt
1751.27Sdsldefine	P_RASLIST		offsetof(struct proc, p_raslist)
1761.1Schris
1771.77Sskrlldefine	PCB_R8			offsetof(struct pcb, pcb_r8)
1781.77Sskrlldefine	PCB_R9			offsetof(struct pcb, pcb_r9)
1791.77Sskrlldefine	PCB_R10			offsetof(struct pcb, pcb_r10)
1801.77Sskrlldefine	PCB_R11			offsetof(struct pcb, pcb_r11)
1811.77Sskrlldefine	PCB_R12			offsetof(struct pcb, pcb_r12)
1821.77Sskrlldefine	PCB_KSP			offsetof(struct pcb, pcb_sp)
1831.77Sskrlldefine	PCB_LR			offsetof(struct pcb, pcb_lr)
1841.77Sskrlldefine	PCB_PC			offsetof(struct pcb, pcb_pc)
1851.77Sskrlldefine	PCB_USER_PID_RW		offsetof(struct pcb, pcb_user_pid_rw)
1861.1Schrisdefine	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
1871.60Smattdefine	PCB_VFP_FPEXC		offsetof(struct pcb, pcb_vfp.vfp_fpexc)
1881.1Schris
1891.44Srminddefine	PCB_SIZE		sizeof(struct pcb)
1901.1Schris
1911.1Schrisdefine	VM_MAP			offsetof(struct vmspace, vm_map)
1921.1Schrisdefine	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)
1931.1Schris
1941.1Schrisdefine	PR_BASE			offsetof(struct uprof, pr_base)
1951.1Schrisdefine	PR_SIZE			offsetof(struct uprof, pr_size)
1961.1Schrisdefine	PR_OFF			offsetof(struct uprof, pr_off)
1971.1Schrisdefine	PR_SCALE		offsetof(struct uprof, pr_scale)
1981.1Schris
1991.1Schrisdefine	SIGTRAP			SIGTRAP
2001.1Schrisdefine	SIGEMT			SIGEMT
2011.1Schris
2021.64Smattdefine	TF_SPSR			offsetof(struct trapframe, tf_spsr)
2031.50Smattdefine	TF_FILL			offsetof(struct trapframe, tf_fill)
2041.1Schrisdefine	TF_R0			offsetof(struct trapframe, tf_r0)
2051.55Smattdefine	TF_R4			offsetof(struct trapframe, tf_r4)
2061.55Smattdefine	TF_R6			offsetof(struct trapframe, tf_r6)
2071.64Smattdefine	TF_R8			offsetof(struct trapframe, tf_r8)
2081.1Schrisdefine	TF_R10			offsetof(struct trapframe, tf_r10)
2091.64Smattdefine	TF_R12			offsetof(struct trapframe, tf_r12)
2101.56Smattdefine	TF_USR_SP		offsetof(struct trapframe, tf_usr_sp)
2111.64Smattdefine	TF_USR_LR		offsetof(struct trapframe, tf_usr_lr)
2121.56Smattdefine	TF_SVC_SP		offsetof(struct trapframe, tf_svc_sp)
2131.64Smattdefine	TF_SVC_LR		offsetof(struct trapframe, tf_svc_lr)
2141.1Schrisdefine	TF_PC			offsetof(struct trapframe, tf_pc)
2151.1Schris
2161.1Schrisdefine	PROCSIZE		sizeof(struct proc)
2171.1Schrisdefine	TRAPFRAMESIZE		sizeof(struct trapframe)
2181.1Schris
2191.9Sthorpejdefine	CF_IDCACHE_WBINV_ALL	offsetof(struct cpu_functions, cf_idcache_wbinv_all)
2201.22Sscwdefine	CF_DCACHE_WB_RANGE	offsetof(struct cpu_functions, cf_dcache_wb_range)
2211.22Sscwdefine	CF_TLB_FLUSHID_SE	offsetof(struct cpu_functions, cf_tlb_flushID_SE)
2221.1Schrisdefine	CF_CONTEXT_SWITCH	offsetof(struct cpu_functions, cf_context_switch)
2231.1Schrisdefine	CF_SLEEP		offsetof(struct cpu_functions, cf_sleep)
2241.26Sscwdefine	CF_CONTROL		offsetof(struct cpu_functions, cf_control)
2251.1Schris
2261.87Sskrlldefine	CPU_INFO_SIZE		sizeof(struct cpu_info)
2271.50Smattdefine	CI_ARM_CPUID		offsetof(struct cpu_info, ci_arm_cpuid)
2281.86Sskrlldefine	CI_ASTPENDING		offsetof(struct cpu_info, ci_astpending)
2291.86Sskrlldefine	CI_CPL			offsetof(struct cpu_info, ci_cpl)
2301.20Sthorpejdefine	CI_CURLWP		offsetof(struct cpu_info, ci_curlwp)
2311.39Smattdefine	CI_INTR_DEPTH		offsetof(struct cpu_info, ci_intr_depth)
2321.87Sskrlldefine	CI_MIDR			offsetof(struct cpu_info, ci_midr)
2331.87Sskrlldefine	CI_MPIDR		offsetof(struct cpu_info, ci_mpidr)
2341.39Smattdefine	CI_MTX_COUNT		offsetof(struct cpu_info, ci_mtx_count)
2351.86Sskrlldefine	CI_LASTLWP		offsetof(struct cpu_info, ci_lastlwp)
2361.51Smattdefine	CI_UNDEFSAVE		offsetof(struct cpu_info, ci_undefsave[0])
2371.86Sskrlldefine	CI_IDLELWP		offsetof(struct cpu_info, ci_data.cpu_idlelwp)
2381.86Sskrlldefine	CI_CC_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
2391.29Smanuif defined(EXEC_AOUT)
2401.26Sscwdefine	CI_CTRL			offsetof(struct cpu_info, ci_ctrl)
2411.16Sbjh21endif
2421.40Smattifdef __HAVE_FAST_SOFTINTS
2431.40Smattdefine	CI_SOFTINTS		offsetof(struct cpu_info, ci_softints)
2441.40Smattendif
2451.60Smattifdef FPU_VFP
2461.60Smattdefine	CI_VFP_ID		offsetof(struct cpu_info, ci_vfp_id)
2471.60Smattendif
2481.43Smatt
2491.58Smattdefine	VFP_FPEXC_EN		VFP_FPEXC_EN
2501.25Sscw
2511.68Smattdefine	NSACR_VFPCP		NSACR_CPn(VFP_COPROC)|NSACR_CPn(VFP_COPROC2)
2521.68Smatt
2531.25Sscw# Constants required for in_cksum() and friends.
2541.76Sskrlldefine	M_LEN			offsetof(struct mbuf, m_len)
2551.76Sskrlldefine	M_DATA			offsetof(struct mbuf, m_data)
2561.76Sskrlldefine	M_NEXT			offsetof(struct mbuf, m_next)
2571.76Sskrlldefine	IP_SRC			offsetof(struct ip, ip_src)
2581.76Sskrlldefine	IP_DST			offsetof(struct ip, ip_dst)
2591.75Sskrll
2601.75Sskrll# Cache information
2611.79Sskrlldefine	DCACHE_LINE_SIZE	offsetof(struct arm_cache_info, dcache_line_size)
2621.75Sskrlldefine	DCACHE_SIZE		offsetof(struct arm_cache_info, dcache_size)
263