1# $NetBSD: genassym.cf,v 1.41 2008/09/20 18:29:05 tsutsui Exp $ 2 3# Copyright (c) 1982, 1990 The Regents of the University of California. 4# All rights reserved. 5# 6# This code is derived from software contributed to Berkeley by 7# William Jolitz. 8# 9# Redistribution and use in source and binary forms, with or without 10# modification, are permitted provided that the following conditions 11# are met: 12# 1. Redistributions of source code must retain the above copyright 13# notice, this list of conditions and the following disclaimer. 14# 2. Redistributions in binary form must reproduce the above copyright 15# notice, this list of conditions and the following disclaimer in the 16# documentation and/or other materials provided with the distribution. 17# 3. Neither the name of the University nor the names of its contributors 18# may be used to endorse or promote products derived from this software 19# without specific prior written permission. 20# 21# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31# SUCH DAMAGE. 32 33include <sys/param.h> 34include <sys/systm.h> 35include <sys/mbuf.h> 36include <sys/proc.h> 37include <sys/resourcevar.h> 38include <sys/device.h> 39include <sys/user.h> 40include <sys/signal.h> 41include <netinet/in.h> 42include <netinet/in_systm.h> 43include <netinet/ip.h> 44include <netinet/ip6.h> 45include <netinet/ip_var.h> 46 47include <uvm/uvm_extern.h> 48 49include <arm/fiq.h> 50 51include <machine/pmap.h> 52include <machine/frame.h> 53include <machine/vmparam.h> 54 55include "opt_multiprocessor.h" 56include "opt_compat_netbsd.h" 57include "opt_execfmt.h" 58 59define __PROG32 1 60ifdef __ARM_FIQ_INDIRECT 61define __ARM_FIQ_INDIRECT 1 62endif 63 64ifdef __HAVE_FAST_SOFTINTS 65define __HAVE_FAST_SOFTINTS 1 66endif 67 68ifdef __HAVE_UNNESTED_INTRS 69define __HAVE_UNNESTED_INTRS 1 70endif 71 72define KERNEL_BASE KERNEL_BASE 73define VM_MIN_ADDRESS VM_MIN_ADDRESS 74define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS 75 76define PMAP_DOMAIN_KERNEL PMAP_DOMAIN_KERNEL 77 78ifdef PMAP_INCLUDE_PTE_SYNC 79define PMAP_INCLUDE_PTE_SYNC 1 80endif 81 82define PAGE_SIZE PAGE_SIZE 83define UPAGES UPAGES 84define PGSHIFT PGSHIFT 85 86# Important offsets into the lwp and proc structs & associated constants 87define L_ADDR offsetof(struct lwp, l_addr) 88define L_CPU offsetof(struct lwp, l_cpu) 89define L_PRIORITY offsetof(struct lwp, l_priority) 90define L_WCHAN offsetof(struct lwp, l_wchan) 91define L_STAT offsetof(struct lwp, l_stat) 92define L_PROC offsetof(struct lwp, l_proc) 93define L_CTXSWTCH offsetof(struct lwp, l_ctxswtch) 94define P_RASLIST offsetof(struct proc, p_raslist) 95 96define PCB_TF offsetof(struct pcb, pcb_tf) 97define PCB_FLAGS offsetof(struct pcb, pcb_flags) 98define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8) 99define PCB_R9 offsetof(struct pcb, pcb_un.un_32.pcb32_r9) 100define PCB_R10 offsetof(struct pcb, pcb_un.un_32.pcb32_r10) 101define PCB_R11 offsetof(struct pcb, pcb_un.un_32.pcb32_r11) 102define PCB_R12 offsetof(struct pcb, pcb_un.un_32.pcb32_r12) 103define PCB_SP offsetof(struct pcb, pcb_un.un_32.pcb32_sp) 104define PCB_LR offsetof(struct pcb, pcb_un.un_32.pcb32_lr) 105define PCB_PC offsetof(struct pcb, pcb_un.un_32.pcb32_pc) 106define PCB_USER_PID_RW offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_rw) 107define PCB_USER_PID_RO offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_ro) 108define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) 109define PCB_NOALIGNFLT PCB_NOALIGNFLT 110 111define USER_SIZE sizeof(struct user) 112 113define V_TRAP offsetof(struct uvmexp, traps) 114define V_INTR offsetof(struct uvmexp, intrs) 115define V_SOFT offsetof(struct uvmexp, softs) 116 117define VM_MAP offsetof(struct vmspace, vm_map) 118define VM_PMAP offsetof(struct vmspace, vm_map.pmap) 119 120define PR_BASE offsetof(struct uprof, pr_base) 121define PR_SIZE offsetof(struct uprof, pr_size) 122define PR_OFF offsetof(struct uprof, pr_off) 123define PR_SCALE offsetof(struct uprof, pr_scale) 124 125define SIGTRAP SIGTRAP 126define SIGEMT SIGEMT 127 128define TF_R0 offsetof(struct trapframe, tf_r0) 129define TF_R10 offsetof(struct trapframe, tf_r10) 130define TF_PC offsetof(struct trapframe, tf_pc) 131 132define IF_PC offsetof(struct irqframe, if_pc) 133 134define PROCSIZE sizeof(struct proc) 135define TRAPFRAMESIZE sizeof(struct trapframe) 136 137define CF_IDCACHE_WBINV_ALL offsetof(struct cpu_functions, cf_idcache_wbinv_all) 138define CF_DCACHE_WB_RANGE offsetof(struct cpu_functions, cf_dcache_wb_range) 139define CF_TLB_FLUSHID_SE offsetof(struct cpu_functions, cf_tlb_flushID_SE) 140define CF_CONTEXT_SWITCH offsetof(struct cpu_functions, cf_context_switch) 141define CF_SLEEP offsetof(struct cpu_functions, cf_sleep) 142define CF_CONTROL offsetof(struct cpu_functions, cf_control) 143 144define CI_CURPRIORITY offsetof(struct cpu_info, ci_schedstate.spc_curpriority) 145ifndef PROCESS_ID_IS_CURLWP 146define CI_CURLWP offsetof(struct cpu_info, ci_curlwp) 147endif 148define CI_CURPCB offsetof(struct cpu_info, ci_curpcb) 149define CI_CPL offsetof(struct cpu_info, ci_cpl) 150define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending) 151define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched) 152define CI_INTR_DEPTH offsetof(struct cpu_info, ci_intr_depth) 153define CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count) 154if defined(EXEC_AOUT) 155define CI_CTRL offsetof(struct cpu_info, ci_ctrl) 156endif 157ifdef __HAVE_FAST_SOFTINTS 158define CI_SOFTINTS offsetof(struct cpu_info, ci_softints) 159endif 160 161# Constants required for in_cksum() and friends. 162define M_LEN offsetof(struct mbuf, m_len) 163define M_DATA offsetof(struct mbuf, m_data) 164define M_NEXT offsetof(struct mbuf, m_next) 165define IP_SRC offsetof(struct ip, ip_src) 166define IP_DST offsetof(struct ip, ip_dst) 167