# $NetBSD: genassym.cf,v 1.16 2024/04/06 10:08:54 skrll 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 quote #define __RVSBI_LEGACY include include include include include include include include include include include include include include define SR_SUM SR_SUM define SR_SPP SR_SPP define SR_SIE SR_SIE define SR_FS SR_FS # define SR_PS SR_PS # define SR_S SR_S define SR_SUM SR_SUM define SIE_SEIE SIE_SEIE define SIE_STIE SIE_STIE define SIE_SSIE SIE_SSIE define SIP_SEIP SIP_SEIP define SIP_STIP SIP_STIP define SIP_SSIP SIP_SSIP define CAUSE_SYSCALL CAUSE_SYSCALL ifdef _LP64 define SATP_MODE_MASK SATP_MODE define SATP_MODE_SV39 __SHIFTIN(SATP_MODE_SV39, SATP_MODE) define SATP_MODE_SV48 __SHIFTIN(SATP_MODE_SV48, SATP_MODE) else define SATP_MODE_SV32 __SHIFTIN(SATP_MODE_SV32, SATP_MODE) endif 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 MAXCPUS MAXCPUS define TF_LEN sizeof(struct trapframe) 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_TVAL offsetof(struct trapframe, tf_tval) define TF_SR offsetof(struct trapframe, tf_sr) define L_CPU offsetof(struct lwp, l_cpu) 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 FB_LEN sizeof(struct faultbuf) 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 EFAULT EFAULT define PAGE_SIZE PAGE_SIZE define PAGE_MASK PAGE_MASK define PAGE_SHIFT PAGE_SHIFT define UPAGES UPAGES 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_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS define VM_MAX_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS define VM_KERNEL_BASE VM_KERNEL_BASE define VM_KERNEL_SIZE VM_KERNEL_SIZE define VM_KERNEL_DTB_BASE VM_KERNEL_DTB_BASE define VM_KERNEL_DTB_SIZE VM_KERNEL_DTB_SIZE define VM_KERNEL_IO_BASE VM_KERNEL_IO_BASE define VM_KERNEL_IO_BASE VM_KERNEL_IO_BASE define USPACE USPACE ifdef XSEGSHIFT define XSEGSHIFT XSEGSHIFT endif define SEGSHIFT SEGSHIFT define PGSHIFT PGSHIFT define NPDEPG NPDEPG define NBSEG NBSEG # Constants from pte.h 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 PTE_KERN PTE_KERN define PTE_HARDWIRED PTE_HARDWIRED #define PTE_PPN0_S PTE_PPN0_S #define PTE_PPN1_S PTE_PPN1_S #define PTE_PPN2_S PTE_PPN2_S #define PTE_PPN3_S PTE_PPN3_S #define PTE_SIZE PTE_SIZE define PTE_PPN_SHIFT PTE_PPN_SHIFT define PM_PDETAB offsetof(struct pmap, pm_pdetab) define PM_MD_PPN offsetof(struct pmap, pm_md.md_ppn) define SBI_LEGACY_CONSOLE_PUTCHAR SBI_LEGACY_CONSOLE_PUTCHAR # for bus_space_asm define BS_STRIDE offsetof(struct bus_space, bs_stride)