[BACK]Return to genassym.cf CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / aarch64 / aarch64

File: [cvs.NetBSD.org] / src / sys / arch / aarch64 / aarch64 / genassym.cf (download)

Revision 1.2, Sun Apr 1 04:35:03 2018 UTC (6 years ago) by ryo
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407
Branch point for: phil-wifi
Changes since 1.1: +143 -10 lines

Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)

- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)

# $NetBSD: genassym.cf,v 1.2 2018/04/01 04:35:03 ryo Exp $
#-
# Copyright (c) 2014 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Matt Thomas of 3am Software Foundry.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#-

include <sys/param.h>
include <sys/systm.h>
include <sys/bitops.h>
include <sys/cpu.h>
include <sys/mbuf.h>
include <sys/proc.h>
include <sys/resourcevar.h>
include <sys/device.h>
include <sys/signal.h>
include <netinet/in.h>
include <netinet/in_systm.h>
include <netinet/ip.h>
include <netinet/ip6.h>
include <netinet/ip_var.h>

include <uvm/uvm_extern.h>

include <arm/bus_defs.h>

include <aarch64/vmparam.h>
include <aarch64/frame.h>
include <aarch64/armreg.h>

if defined(_KERNEL_OPT)
include "opt_multiprocessor.h"
include "opt_compat_netbsd.h"
include "opt_execfmt.h"
endif

define	__HAVE_FAST_SOFTINTS	1

#ifdef __HAVE_PIC_FAST_SOFTINTS
#define	__HAVE_PIC_FAST_SOFTINTS	1
#endif

define	MAXCPUS			MAXCPUS
define	VM_MIN_KERNEL_ADDRESS	VM_MIN_KERNEL_ADDRESS
define	VM_MAX_KERNEL_ADDRESS	VM_MAX_KERNEL_ADDRESS
define	VM_KERNEL_IO_ADDRESS	VM_KERNEL_IO_ADDRESS
define	AARCH64_KSEG_START	AARCH64_KSEG_START
define	UPAGES			UPAGES
define	USPACE			(UPAGES * PAGE_SIZE)

#define	PV_PA			offsetof(pv_addr_t, pv_pa)
#define	PMAP_DOMAIN_KERNEL	PMAP_DOMAIN_KERNEL
#define	DOMAIN_CLIENT		DOMAIN_CLIENT
#define	L1_S_PROTO_generic	L1_S_PROTO_generic
#define	L1_S_PROTO_armv7	L1_S_PROTO_armv7
#define	L1_S_PROTO_xscale	L1_S_PROTO_xscale
#if ARM_NMMUS == 1
#define	L1_S_PROTO		L1_S_PROTO
#endif
#define	L1_S_FRAME		L1_S_FRAME
#define	L1_S_SHIFT		L1_S_SHIFT
#define	L1_S_SIZE		L1_S_SIZE
#define	L1_S_B			L1_S_B
#define	L1_S_C			L1_S_C
#define	L1_S_V6_S		L1_S_V6_S
#define	L1_S_AP_KR		L1_S_AP(AP_KR)
#define	L1_S_AP_KRW		L1_S_AP(AP_KRW)
#define	L1_S_APv7_KRW		L1_S_AP(AP7_KRW)
#define	L1_TABLE_SIZE		L1_TABLE_SIZE
#define	L1_TYPE_S		L1_TYPE_S
#define	L1_S_DOM_KERNEL		L1_S_DOM(PMAP_DOMAIN_KERNEL)
#define	L2_S_SIZE		L2_S_SIZE

#define	L1_C_PROTO_generic	L1_C_PROTO_generic

#define	L2_S_PROTO_generic	L2_S_PROTO_generic
#define	L2_S_SHIFT		L2_S_SHIFT
#define	L2_S_SIZE		L2_S_SIZE
#define	L2_C			L2_C
#define	L2_AP_KRW		L2_AP(AP_KRW)

define	EFAULT			EFAULT

define	PAGE_SIZE		PAGE_SIZE
define	PAGE_MASK		PAGE_MASK
define	PGSHIFT			PGSHIFT

# Important offsets into the lwp and proc structs & associated constants
define	L_PCB			offsetof(struct lwp, l_addr)
define	L_CPU			offsetof(struct lwp, l_cpu)
define	L_PRIORITY		offsetof(struct lwp, l_priority)
define	L_WCHAN			offsetof(struct lwp, l_wchan)
define	L_STAT			offsetof(struct lwp, l_stat)
define	L_PROC			offsetof(struct lwp, l_proc)
define	L_CTXSWTCH		offsetof(struct lwp, l_ctxswtch)
define	L_PRIVATE		offsetof(struct lwp, l_private)
define	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
define	L_MD_UTF		offsetof(struct lwp, l_md.md_utf)
define	L_MD_KTF		offsetof(struct lwp, l_md.md_ktf)
define	L_MD_CPACR		offsetof(struct lwp, l_md.md_cpacr)
define	L_MD_ONFAULT		offsetof(struct lwp, l_md.md_onfault)

define	FB_X19			FB_X19
define	FB_X20			FB_X20
define	FB_X21			FB_X21
define	FB_X22			FB_X22
define	FB_X23			FB_X23
define	FB_X24			FB_X24
define	FB_X25			FB_X25
define	FB_X26			FB_X26
define	FB_X27			FB_X27
define	FB_X28			FB_X28
define	FB_X29			FB_X29
define	FB_LR			FB_LR
define	FB_SP			FB_SP
define	FB_MAX			FB_MAX
define	FB_T_SIZE		roundup(sizeof(struct faultbuf), 16)

define	LBL_X19			LBL_X19
define	LBL_X20			LBL_X20
define	LBL_X21			LBL_X21
define	LBL_X22			LBL_X22
define	LBL_X23			LBL_X23
define	LBL_X24			LBL_X24
define	LBL_X25			LBL_X25
define	LBL_X26			LBL_X26
define	LBL_X27			LBL_X27
define	LBL_X28			LBL_X28
define	LBL_X29			LBL_X29
define	LBL_LR			LBL_LR
define	LBL_SP			LBL_SP
define	LBL_MAX			LBL_MAX

define	P_RASLIST		offsetof(struct proc, p_raslist)
define	P_MD_SYSCALL		offsetof(struct proc, p_md.md_syscall)

define	VM_MAP			offsetof(struct vmspace, vm_map)
define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)

#define	PR_BASE			offsetof(struct uprof, pr_base)
#define	PR_SIZE			offsetof(struct uprof, pr_size)
#define	PR_OFF			offsetof(struct uprof, pr_off)
#define	PR_SCALE		offsetof(struct uprof, pr_scale)

define	SIGTRAP			SIGTRAP
define	SIGEMT			SIGEMT

define	TF_X0			offsetof(struct trapframe, tf_reg[0])
define	TF_X1			offsetof(struct trapframe, tf_reg[1])
define	TF_X2			offsetof(struct trapframe, tf_reg[2])
define	TF_X3			offsetof(struct trapframe, tf_reg[3])
define	TF_X4			offsetof(struct trapframe, tf_reg[4])
define	TF_X5			offsetof(struct trapframe, tf_reg[5])
define	TF_X6			offsetof(struct trapframe, tf_reg[6])
define	TF_X7			offsetof(struct trapframe, tf_reg[7])
define	TF_X8			offsetof(struct trapframe, tf_reg[8])
define	TF_X9			offsetof(struct trapframe, tf_reg[9])
define	TF_X10			offsetof(struct trapframe, tf_reg[10])
define	TF_X11			offsetof(struct trapframe, tf_reg[11])
define	TF_X12			offsetof(struct trapframe, tf_reg[12])
define	TF_X13			offsetof(struct trapframe, tf_reg[13])
define	TF_X14			offsetof(struct trapframe, tf_reg[14])
define	TF_X15			offsetof(struct trapframe, tf_reg[15])
define	TF_X16			offsetof(struct trapframe, tf_reg[16])
define	TF_X17			offsetof(struct trapframe, tf_reg[17])
define	TF_X18			offsetof(struct trapframe, tf_reg[18])
define	TF_X19			offsetof(struct trapframe, tf_reg[19])
define	TF_X20			offsetof(struct trapframe, tf_reg[20])
define	TF_X21			offsetof(struct trapframe, tf_reg[21])
define	TF_X22			offsetof(struct trapframe, tf_reg[22])
define	TF_X23			offsetof(struct trapframe, tf_reg[23])
define	TF_X24			offsetof(struct trapframe, tf_reg[24])
define	TF_X25			offsetof(struct trapframe, tf_reg[25])
define	TF_X26			offsetof(struct trapframe, tf_reg[26])
define	TF_X27			offsetof(struct trapframe, tf_reg[27])
define	TF_X28			offsetof(struct trapframe, tf_reg[28])
define	TF_X29			offsetof(struct trapframe, tf_reg[29])
define	TF_X30			offsetof(struct trapframe, tf_reg[30])
define	TF_SP			offsetof(struct trapframe, tf_sp)
define	TF_PC			offsetof(struct trapframe, tf_pc)
define	TF_SPSR			offsetof(struct trapframe, tf_spsr)
define	TF_ESR			offsetof(struct trapframe, tf_esr)
define	TF_FAR			offsetof(struct trapframe, tf_far)
define	TF_SIZE			TF_SIZE

define	FPREG_Q0		offsetof(struct fpreg, fp_reg[0])
define	FPREG_Q1		offsetof(struct fpreg, fp_reg[1])
define	FPREG_Q2		offsetof(struct fpreg, fp_reg[2])
define	FPREG_Q3		offsetof(struct fpreg, fp_reg[3])
define	FPREG_Q4		offsetof(struct fpreg, fp_reg[4])
define	FPREG_Q5		offsetof(struct fpreg, fp_reg[5])
define	FPREG_Q6		offsetof(struct fpreg, fp_reg[6])
define	FPREG_Q7		offsetof(struct fpreg, fp_reg[7])
define	FPREG_Q8		offsetof(struct fpreg, fp_reg[8])
define	FPREG_Q9		offsetof(struct fpreg, fp_reg[9])
define	FPREG_Q10		offsetof(struct fpreg, fp_reg[10])
define	FPREG_Q11		offsetof(struct fpreg, fp_reg[11])
define	FPREG_Q12		offsetof(struct fpreg, fp_reg[12])
define	FPREG_Q13		offsetof(struct fpreg, fp_reg[13])
define	FPREG_Q14		offsetof(struct fpreg, fp_reg[14])
define	FPREG_Q15		offsetof(struct fpreg, fp_reg[15])
define	FPREG_Q16		offsetof(struct fpreg, fp_reg[16])
define	FPREG_Q17		offsetof(struct fpreg, fp_reg[17])
define	FPREG_Q18		offsetof(struct fpreg, fp_reg[18])
define	FPREG_Q19		offsetof(struct fpreg, fp_reg[19])
define	FPREG_Q20		offsetof(struct fpreg, fp_reg[20])
define	FPREG_Q21		offsetof(struct fpreg, fp_reg[21])
define	FPREG_Q22		offsetof(struct fpreg, fp_reg[22])
define	FPREG_Q23		offsetof(struct fpreg, fp_reg[23])
define	FPREG_Q24		offsetof(struct fpreg, fp_reg[24])
define	FPREG_Q25		offsetof(struct fpreg, fp_reg[25])
define	FPREG_Q26		offsetof(struct fpreg, fp_reg[26])
define	FPREG_Q27		offsetof(struct fpreg, fp_reg[27])
define	FPREG_Q28		offsetof(struct fpreg, fp_reg[28])
define	FPREG_Q29		offsetof(struct fpreg, fp_reg[29])
define	FPREG_Q30		offsetof(struct fpreg, fp_reg[30])
define	FPREG_Q31		offsetof(struct fpreg, fp_reg[31])
define	FPREG_FPCR		offsetof(struct fpreg, fpcr)
define	FPREG_FPSR		offsetof(struct fpreg, fpsr)

define	CI_CURPRIORITY		offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
define	CI_CURLWP		offsetof(struct cpu_info, ci_curlwp)
define	CI_CPL			offsetof(struct cpu_info, ci_cpl)
define	CI_CPUID		offsetof(struct cpu_info, ci_cpuid)
define	CI_ASTPENDING		offsetof(struct cpu_info, ci_astpending)
define	CI_WANT_RESCHED		offsetof(struct cpu_info, ci_want_resched)
define	CI_INTR_DEPTH		offsetof(struct cpu_info, ci_intr_depth)
define	CI_MTX_COUNT		offsetof(struct cpu_info, ci_mtx_count)
define	CI_SOFTINTS		offsetof(struct cpu_info, ci_softints)
define	CI_IDLELWP		offsetof(struct cpu_info, ci_data.cpu_idlelwp)
define	CI_CC_NTRAP		offsetof(struct cpu_info, ci_data.cpu_ntrap)
define	CI_CC_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
define	CI_CC_NSOFT		offsetof(struct cpu_info, ci_data.cpu_nsoft)

define	V_RESCHED_KPREEMPT	ilog2(RESCHED_KPREEMPT)

define	SPSR_M_EL1T		SPSR_M_EL1T
define	DAIF_I			DAIF_I
define	DAIF_F			DAIF_F
define	DAIF_SETCLR_SHIFT	DAIF_SETCLR_SHIFT

define	CNTHCTL_EL1PCTEN	CNTHCTL_EL1PCTEN
define	CNTHCTL_EL1PCEN		CNTHCTL_EL1PCEN
define	SPSR_F			SPSR_F
define	SPSR_I			SPSR_I
define	SPSR_A			SPSR_A
define	SPSR_A64_D		SPSR_A64_D
define	SPSR_M_EL1H		SPSR_M_EL1H

define	CPACR_FPEN		CPACR_FPEN
define	CPACR_TTA		CPACR_TTA
define	CPACR_FPEN		CPACR_FPEN
define	CPACR_FPEN_NONE		CPACR_FPEN_NONE
define	CPACR_FPEN_EL1		CPACR_FPEN_EL1
define	CPACR_FPEN_NONE_2	CPACR_FPEN_NONE_2
define	CPACR_FPEN_ALL		CPACR_FPEN_ALL

define	ID_AA64PFR0_EL1_GIC		ID_AA64PFR0_EL1_GIC
define	ID_AA64PFR0_EL1_GIC_SHIFT	ID_AA64PFR0_EL1_GIC_SHIFT
define	ID_AA64PFR0_EL1_GIC_CPUIF_EN	ID_AA64PFR0_EL1_GIC_CPUIF_EN

define	MAIR_ATTR0		MAIR_ATTR0
define	MAIR_ATTR1		MAIR_ATTR1
define	MAIR_ATTR2		MAIR_ATTR2
define	MAIR_ATTR3		MAIR_ATTR3
define	MAIR_DEVICE_nGnRnE	MAIR_DEVICE_nGnRnE
define	MAIR_NORMAL_NC		MAIR_NORMAL_NC
define	MAIR_NORMAL_WT		MAIR_NORMAL_WT
define	MAIR_NORMAL_WB		MAIR_NORMAL_WB

define	SCTLR_RES1		SCTLR_RES1
define	SCTLR_M			SCTLR_M
define	SCTLR_A			SCTLR_A
define	SCTLR_C			SCTLR_C
define	SCTLR_SA		SCTLR_SA
define	SCTLR_SA0		SCTLR_SA0
define	SCTLR_CP15BEN		SCTLR_CP15BEN
define	SCTLR_THEE		SCTLR_THEE
define	SCTLR_ITD		SCTLR_ITD
define	SCTLR_SED		SCTLR_SED
define	SCTLR_UMA		SCTLR_UMA
define	SCTLR_I			SCTLR_I
define	SCTLR_DZE		SCTLR_DZE
define	SCTLR_UCT		SCTLR_UCT
define	SCTLR_nTWI		SCTLR_nTWI
define	SCTLR_nTWE		SCTLR_nTWE
define	SCTLR_WXN		SCTLR_WXN
define	SCTLR_IESB		SCTLR_IESB
define	SCTLR_SPAN		SCTLR_SPAN
define	SCTLR_EOE		SCTLR_EOE
define	SCTLR_EE		SCTLR_EE
define	SCTLR_UCI		SCTLR_UCI
define	SCTLR_nTLSMD		SCTLR_nTLSMD
define	SCTLR_LSMAOE		SCTLR_LSMAOE

define	ICC_SRE_EL2_EN		ICC_SRE_EL2_EN
define	ICC_SRE_EL2_SRE		ICC_SRE_EL2_SRE


# for bus_space_asm
define	BS_STRIDE		offsetof(struct bus_space, bs_stride)

# Constants required for in_cksum() and friends.
define	M_LEN			offsetof(struct mbuf, m_len)
define	M_DATA			offsetof(struct mbuf, m_data)
define	M_NEXT			offsetof(struct mbuf, m_next)
define	IP_SRC			offsetof(struct ip, ip_src)
define	IP_DST			offsetof(struct ip, ip_dst)