1 # $NetBSD: genassym.cf,v 1.15 2008/02/23 19:34:53 matt Exp $
4 # Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 # Copyright (C) 1995, 1996 TooLs GmbH.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
16 # 3. All advertising materials mentioning features or use of this software
17 # must display the following acknowledgement:
18 # This product includes software developed by TooLs GmbH.
19 # 4. The name of TooLs GmbH may not be used to endorse or promote products
20 # derived from this software without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 # IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 quote #define __MUTEX_PRIVATE
35 quote #define __RWLOCK_PRIVATE
41 include <uvm/uvm_extern.h>
43 include <machine/pcb.h>
44 include <machine/pmap.h>
46 define FRAMELEN FRAMELEN
47 define FRAME_0 offsetof(struct trapframe, fixreg[0])
48 define FRAME_1 offsetof(struct trapframe, fixreg[1])
49 define FRAME_2 offsetof(struct trapframe, fixreg[2])
50 define FRAME_3 offsetof(struct trapframe, fixreg[3])
51 define FRAME_4 offsetof(struct trapframe, fixreg[4])
52 define FRAME_5 offsetof(struct trapframe, fixreg[5])
53 define FRAME_6 offsetof(struct trapframe, fixreg[6])
54 define FRAME_7 offsetof(struct trapframe, fixreg[7])
55 define FRAME_8 offsetof(struct trapframe, fixreg[8])
56 define FRAME_9 offsetof(struct trapframe, fixreg[9])
57 define FRAME_10 offsetof(struct trapframe, fixreg[10])
58 define FRAME_11 offsetof(struct trapframe, fixreg[11])
59 define FRAME_12 offsetof(struct trapframe, fixreg[12])
60 define FRAME_13 offsetof(struct trapframe, fixreg[13])
61 define FRAME_14 offsetof(struct trapframe, fixreg[14])
62 define FRAME_15 offsetof(struct trapframe, fixreg[15])
63 define FRAME_16 offsetof(struct trapframe, fixreg[16])
64 define FRAME_17 offsetof(struct trapframe, fixreg[17])
65 define FRAME_18 offsetof(struct trapframe, fixreg[18])
66 define FRAME_19 offsetof(struct trapframe, fixreg[19])
67 define FRAME_20 offsetof(struct trapframe, fixreg[20])
68 define FRAME_21 offsetof(struct trapframe, fixreg[21])
69 define FRAME_22 offsetof(struct trapframe, fixreg[22])
70 define FRAME_23 offsetof(struct trapframe, fixreg[23])
71 define FRAME_24 offsetof(struct trapframe, fixreg[24])
72 define FRAME_25 offsetof(struct trapframe, fixreg[25])
73 define FRAME_26 offsetof(struct trapframe, fixreg[26])
74 define FRAME_27 offsetof(struct trapframe, fixreg[27])
75 define FRAME_28 offsetof(struct trapframe, fixreg[28])
76 define FRAME_29 offsetof(struct trapframe, fixreg[29])
77 define FRAME_30 offsetof(struct trapframe, fixreg[30])
78 define FRAME_31 offsetof(struct trapframe, fixreg[31])
79 define FRAME_LR offsetof(struct trapframe, lr)
80 define FRAME_CR offsetof(struct trapframe, cr)
81 define FRAME_CTR offsetof(struct trapframe, ctr)
82 define FRAME_XER offsetof(struct trapframe, xer)
83 define FRAME_SRR0 offsetof(struct trapframe, srr0)
84 define FRAME_SRR1 offsetof(struct trapframe, srr1)
85 define FRAME_DEAR offsetof(struct trapframe, dar)
86 define FRAME_EXC offsetof(struct trapframe, exc)
87 define FRAME_ESR offsetof(struct trapframe, tf_xtra[TF_ESR])
88 define FRAME_PID offsetof(struct trapframe, tf_xtra[TF_PID])
90 define IFRAMELEN IFRAMELEN
91 define IFRAME_R1 offsetof(struct intrframe, r1)
92 define IFRAME_SRR1 offsetof(struct intrframe, srr1)
93 define IFRAME_SRR0 offsetof(struct intrframe, srr0)
94 define IFRAME_PRI offsetof(struct intrframe, pri)
95 define IFRAME_INTR_DEPTH offsetof(struct intrframe, intrdepth)
96 define IFRAME_PID offsetof(struct intrframe, pid)
97 define IFRAME_CTR offsetof(struct intrframe, ctr)
98 define IFRAME_XER offsetof(struct intrframe, xer)
99 define IFRAME_CR offsetof(struct intrframe, cr)
100 define IFRAME_LR offsetof(struct intrframe, lr)
101 define IFRAME_R12 offsetof(struct intrframe, r12)
102 define IFRAME_R11 offsetof(struct intrframe, r11)
103 define IFRAME_R10 offsetof(struct intrframe, r10)
104 define IFRAME_R9 offsetof(struct intrframe, r9)
105 define IFRAME_R8 offsetof(struct intrframe, r8)
106 define IFRAME_R7 offsetof(struct intrframe, r7)
107 define IFRAME_R6 offsetof(struct intrframe, r6)
108 define IFRAME_R5 offsetof(struct intrframe, r5)
109 define IFRAME_R4 offsetof(struct intrframe, r4)
110 define IFRAME_R3 offsetof(struct intrframe, r3)
111 define IFRAME_R0 offsetof(struct intrframe, r0)
113 define CALLFRAMELEN CALLFRAMELEN
114 define CFRAME_SP offsetof(struct callframe, sp)
115 define CFRAME_LR offsetof(struct callframe, lr)
116 define CFRAME_R30 offsetof(struct callframe, r30)
117 define CFRAME_R31 offsetof(struct callframe, r31)
119 define SFRAMELEN SFRAMELEN
120 define SFRAME_SP offsetof(struct switchframe, sp)
121 define SFRAME_LR offsetof(struct switchframe, lr)
122 define SFRAME_USER_SR offsetof(struct switchframe, user_sr)
123 define SFRAME_CR offsetof(struct switchframe, cr)
124 define SFRAME_R2 offsetof(struct switchframe, fixreg2)
125 define SFRAME_R13 offsetof(struct switchframe, fixreg[0])
126 define SFRAME_R14 offsetof(struct switchframe, fixreg[1])
127 define SFRAME_R15 offsetof(struct switchframe, fixreg[2])
128 define SFRAME_R16 offsetof(struct switchframe, fixreg[3])
129 define SFRAME_R17 offsetof(struct switchframe, fixreg[4])
130 define SFRAME_R18 offsetof(struct switchframe, fixreg[5])
131 define SFRAME_R19 offsetof(struct switchframe, fixreg[6])
132 define SFRAME_R20 offsetof(struct switchframe, fixreg[7])
133 define SFRAME_R21 offsetof(struct switchframe, fixreg[8])
134 define SFRAME_R22 offsetof(struct switchframe, fixreg[9])
135 define SFRAME_R23 offsetof(struct switchframe, fixreg[10])
136 define SFRAME_R24 offsetof(struct switchframe, fixreg[11])
137 define SFRAME_R25 offsetof(struct switchframe, fixreg[12])
138 define SFRAME_R26 offsetof(struct switchframe, fixreg[13])
139 define SFRAME_R27 offsetof(struct switchframe, fixreg[14])
140 define SFRAME_R28 offsetof(struct switchframe, fixreg[15])
141 define SFRAME_R29 offsetof(struct switchframe, fixreg[16])
142 define SFRAME_R30 offsetof(struct switchframe, fixreg[17])
143 define SFRAME_R31 offsetof(struct switchframe, fixreg[18])
145 define PCB_PM offsetof(struct pcb, pcb_pm)
146 define PCB_SP offsetof(struct pcb, pcb_sp)
147 define PCB_FAULT offsetof(struct pcb, pcb_onfault)
149 define PM_CTX offsetof(struct pmap, pm_ctx)
151 define L_PCB offsetof(struct lwp, l_addr)
152 define L_STAT offsetof(struct lwp, l_stat)
153 define L_CPU offsetof(struct lwp, l_cpu)
154 define L_PRIORITY offsetof(struct lwp, l_priority)
155 define L_PROC offsetof(struct lwp, l_proc)
157 define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
160 define LSONPROC LSONPROC
162 define CI_SIZE sizeof(struct cpu_info)
163 define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
164 define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
165 define CI_CURPM offsetof(struct cpu_info, ci_curpm)
166 define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
167 define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)
168 define CI_CPL offsetof(struct cpu_info, ci_cpl)
169 define CI_INTRDEPTH offsetof(struct cpu_info, ci_intrdepth)
170 define CI_INTSTK offsetof(struct cpu_info, ci_intstk)
171 define CI_TEMPSAVE offsetof(struct cpu_info, ci_tempsave)
172 define CI_DDBSAVE offsetof(struct cpu_info, ci_ddbsave)
173 define CI_IPKDBSAVE offsetof(struct cpu_info, ci_ipkdbsave)
174 define CI_DISISAVE offsetof(struct cpu_info, ci_disisave)
175 define CI_IDLESPIN offsetof(struct cpu_info, ci_idlespin)
177 define CPUSAVE_R28 CPUSAVE_R28*sizeof(register_t)
178 define CPUSAVE_R29 CPUSAVE_R29*sizeof(register_t)
179 define CPUSAVE_R30 CPUSAVE_R30*sizeof(register_t)
180 define CPUSAVE_R31 CPUSAVE_R31*sizeof(register_t)
181 define CPUSAVE_DAR CPUSAVE_DAR*sizeof(register_t)
182 define CPUSAVE_DSISR CPUSAVE_DSISR*sizeof(register_t)
183 define CPUSAVE_SRR0 CPUSAVE_SRR0*sizeof(register_t)
184 define CPUSAVE_SRR1 CPUSAVE_SRR1*sizeof(register_t)
186 define FB_PC offsetof(struct faultbuf, fb_pc)
187 define FB_SP offsetof(struct faultbuf, fb_sp)
188 define FB_R2 offsetof(struct faultbuf, fb_r2)
189 define FB_CR offsetof(struct faultbuf, fb_cr)
190 define FB_R13 offsetof(struct faultbuf, fb_fixreg[0])
191 define FB_R14 offsetof(struct faultbuf, fb_fixreg[1])
192 define FB_R15 offsetof(struct faultbuf, fb_fixreg[2])
193 define FB_R16 offsetof(struct faultbuf, fb_fixreg[3])
194 define FB_R17 offsetof(struct faultbuf, fb_fixreg[4])
195 define FB_R18 offsetof(struct faultbuf, fb_fixreg[5])
196 define FB_R19 offsetof(struct faultbuf, fb_fixreg[6])
197 define FB_R20 offsetof(struct faultbuf, fb_fixreg[7])
198 define FB_R21 offsetof(struct faultbuf, fb_fixreg[8])
199 define FB_R22 offsetof(struct faultbuf, fb_fixreg[9])
200 define FB_R23 offsetof(struct faultbuf, fb_fixreg[10])
201 define FB_R24 offsetof(struct faultbuf, fb_fixreg[11])
202 define FB_R25 offsetof(struct faultbuf, fb_fixreg[12])
203 define FB_R26 offsetof(struct faultbuf, fb_fixreg[13])
204 define FB_R27 offsetof(struct faultbuf, fb_fixreg[14])
205 define FB_R28 offsetof(struct faultbuf, fb_fixreg[15])
206 define FB_R29 offsetof(struct faultbuf, fb_fixreg[16])
207 define FB_R30 offsetof(struct faultbuf, fb_fixreg[17])
208 define FB_R31 offsetof(struct faultbuf, fb_fixreg[18])
210 define CACHELINESIZE CACHELINESIZE
212 define CPU_CI offsetof(struct cpu_info, ci_ci)
214 ifdef __HAVE_MUTEX_STUBS
215 define __HAVE_MUTEX_STUBS __HAVE_MUTEX_STUBS
217 ifdef __HAVE_MUTEX_SPIN_STUBS
218 define __HAVE_MUTEX_SPIN_STUBS __HAVE_MUTEX_SPIN_STUBS
220 define MTX_OWNER offsetof(struct kmutex, mtx_owner)
221 define MTX_LOCK offsetof(struct kmutex, mtx_lock)
222 define MTX_IPL offsetof(struct kmutex, mtx_ipl)
224 ifdef __HAVE_RW_STUBS
225 define __HAVE_RW_STUBS __HAVE_RW_STUBS
227 define RW_OWNER offsetof(struct krwlock, rw_owner)
228 define RW_WRITE_LOCKED RW_WRITE_LOCKED
229 define RW_READ_INCR RW_READ_INCR
230 define RW_READER RW_READER