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