1 # $NetBSD: genassym.cf,v 1.41 2008/09/20 18:29:05 tsutsui Exp $
3 # Copyright (c) 1982, 1990 The Regents of the University of California.
6 # This code is derived from software contributed to Berkeley by
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
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.
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
37 include <sys/resourcevar.h>
38 include <sys/device.h>
39 include <sys/signal.h>
40 include <netinet/in.h>
41 include <netinet/in_systm.h>
42 include <netinet/ip.h>
43 include <netinet/ip6.h>
44 include <netinet/ip_var.h>
46 include <uvm/uvm_extern.h>
50 include <machine/pmap.h>
51 include <machine/frame.h>
52 include <machine/vmparam.h>
54 include "opt_multiprocessor.h"
55 include "opt_compat_netbsd.h"
56 include "opt_execfmt.h"
59 ifdef __ARM_FIQ_INDIRECT
60 define __ARM_FIQ_INDIRECT 1
63 ifdef __HAVE_FAST_SOFTINTS
64 define __HAVE_FAST_SOFTINTS 1
67 ifdef __HAVE_UNNESTED_INTRS
68 define __HAVE_UNNESTED_INTRS 1
71 define KERNEL_BASE KERNEL_BASE
72 define VM_MIN_ADDRESS VM_MIN_ADDRESS
73 define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS
75 define PMAP_DOMAIN_KERNEL PMAP_DOMAIN_KERNEL
77 ifdef PMAP_INCLUDE_PTE_SYNC
78 define PMAP_INCLUDE_PTE_SYNC 1
81 define PAGE_SIZE PAGE_SIZE
83 define PGSHIFT PGSHIFT
85 # Important offsets into the lwp and proc structs & associated constants
86 define L_PCB offsetof(struct lwp, l_addr)
87 define L_CPU offsetof(struct lwp, l_cpu)
88 define L_PRIORITY offsetof(struct lwp, l_priority)
89 define L_WCHAN offsetof(struct lwp, l_wchan)
90 define L_STAT offsetof(struct lwp, l_stat)
91 define L_PROC offsetof(struct lwp, l_proc)
92 define L_CTXSWTCH offsetof(struct lwp, l_ctxswtch)
93 define P_RASLIST offsetof(struct proc, p_raslist)
95 define PCB_TF offsetof(struct pcb, pcb_tf)
96 define PCB_FLAGS offsetof(struct pcb, pcb_flags)
97 define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
98 define PCB_R9 offsetof(struct pcb, pcb_un.un_32.pcb32_r9)
99 define PCB_R10 offsetof(struct pcb, pcb_un.un_32.pcb32_r10)
100 define PCB_R11 offsetof(struct pcb, pcb_un.un_32.pcb32_r11)
101 define PCB_R12 offsetof(struct pcb, pcb_un.un_32.pcb32_r12)
102 define PCB_SP offsetof(struct pcb, pcb_un.un_32.pcb32_sp)
103 define PCB_LR offsetof(struct pcb, pcb_un.un_32.pcb32_lr)
104 define PCB_PC offsetof(struct pcb, pcb_un.un_32.pcb32_pc)
105 define PCB_USER_PID_RW offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_rw)
106 define PCB_USER_PID_RO offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_ro)
107 define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
108 define PCB_NOALIGNFLT PCB_NOALIGNFLT
110 define USER_SIZE sizeof(struct user)
112 define V_TRAP offsetof(struct uvmexp, traps)
113 define V_INTR offsetof(struct uvmexp, intrs)
114 define V_SOFT offsetof(struct uvmexp, softs)
116 define VM_MAP offsetof(struct vmspace, vm_map)
117 define VM_PMAP offsetof(struct vmspace, vm_map.pmap)
119 define PR_BASE offsetof(struct uprof, pr_base)
120 define PR_SIZE offsetof(struct uprof, pr_size)
121 define PR_OFF offsetof(struct uprof, pr_off)
122 define PR_SCALE offsetof(struct uprof, pr_scale)
124 define SIGTRAP SIGTRAP
127 define TF_R0 offsetof(struct trapframe, tf_r0)
128 define TF_R10 offsetof(struct trapframe, tf_r10)
129 define TF_PC offsetof(struct trapframe, tf_pc)
131 define IF_PC offsetof(struct irqframe, if_pc)
133 define PROCSIZE sizeof(struct proc)
134 define TRAPFRAMESIZE sizeof(struct trapframe)
136 define CF_IDCACHE_WBINV_ALL offsetof(struct cpu_functions, cf_idcache_wbinv_all)
137 define CF_DCACHE_WB_RANGE offsetof(struct cpu_functions, cf_dcache_wb_range)
138 define CF_TLB_FLUSHID_SE offsetof(struct cpu_functions, cf_tlb_flushID_SE)
139 define CF_CONTEXT_SWITCH offsetof(struct cpu_functions, cf_context_switch)
140 define CF_SLEEP offsetof(struct cpu_functions, cf_sleep)
141 define CF_CONTROL offsetof(struct cpu_functions, cf_control)
143 define CI_CURPRIORITY offsetof(struct cpu_info, ci_schedstate.spc_curpriority)
144 ifndef PROCESS_ID_IS_CURLWP
145 define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
147 define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
148 define CI_CPL offsetof(struct cpu_info, ci_cpl)
149 define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
150 define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)
151 define CI_INTR_DEPTH offsetof(struct cpu_info, ci_intr_depth)
152 define CI_MTX_COUNT offsetof(struct cpu_info, ci_mtx_count)
153 if defined(EXEC_AOUT)
154 define CI_CTRL offsetof(struct cpu_info, ci_ctrl)
156 ifdef __HAVE_FAST_SOFTINTS
157 define CI_SOFTINTS offsetof(struct cpu_info, ci_softints)
160 # Constants required for in_cksum() and friends.
161 define M_LEN offsetof(struct mbuf, m_len)
162 define M_DATA offsetof(struct mbuf, m_data)
163 define M_NEXT offsetof(struct mbuf, m_next)
164 define IP_SRC offsetof(struct ip, ip_src)
165 define IP_DST offsetof(struct ip, ip_dst)