# $NetBSD: genassym.cf,v 1.5 2019/06/16 07:42:52 maxv 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. #+ quote #define __MUTEX_PRIVATE quote #define __RWLOCK_PRIVATE quote #define __INTR_PRIVATE quote #define __PMAP_PRIVATE include include include include include include include include include include include define SR_IM SR_IM define SR_IM_LSHIFT __SIZEOF_LONG__ * 8 - (ilog2(SR_IM) + 1) define SR_IM_RSHIFT ilog2(__LOWEST_SET_BIT(SR_IM)) define SR_VM SR_VM define SR_U64 SR_U64 define SR_S64 SR_S64 define SR_EF SR_EF define SR_PEI SR_PEI define SR_EI SR_EI define SR_PS SR_PS define SR_S SR_S define CAUSE_SYSCALL CAUSE_SYSCALL define IPL_HIGH IPL_HIGH define IPL_DDB IPL_DDB define IPL_SCHED IPL_SCHED define IPL_VM IPL_VM define IPL_SOFTSERIAL IPL_SOFTSERIAL define IPL_SOFTNET IPL_SOFTNET define IPL_SOFTBIO IPL_SOFTBIO define IPL_SOFTCLOCK IPL_SOFTCLOCK define IPL_NONE IPL_NONE #define CPU_MAXNUM CPU_MAXNUM define TF_LEN roundup(sizeof(struct trapframe), STACK_ALIGNBYTES+1) define TF_RA offsetof(struct trapframe, tf_reg[_X_RA]) define TF_S0 offsetof(struct trapframe, tf_reg[_X_S0]) define TF_S1 offsetof(struct trapframe, tf_reg[_X_S1]) define TF_S2 offsetof(struct trapframe, tf_reg[_X_S2]) define TF_S3 offsetof(struct trapframe, tf_reg[_X_S3]) define TF_S4 offsetof(struct trapframe, tf_reg[_X_S4]) define TF_S5 offsetof(struct trapframe, tf_reg[_X_S5]) define TF_S6 offsetof(struct trapframe, tf_reg[_X_S6]) define TF_S7 offsetof(struct trapframe, tf_reg[_X_S7]) define TF_S8 offsetof(struct trapframe, tf_reg[_X_S8]) define TF_S9 offsetof(struct trapframe, tf_reg[_X_S9]) define TF_S10 offsetof(struct trapframe, tf_reg[_X_S10]) define TF_S11 offsetof(struct trapframe, tf_reg[_X_S11]) define TF_SP offsetof(struct trapframe, tf_reg[_X_SP]) define TF_TP offsetof(struct trapframe, tf_reg[_X_TP]) define TF_A0 offsetof(struct trapframe, tf_reg[_X_A0]) define TF_A1 offsetof(struct trapframe, tf_reg[_X_A1]) define TF_A2 offsetof(struct trapframe, tf_reg[_X_A2]) define TF_A3 offsetof(struct trapframe, tf_reg[_X_A3]) define TF_A4 offsetof(struct trapframe, tf_reg[_X_A4]) define TF_A5 offsetof(struct trapframe, tf_reg[_X_A5]) define TF_A6 offsetof(struct trapframe, tf_reg[_X_A6]) define TF_A7 offsetof(struct trapframe, tf_reg[_X_A7]) define TF_T0 offsetof(struct trapframe, tf_reg[_X_T0]) define TF_T1 offsetof(struct trapframe, tf_reg[_X_T1]) define TF_T2 offsetof(struct trapframe, tf_reg[_X_T2]) define TF_T3 offsetof(struct trapframe, tf_reg[_X_T3]) define TF_T4 offsetof(struct trapframe, tf_reg[_X_T4]) define TF_T5 offsetof(struct trapframe, tf_reg[_X_T5]) define TF_T6 offsetof(struct trapframe, tf_reg[_X_T6]) define TF_GP offsetof(struct trapframe, tf_reg[_X_GP]) define TF_PC offsetof(struct trapframe, tf_pc) define TF_CAUSE offsetof(struct trapframe, tf_cause) define TF_BADADDR offsetof(struct trapframe, tf_badaddr) define TF_SR offsetof(struct trapframe, tf_sr) define L_CPU offsetof(struct lwp, l_cpu) define L_CTXSWTCH offsetof(struct lwp, l_ctxswtch) define L_MD_ASTPENDING offsetof(struct lwp, l_md.md_astpending) define L_MD_ONFAULT offsetof(struct lwp, l_md.md_onfault) define L_MD_USP offsetof(struct lwp, l_md.md_usp) define L_MD_UTF offsetof(struct lwp, l_md.md_utf) define L_MD_KTF offsetof(struct lwp, l_md.md_ktf) define L_PCB offsetof(struct lwp, l_addr) define L_PROC offsetof(struct lwp, l_proc) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define CI_SIZE sizeof(struct cpu_info) define CI_CPL offsetof(struct cpu_info, ci_cpl) define CI_CURLWP offsetof(struct cpu_info, ci_curlwp) define CI_INTR_DEPTH offsetof(struct cpu_info, ci_intr_depth) define CI_IDLELWP offsetof(struct cpu_info, ci_data.cpu_idlelwp) define CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count) define CI_MTX_OLDSPL offsetof(struct cpu_info, ci_mtx_oldspl) define CI_SOFTINTS offsetof(struct cpu_info, ci_softints) define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched) define FB_A0 offsetof(struct faultbuf, fb_reg[FB_A0]) define FB_RA offsetof(struct faultbuf, fb_reg[FB_RA]) define FB_S0 offsetof(struct faultbuf, fb_reg[FB_S0]) define FB_S1 offsetof(struct faultbuf, fb_reg[FB_S1]) define FB_S2 offsetof(struct faultbuf, fb_reg[FB_S2]) define FB_S3 offsetof(struct faultbuf, fb_reg[FB_S3]) define FB_S4 offsetof(struct faultbuf, fb_reg[FB_S4]) define FB_S5 offsetof(struct faultbuf, fb_reg[FB_S5]) define FB_S6 offsetof(struct faultbuf, fb_reg[FB_S6]) define FB_S7 offsetof(struct faultbuf, fb_reg[FB_S7]) define FB_S8 offsetof(struct faultbuf, fb_reg[FB_S8]) define FB_S9 offsetof(struct faultbuf, fb_reg[FB_S9]) define FB_S10 offsetof(struct faultbuf, fb_reg[FB_S10]) define FB_S11 offsetof(struct faultbuf, fb_reg[FB_S11]) define FB_SP offsetof(struct faultbuf, fb_reg[FB_SP]) define FB_SR offsetof(struct faultbuf, fb_sr) define PAGE_SIZE PAGE_SIZE define PAGE_MASK PAGE_MASK define PAGE_SHIFT PAGE_SHIFT define USRSTACK USRSTACK ifdef __HAVE_FAST_SOFTINTS define __HAVE_FAST_SOFTINTS 1 endif ifdef __HAVE_MUTEX_STUBS define __HAVE_MUTEX_STUBS 1 endif ifdef __HAVE_MUTEX_SPIN_STUBS define __HAVE_MUTEX_SPIN_STUBS 1 endif ifdef __HAVE_RW_STUBS define __HAVE_RW_STUBS 1 endif define RW_OWNER offsetof(struct krwlock, rw_owner) define RW_WRITE_LOCKED RW_WRITE_LOCKED define RW_READ_INCR RW_READ_INCR define RW_READER RW_READER define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS define VM_MAX_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS define USPACE USPACE ifdef XSEGSHIFT define XSEGSHIFT XSEGSHIFT endif define SEGSHIFT SEGSHIFT define PGSHIFT PGSHIFT define NPDEPG NPDEPG define NBSEG NBSEG define PTE_D PTE_D define PTE_A PTE_A define PTE_G PTE_G define PTE_U PTE_U define PTE_X PTE_X define PTE_W PTE_W define PTE_R PTE_R define PTE_V PTE_V define PM_MD_PDETAB offsetof(struct pmap, pm_md.md_pdetab) define PM_MD_PTBR offsetof(struct pmap, pm_md.md_ptbr)