]> git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/genassym.c
cdf366c63386ae79c2e31e45f9dfc313571ec06d
[apple/xnu.git] / osfmk / ppc / genassym.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 *
25 */
26
27 /*
28 * genassym.c is used to produce an
29 * assembly file which, intermingled with unuseful assembly code,
30 * has all the necessary definitions emitted. This assembly file is
31 * then postprocessed with sed to extract only these definitions
32 * and thus the final assyms.s is created.
33 *
34 * This convoluted means is necessary since the structure alignment
35 * and packing may be different between the host machine and the
36 * target so we are forced into using the cross compiler to generate
37 * the values, but we cannot run anything on the target machine.
38 */
39
40 #include <cpus.h>
41 #include <va_list.h>
42 #include <types.h>
43
44 #include <kern/task.h>
45 #include <kern/thread.h>
46 #include <kern/thread_act.h>
47 #include <kern/host.h>
48 #include <kern/lock.h>
49 #include <kern/processor.h>
50 #include <ppc/exception.h>
51 #include <ppc/thread_act.h>
52 #include <ppc/misc_protos.h>
53 #include <kern/syscall_sw.h>
54 #include <kern/ast.h>
55 #include <ppc/low_trace.h>
56 #include <ppc/PseudoKernel.h>
57 #include <ppc/mappings.h>
58 #include <ppc/Firmware.h>
59 #include <ppc/low_trace.h>
60 #include <vm/vm_map.h>
61 #include <vm/pmap.h>
62 #include <ppc/pmap.h>
63 #include <ppc/pmap_internals.h>
64 #include <ppc/Diagnostics.h>
65 #include <ppc/POWERMAC/mp/MPPlugIn.h>
66 #include <pexpert/pexpert.h>
67 #include <mach/machine.h>
68 #include <ppc/vmachmon.h>
69 #include <ppc/PPCcalls.h>
70
71 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE)0)->MEMBER)
72
73 #define DECLARE(SYM,VAL) \
74 __asm("#DEFINITION##define\t" SYM "\t%0" : : "n" ((u_int)(VAL)))
75
76 int main(int argc, char *argv[])
77 {
78 /* Process Control Block */
79
80 DECLARE("PCB_FLOAT_STATE", offsetof(struct pcb *, fs));
81
82 /* Floating point state */
83
84 DECLARE("PCB_FS_F0", offsetof(struct pcb *, fs.fpregs[0]));
85 DECLARE("PCB_FS_F1", offsetof(struct pcb *, fs.fpregs[1]));
86 DECLARE("PCB_FS_F2", offsetof(struct pcb *, fs.fpregs[2]));
87 DECLARE("PCB_FS_F3", offsetof(struct pcb *, fs.fpregs[3]));
88 DECLARE("PCB_FS_F4", offsetof(struct pcb *, fs.fpregs[4]));
89 DECLARE("PCB_FS_F5", offsetof(struct pcb *, fs.fpregs[5]));
90 DECLARE("PCB_FS_F6", offsetof(struct pcb *, fs.fpregs[6]));
91 DECLARE("PCB_FS_F7", offsetof(struct pcb *, fs.fpregs[7]));
92 DECLARE("PCB_FS_F8", offsetof(struct pcb *, fs.fpregs[8]));
93 DECLARE("PCB_FS_F9", offsetof(struct pcb *, fs.fpregs[9]));
94 DECLARE("PCB_FS_F10", offsetof(struct pcb *, fs.fpregs[10]));
95 DECLARE("PCB_FS_F11", offsetof(struct pcb *, fs.fpregs[11]));
96 DECLARE("PCB_FS_F12", offsetof(struct pcb *, fs.fpregs[12]));
97 DECLARE("PCB_FS_F13", offsetof(struct pcb *, fs.fpregs[13]));
98 DECLARE("PCB_FS_F14", offsetof(struct pcb *, fs.fpregs[14]));
99 DECLARE("PCB_FS_F15", offsetof(struct pcb *, fs.fpregs[15]));
100 DECLARE("PCB_FS_F16", offsetof(struct pcb *, fs.fpregs[16]));
101 DECLARE("PCB_FS_F17", offsetof(struct pcb *, fs.fpregs[17]));
102 DECLARE("PCB_FS_F18", offsetof(struct pcb *, fs.fpregs[18]));
103 DECLARE("PCB_FS_F19", offsetof(struct pcb *, fs.fpregs[19]));
104 DECLARE("PCB_FS_F20", offsetof(struct pcb *, fs.fpregs[20]));
105 DECLARE("PCB_FS_F21", offsetof(struct pcb *, fs.fpregs[21]));
106 DECLARE("PCB_FS_F22", offsetof(struct pcb *, fs.fpregs[22]));
107 DECLARE("PCB_FS_F23", offsetof(struct pcb *, fs.fpregs[23]));
108 DECLARE("PCB_FS_F24", offsetof(struct pcb *, fs.fpregs[24]));
109 DECLARE("PCB_FS_F25", offsetof(struct pcb *, fs.fpregs[25]));
110 DECLARE("PCB_FS_F26", offsetof(struct pcb *, fs.fpregs[26]));
111 DECLARE("PCB_FS_F27", offsetof(struct pcb *, fs.fpregs[27]));
112 DECLARE("PCB_FS_F28", offsetof(struct pcb *, fs.fpregs[28]));
113 DECLARE("PCB_FS_F29", offsetof(struct pcb *, fs.fpregs[29]));
114 DECLARE("PCB_FS_F30", offsetof(struct pcb *, fs.fpregs[30]));
115 DECLARE("PCB_FS_F31", offsetof(struct pcb *, fs.fpregs[31]));
116 DECLARE("PCB_FS_FPSCR", offsetof(struct pcb *, fs.fpscr_pad));
117
118 DECLARE("PCB_SAVED_STATE",offsetof(struct pcb *, ss));
119 DECLARE("ACT_MACT_KSP", offsetof(struct thread_activation *, mact.ksp));
120 DECLARE("ACT_MACT_BEDA", offsetof(struct thread_activation *, mact.bbDescAddr));
121 DECLARE("ACT_MACT_BTS", offsetof(struct thread_activation *, mact.bbTableStart));
122 DECLARE("ACT_MACT_BTE", offsetof(struct thread_activation *, mact.bbTaskEnv));
123 DECLARE("ACT_MACT_SPF", offsetof(struct thread_activation *, mact.specFlags));
124 DECLARE("qactTimer", offsetof(struct thread_activation *, mact.qactTimer));
125 DECLARE("floatUsed", floatUsed);
126 DECLARE("vectorUsed", vectorUsed);
127 DECLARE("bbNoMachSCbit",bbNoMachSCbit);
128 DECLARE("runningVM", runningVM);
129 DECLARE("floatCng", floatCng);
130 DECLARE("vectorCng", vectorCng);
131 DECLARE("floatCngbit", floatCngbit);
132 DECLARE("vectorCngbit", vectorCngbit);
133
134 DECLARE("PCB_SIZE", sizeof(struct pcb));
135
136 /* Save State Structure */
137 DECLARE("SS_R0", offsetof(struct ppc_saved_state *, r0));
138 DECLARE("SS_R1", offsetof(struct ppc_saved_state *, r1));
139 DECLARE("SS_R2", offsetof(struct ppc_saved_state *, r2));
140 DECLARE("SS_R3", offsetof(struct ppc_saved_state *, r3));
141 DECLARE("SS_R4", offsetof(struct ppc_saved_state *, r4));
142 DECLARE("SS_R5", offsetof(struct ppc_saved_state *, r5));
143 DECLARE("SS_R6", offsetof(struct ppc_saved_state *, r6));
144 DECLARE("SS_R7", offsetof(struct ppc_saved_state *, r7));
145 DECLARE("SS_R8", offsetof(struct ppc_saved_state *, r8));
146 DECLARE("SS_R9", offsetof(struct ppc_saved_state *, r9));
147 DECLARE("SS_R10", offsetof(struct ppc_saved_state *, r10));
148 DECLARE("SS_R11", offsetof(struct ppc_saved_state *, r11));
149 DECLARE("SS_R12", offsetof(struct ppc_saved_state *, r12));
150 DECLARE("SS_R13", offsetof(struct ppc_saved_state *, r13));
151 DECLARE("SS_R14", offsetof(struct ppc_saved_state *, r14));
152 DECLARE("SS_R15", offsetof(struct ppc_saved_state *, r15));
153 DECLARE("SS_R16", offsetof(struct ppc_saved_state *, r16));
154 DECLARE("SS_R17", offsetof(struct ppc_saved_state *, r17));
155 DECLARE("SS_R18", offsetof(struct ppc_saved_state *, r18));
156 DECLARE("SS_R19", offsetof(struct ppc_saved_state *, r19));
157 DECLARE("SS_R20", offsetof(struct ppc_saved_state *, r20));
158 DECLARE("SS_R21", offsetof(struct ppc_saved_state *, r21));
159 DECLARE("SS_R22", offsetof(struct ppc_saved_state *, r22));
160 DECLARE("SS_R23", offsetof(struct ppc_saved_state *, r23));
161 DECLARE("SS_R24", offsetof(struct ppc_saved_state *, r24));
162 DECLARE("SS_R25", offsetof(struct ppc_saved_state *, r25));
163 DECLARE("SS_R26", offsetof(struct ppc_saved_state *, r26));
164 DECLARE("SS_R27", offsetof(struct ppc_saved_state *, r27));
165 DECLARE("SS_R28", offsetof(struct ppc_saved_state *, r28));
166 DECLARE("SS_R29", offsetof(struct ppc_saved_state *, r29));
167 DECLARE("SS_R30", offsetof(struct ppc_saved_state *, r30));
168 DECLARE("SS_R31", offsetof(struct ppc_saved_state *, r31));
169 DECLARE("SS_CR", offsetof(struct ppc_saved_state *, cr));
170 DECLARE("SS_XER", offsetof(struct ppc_saved_state *, xer));
171 DECLARE("SS_LR", offsetof(struct ppc_saved_state *, lr));
172 DECLARE("SS_CTR", offsetof(struct ppc_saved_state *, ctr));
173 DECLARE("SS_SRR0", offsetof(struct ppc_saved_state *, srr0));
174 DECLARE("SS_SRR1", offsetof(struct ppc_saved_state *, srr1));
175 DECLARE("SS_MQ", offsetof(struct ppc_saved_state *, mq));
176 DECLARE("SS_SR_COPYIN", offsetof(struct ppc_saved_state *, sr_copyin));
177 DECLARE("SS_SIZE", sizeof(struct ppc_saved_state));
178
179 /* Per Proc info structure */
180 DECLARE("PP_CPU_NUMBER", offsetof(struct per_proc_info *, cpu_number));
181 DECLARE("PP_CPU_FLAGS", offsetof(struct per_proc_info *, cpu_flags));
182 DECLARE("PP_ISTACKPTR", offsetof(struct per_proc_info *, istackptr));
183 DECLARE("PP_INTSTACK_TOP_SS", offsetof(struct per_proc_info *, intstack_top_ss));
184 #if MACH_KDP || MACH_KDB
185 DECLARE("PP_DEBSTACKPTR", offsetof(struct per_proc_info *, debstackptr));
186 DECLARE("PP_DEBSTACK_TOP_SS", offsetof(struct per_proc_info *, debstack_top_ss));
187 #endif
188 DECLARE("PP_TEMPWORK1", offsetof(struct per_proc_info *, tempwork1));
189 DECLARE("PP_USERSPACE", offsetof(struct per_proc_info *, userspace));
190 DECLARE("PP_USERPMAP", offsetof(struct per_proc_info *, userpmap));
191 DECLARE("PP_LASTPMAP", offsetof(struct per_proc_info *, Lastpmap));
192 DECLARE("savedSave", offsetof(struct per_proc_info *, savedSave));
193
194 DECLARE("PP_SAVE_EXCEPTION_TYPE", offsetof(struct per_proc_info *, save_exception_type));
195 DECLARE("PP_CPU_DATA", offsetof(struct per_proc_info *, cpu_data));
196 DECLARE("PP_ACTIVE_KLOADED", offsetof(struct per_proc_info *, active_kloaded));
197 DECLARE("PP_ACTIVE_STACKS", offsetof(struct per_proc_info *, active_stacks));
198 DECLARE("PP_NEED_AST", offsetof(struct per_proc_info *, need_ast));
199 DECLARE("PP_FPU_THREAD", offsetof(struct per_proc_info *, FPU_thread));
200 DECLARE("FPU_vmmCtx", offsetof(struct per_proc_info *, FPU_vmmCtx));
201 DECLARE("PP_VMX_THREAD", offsetof(struct per_proc_info *, VMX_thread));
202 DECLARE("VMX_vmmCtx", offsetof(struct per_proc_info *, VMX_vmmCtx));
203 DECLARE("PP_QUICKFRET", offsetof(struct per_proc_info *, quickfret));
204 DECLARE("UAW", offsetof(struct per_proc_info *, Uassist));
205 DECLARE("liveVRS", offsetof(struct per_proc_info *, liveVRSave));
206 DECLARE("liveFPSCR", offsetof(struct per_proc_info *, liveFPSCR));
207 DECLARE("spcFlags", offsetof(struct per_proc_info *, spcFlags));
208 DECLARE("spcTRc", offsetof(struct per_proc_info *, spcTRc));
209 DECLARE("spcTRp", offsetof(struct per_proc_info *, spcTRp));
210 DECLARE("ruptStamp", offsetof(struct per_proc_info *, ruptStamp));
211 DECLARE("pfAvailable", offsetof(struct per_proc_info *, pf.Available));
212 DECLARE("pfFloat", pfFloat);
213 DECLARE("pfFloatb", pfFloatb);
214 DECLARE("pfAltivec", pfAltivec);
215 DECLARE("pfAltivecb", pfAltivecb);
216 DECLARE("pfAvJava", pfAvJava);
217 DECLARE("pfAvJavab", pfAvJavab);
218 DECLARE("pfSMPcap", pfSMPcap);
219 DECLARE("pfSMPcapb", pfSMPcapb);
220 DECLARE("pfCanSleep", pfCanSleep);
221 DECLARE("pfCanSleepb", pfCanSleepb);
222 DECLARE("pfCanNap", pfCanNap);
223 DECLARE("pfCanNapb", pfCanNapb);
224 DECLARE("pfCanDoze", pfCanDoze);
225 DECLARE("pfCanDozeb", pfCanDozeb);
226 DECLARE("pfCanDoze", pfCanDoze);
227 DECLARE("pfCanDozeb", pfCanDozeb);
228 DECLARE("pfThermal", pfThermal);
229 DECLARE("pfThermalb", pfThermalb);
230 DECLARE("pfThermInt", pfThermInt);
231 DECLARE("pfThermIntb", pfThermIntb);
232 DECLARE("pfL23lck", pfL23lck);
233 DECLARE("pfL23lckb", pfL23lckb);
234 DECLARE("pfWillNap", pfWillNap);
235 DECLARE("pfWillNapb", pfWillNapb);
236 DECLARE("pfNoMSRir", pfNoMSRir);
237 DECLARE("pfNoMSRirb", pfNoMSRirb);
238 DECLARE("pfL1nnc", pfL1nnc);
239 DECLARE("pfL1nncb", pfL1nncb);
240 DECLARE("pfL1i", pfL1i);
241 DECLARE("pfL1ib", pfL1ib);
242 DECLARE("pfL1d", pfL1d);
243 DECLARE("pfL1db", pfL1db);
244 DECLARE("pfL1fa", pfL1fa);
245 DECLARE("pfL1fab", pfL1fab);
246 DECLARE("pfL2", pfL2);
247 DECLARE("pfL2b", pfL2b);
248 DECLARE("pfL2fa", pfL2fa);
249 DECLARE("pfL2fab", pfL2fab);
250 DECLARE("pfL2i", pfL2i);
251 DECLARE("pfL2ib", pfL2ib);
252 DECLARE("pfL3", pfL3);
253 DECLARE("pfL3b", pfL3b);
254 DECLARE("pfL3fa", pfL3fa);
255 DECLARE("pfL3fab", pfL3fab);
256 DECLARE("pfValid", pfValid);
257 DECLARE("pfValidb", pfValidb);
258 DECLARE("pfrptdProc", offsetof(struct per_proc_info *, pf.rptdProc));
259 DECLARE("pflineSize", offsetof(struct per_proc_info *, pf.lineSize));
260 DECLARE("pfl1iSize", offsetof(struct per_proc_info *, pf.l1iSize));
261 DECLARE("pfl1dSize", offsetof(struct per_proc_info *, pf.l1dSize));
262 DECLARE("pfl2cr", offsetof(struct per_proc_info *, pf.l2cr));
263 DECLARE("pfl2Size", offsetof(struct per_proc_info *, pf.l2Size));
264 DECLARE("pfl3cr", offsetof(struct per_proc_info *, pf.l3cr));
265 DECLARE("pfl3Size", offsetof(struct per_proc_info *, pf.l3Size));
266 DECLARE("pfHID0", offsetof(struct per_proc_info *, pf.pfHID0));
267 DECLARE("pfHID1", offsetof(struct per_proc_info *, pf.pfHID1));
268 DECLARE("pfHID2", offsetof(struct per_proc_info *, pf.pfHID2));
269 DECLARE("pfHID3", offsetof(struct per_proc_info *, pf.pfHID3));
270 DECLARE("pfMSSCR0", offsetof(struct per_proc_info *, pf.pfMSSCR0));
271 DECLARE("pfMSSCR1", offsetof(struct per_proc_info *, pf.pfMSSCR1));
272 DECLARE("pfICTRL", offsetof(struct per_proc_info *, pf.pfICTRL));
273 DECLARE("pfLDSTCR", offsetof(struct per_proc_info *, pf.pfLDSTCR));
274 DECLARE("pfSize", sizeof(procFeatures));
275
276 DECLARE("thrmmaxTemp", offsetof(struct per_proc_info *, thrm.maxTemp));
277 DECLARE("thrmthrottleTemp", offsetof(struct per_proc_info *, thrm.throttleTemp));
278 DECLARE("thrmlowTemp", offsetof(struct per_proc_info *, thrm.lowTemp));
279 DECLARE("thrmhighTemp", offsetof(struct per_proc_info *, thrm.highTemp));
280 DECLARE("thrm3val", offsetof(struct per_proc_info *, thrm.thrm3val));
281 DECLARE("thrmSize", sizeof(thrmControl));
282
283 DECLARE("napStamp", offsetof(struct per_proc_info *, napStamp));
284 DECLARE("napTotal", offsetof(struct per_proc_info *, napTotal));
285
286 DECLARE("emfp0", offsetof(struct per_proc_info *, emfp0));
287 DECLARE("emfp1", offsetof(struct per_proc_info *, emfp1));
288 DECLARE("emfp2", offsetof(struct per_proc_info *, emfp2));
289 DECLARE("emfp3", offsetof(struct per_proc_info *, emfp3));
290 DECLARE("emfp4", offsetof(struct per_proc_info *, emfp4));
291 DECLARE("emfp5", offsetof(struct per_proc_info *, emfp5));
292 DECLARE("emfp6", offsetof(struct per_proc_info *, emfp6));
293 DECLARE("emfp7", offsetof(struct per_proc_info *, emfp7));
294 DECLARE("emfp8", offsetof(struct per_proc_info *, emfp8));
295 DECLARE("emfp9", offsetof(struct per_proc_info *, emfp9));
296 DECLARE("emfp10", offsetof(struct per_proc_info *, emfp10));
297 DECLARE("emfp11", offsetof(struct per_proc_info *, emfp11));
298 DECLARE("emfp12", offsetof(struct per_proc_info *, emfp12));
299 DECLARE("emfp13", offsetof(struct per_proc_info *, emfp13));
300 DECLARE("emfp14", offsetof(struct per_proc_info *, emfp14));
301 DECLARE("emfp15", offsetof(struct per_proc_info *, emfp15));
302 DECLARE("emfp16", offsetof(struct per_proc_info *, emfp16));
303 DECLARE("emfp17", offsetof(struct per_proc_info *, emfp17));
304 DECLARE("emfp18", offsetof(struct per_proc_info *, emfp18));
305 DECLARE("emfp19", offsetof(struct per_proc_info *, emfp19));
306 DECLARE("emfp20", offsetof(struct per_proc_info *, emfp20));
307 DECLARE("emfp21", offsetof(struct per_proc_info *, emfp21));
308 DECLARE("emfp22", offsetof(struct per_proc_info *, emfp22));
309 DECLARE("emfp23", offsetof(struct per_proc_info *, emfp23));
310 DECLARE("emfp24", offsetof(struct per_proc_info *, emfp24));
311 DECLARE("emfp25", offsetof(struct per_proc_info *, emfp25));
312 DECLARE("emfp26", offsetof(struct per_proc_info *, emfp26));
313 DECLARE("emfp27", offsetof(struct per_proc_info *, emfp27));
314 DECLARE("emfp28", offsetof(struct per_proc_info *, emfp28));
315 DECLARE("emfp29", offsetof(struct per_proc_info *, emfp29));
316 DECLARE("emfp30", offsetof(struct per_proc_info *, emfp30));
317 DECLARE("emfp31", offsetof(struct per_proc_info *, emfp31));
318 DECLARE("emfpscr_pad", offsetof(struct per_proc_info *, emfpscr_pad));
319 DECLARE("emfpscr", offsetof(struct per_proc_info *, emfpscr));
320
321 DECLARE("emvr0", offsetof(struct per_proc_info *, emvr0));
322 DECLARE("emvr1", offsetof(struct per_proc_info *, emvr1));
323 DECLARE("emvr2", offsetof(struct per_proc_info *, emvr2));
324 DECLARE("emvr3", offsetof(struct per_proc_info *, emvr3));
325 DECLARE("emvr4", offsetof(struct per_proc_info *, emvr4));
326 DECLARE("emvr5", offsetof(struct per_proc_info *, emvr5));
327 DECLARE("emvr6", offsetof(struct per_proc_info *, emvr6));
328 DECLARE("emvr7", offsetof(struct per_proc_info *, emvr7));
329 DECLARE("emvr8", offsetof(struct per_proc_info *, emvr8));
330 DECLARE("emvr9", offsetof(struct per_proc_info *, emvr9));
331 DECLARE("emvr10", offsetof(struct per_proc_info *, emvr10));
332 DECLARE("emvr11", offsetof(struct per_proc_info *, emvr11));
333 DECLARE("emvr12", offsetof(struct per_proc_info *, emvr12));
334 DECLARE("emvr13", offsetof(struct per_proc_info *, emvr13));
335 DECLARE("emvr14", offsetof(struct per_proc_info *, emvr14));
336 DECLARE("emvr15", offsetof(struct per_proc_info *, emvr15));
337 DECLARE("emvr16", offsetof(struct per_proc_info *, emvr16));
338 DECLARE("emvr17", offsetof(struct per_proc_info *, emvr17));
339 DECLARE("emvr18", offsetof(struct per_proc_info *, emvr18));
340 DECLARE("emvr19", offsetof(struct per_proc_info *, emvr19));
341 DECLARE("emvr20", offsetof(struct per_proc_info *, emvr20));
342 DECLARE("emvr21", offsetof(struct per_proc_info *, emvr21));
343 DECLARE("emvr22", offsetof(struct per_proc_info *, emvr22));
344 DECLARE("emvr23", offsetof(struct per_proc_info *, emvr23));
345 DECLARE("emvr24", offsetof(struct per_proc_info *, emvr24));
346 DECLARE("emvr25", offsetof(struct per_proc_info *, emvr25));
347 DECLARE("emvr26", offsetof(struct per_proc_info *, emvr26));
348 DECLARE("emvr27", offsetof(struct per_proc_info *, emvr27));
349 DECLARE("emvr28", offsetof(struct per_proc_info *, emvr28));
350 DECLARE("emvr29", offsetof(struct per_proc_info *, emvr29));
351 DECLARE("emvr30", offsetof(struct per_proc_info *, emvr30));
352 DECLARE("emvr31", offsetof(struct per_proc_info *, emvr31));
353 DECLARE("empadvr", offsetof(struct per_proc_info *, empadvr));
354 DECLARE("ppSize", sizeof(struct per_proc_info));
355
356 DECLARE("RESETHANDLER_TYPE", offsetof(struct resethandler *, type));
357 DECLARE("RESETHANDLER_CALL", offsetof(struct resethandler *, call_paddr));
358 DECLARE("RESETHANDLER_ARG", offsetof(struct resethandler *, arg__paddr));
359
360 /* we want offset from
361 * bottom of kernel stack, not offset into structure
362 */
363 #define IKSBASE (u_int)STACK_IKS(0)
364
365 /* values from kern/thread.h */
366 DECLARE("THREAD_TOP_ACT",
367 offsetof(struct thread_shuttle *, top_act));
368 DECLARE("THREAD_KERNEL_STACK",
369 offsetof(struct thread_shuttle *, kernel_stack));
370 DECLARE("THREAD_CONTINUATION",
371 offsetof(struct thread_shuttle *, continuation));
372 DECLARE("THREAD_RECOVER",
373 offsetof(struct thread_shuttle *, recover));
374 #if MACH_LDEBUG
375 DECLARE("THREAD_MUTEX_COUNT",
376 offsetof(struct thread_shuttle *, mutex_count));
377 #endif /* MACH_LDEBUG */
378 DECLARE("THREAD_PSET", offsetof(struct thread_shuttle *, processor_set));
379 DECLARE("THREAD_LINKS", offsetof(struct thread_shuttle *, links));
380 DECLARE("THREAD_PSTHRN", offsetof(struct thread_shuttle *, pset_threads.next));
381
382 /* values from kern/thread_act.h */
383 DECLARE("ACT_TASK", offsetof(struct thread_activation *, task));
384 DECLARE("ACT_THREAD", offsetof(struct thread_activation *, thread));
385 DECLARE("ACT_LOWER", offsetof(struct thread_activation *, lower));
386 DECLARE("ACT_MACT_PCB",offsetof(struct thread_activation *, mact.pcb));
387 DECLARE("ACT_MACT_FPU",offsetof(struct thread_activation *, mact.FPU_pcb));
388 DECLARE("ACT_MACT_FPUlvl",offsetof(struct thread_activation *, mact.FPU_lvl));
389 DECLARE("ACT_MACT_FPUcpu",offsetof(struct thread_activation *, mact.FPU_cpu));
390 DECLARE("ACT_MACT_VMX",offsetof(struct thread_activation *, mact.VMX_pcb));
391 DECLARE("ACT_MACT_VMXlvl",offsetof(struct thread_activation *, mact.VMX_lvl));
392 DECLARE("ACT_MACT_VMXcpu",offsetof(struct thread_activation *, mact.VMX_cpu));
393 DECLARE("ACT_AST", offsetof(struct thread_activation *, ast));
394 DECLARE("ACT_VMMAP", offsetof(struct thread_activation *, map));
395 DECLARE("runningVM", runningVM);
396 DECLARE("runningVMbit", runningVMbit);
397 DECLARE("ACT_KLOADED",
398 offsetof(struct thread_activation *, kernel_loaded));
399 DECLARE("ACT_KLOADING",
400 offsetof(struct thread_activation *, kernel_loading));
401 DECLARE("ACT_MACH_EXC_PORT",
402 offsetof(struct thread_activation *,
403 exc_actions[EXC_MACH_SYSCALL].port));
404 DECLARE("vmmCEntry", offsetof(struct thread_activation *, mact.vmmCEntry));
405 DECLARE("vmmControl", offsetof(struct thread_activation *, mact.vmmControl));
406 #ifdef MACH_BSD
407 DECLARE("CTHREAD_SELF", offsetof(struct thread_activation *, mact.cthread_self));
408 #endif
409
410 /* Values from vmachmon.h */
411
412 DECLARE("kVmmGetVersion", kVmmGetVersion);
413 DECLARE("kVmmvGetFeatures", kVmmvGetFeatures);
414 DECLARE("kVmmInitContext", kVmmInitContext);
415 DECLARE("kVmmTearDownContext", kVmmTearDownContext);
416 DECLARE("kVmmTearDownAll", kVmmTearDownAll);
417 DECLARE("kVmmMapPage", kVmmMapPage);
418 DECLARE("kVmmGetPageMapping", kVmmGetPageMapping);
419 DECLARE("kVmmUnmapPage", kVmmUnmapPage);
420 DECLARE("kVmmUnmapAllPages", kVmmUnmapAllPages);
421 DECLARE("kVmmGetPageDirtyFlag", kVmmGetPageDirtyFlag);
422 DECLARE("kVmmGetFloatState", kVmmGetFloatState);
423 DECLARE("kVmmGetVectorState", kVmmGetVectorState);
424 DECLARE("kVmmSetTimer", kVmmSetTimer);
425 DECLARE("kVmmExecuteVM", kVmmExecuteVM);
426
427 DECLARE("kVmmReturnNull", kVmmReturnNull);
428 DECLARE("kVmmBogusContext", kVmmBogusContext);
429 DECLARE("kVmmReturnDataPageFault", kVmmReturnDataPageFault);
430 DECLARE("kVmmReturnInstrPageFault", kVmmReturnInstrPageFault);
431 DECLARE("kVmmReturnAlignmentFault", kVmmReturnAlignmentFault);
432 DECLARE("kVmmReturnProgramException", kVmmReturnProgramException);
433 DECLARE("kVmmReturnSystemCall", kVmmReturnSystemCall);
434 DECLARE("kVmmReturnTraceException", kVmmReturnTraceException);
435
436 DECLARE("vmmFlags", offsetof(struct vmmCntrlEntry *, vmmFlags));
437 DECLARE("vmmInUseb", vmmInUseb);
438 DECLARE("vmmInUse", vmmInUse);
439 DECLARE("vmmPmap", offsetof(struct vmmCntrlEntry *, vmmPmap));
440 DECLARE("vmmContextKern", offsetof(struct vmmCntrlEntry *, vmmContextKern));
441 DECLARE("vmmContextUser", offsetof(struct vmmCntrlEntry *, vmmContextUser));
442 DECLARE("vmmFPU_pcb", offsetof(struct vmmCntrlEntry *, vmmFPU_pcb));
443 DECLARE("vmmFPU_cpu", offsetof(struct vmmCntrlEntry *, vmmFPU_cpu));
444 DECLARE("vmmVMX_pcb", offsetof(struct vmmCntrlEntry *, vmmVMX_pcb));
445 DECLARE("vmmVMX_cpu", offsetof(struct vmmCntrlEntry *, vmmVMX_cpu));
446 DECLARE("vmmLastMap", offsetof(struct vmmCntrlEntry *, vmmLastMap));
447 DECLARE("vmmCEntrySize", sizeof(struct vmmCntrlEntry));
448 DECLARE("kVmmMaxContextsPerThread", kVmmMaxContextsPerThread);
449
450 DECLARE("interface_version", offsetof(struct vmm_state_page_t *, interface_version));
451 DECLARE("thread_index", offsetof(struct vmm_state_page_t *, thread_index));
452 DECLARE("vmmStat", offsetof(struct vmm_state_page_t *, vmmStat));
453 DECLARE("vmmCntrl", offsetof(struct vmm_state_page_t *, vmmCntrl));
454 DECLARE("return_code", offsetof(struct vmm_state_page_t *, return_code));
455 DECLARE("return_params", offsetof(struct vmm_state_page_t *, return_params));
456 DECLARE("vmm_proc_state", offsetof(struct vmm_state_page_t *, vmm_proc_state));
457 DECLARE("return_params", offsetof(struct vmm_state_page_t *, return_params));
458 DECLARE("vmmppcVRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVRs));
459 DECLARE("vmmppcVSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCR));
460 DECLARE("vmmppcFPRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPRs));
461 DECLARE("vmmppcFPSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR));
462 DECLARE("vmmFloatCngd", vmmFloatCngd);
463 DECLARE("vmmFloatCngdb", vmmFloatCngdb);
464 DECLARE("vmmVectCngd", vmmVectCngd);
465 DECLARE("vmmVectCngdb", vmmVectCngdb);
466 DECLARE("vmmTimerPop", vmmTimerPop);
467 DECLARE("vmmTimerPopb", vmmTimerPopb);
468 DECLARE("vmmMapDone", vmmMapDone);
469 DECLARE("vmmMapDoneb", vmmMapDoneb);
470 DECLARE("vmmSpfSave", vmmSpfSave);
471 DECLARE("vmmSpfSaveb", vmmSpfSaveb);
472 DECLARE("vmmFloatLoad", vmmFloatLoad);
473 DECLARE("vmmFloatLoadb", vmmFloatLoadb);
474 DECLARE("vmmVectLoad", vmmVectLoad);
475 DECLARE("vmmVectLoadb", vmmVectLoadb);
476 DECLARE("vmmVectVRall", vmmVectVRall);
477 DECLARE("vmmVectVRallb", vmmVectVRallb);
478 DECLARE("vmmVectVAss", vmmVectVAss);
479 DECLARE("vmmVectVAssb", vmmVectVAssb);
480
481 /* values from kern/task.h */
482 DECLARE("TASK_MACH_EXC_PORT",
483 offsetof(struct task *, exc_actions[EXC_MACH_SYSCALL].port));
484 DECLARE("TASK_SYSCALLS_MACH",
485 offsetof(struct task *, syscalls_mach));
486
487 /* values from vm/vm_map.h */
488 DECLARE("VMMAP_PMAP", offsetof(struct vm_map *, pmap));
489
490 /* values from machine/pmap.h */
491 DECLARE("PMAP_SPACE", offsetof(struct pmap *, space));
492 DECLARE("PMAP_BMAPS", offsetof(struct pmap *, bmaps));
493 DECLARE("PMAP_PMAPVR", offsetof(struct pmap *, pmapvr));
494 DECLARE("PMAP_VFLAGS", offsetof(struct pmap *, vflags));
495 DECLARE("PMAP_USAGE", offsetof(struct pmap *, pmapUsage));
496 DECLARE("PMAP_SEGS", offsetof(struct pmap *, pmapSegs));
497 DECLARE("PMAP_SIZE", pmapSize);
498
499
500 /* Constants from pmap.h */
501 DECLARE("PPC_SID_KERNEL", PPC_SID_KERNEL);
502
503 /* values for accessing mach_trap table */
504 DECLARE("MACH_TRAP_OFFSET_POW2", 4);
505
506 DECLARE("MACH_TRAP_ARGC",
507 offsetof(mach_trap_t *, mach_trap_arg_count));
508 DECLARE("MACH_TRAP_FUNCTION",
509 offsetof(mach_trap_t *, mach_trap_function));
510
511 DECLARE("HOST_SELF", offsetof(host_t, host_self));
512
513 DECLARE("PPCcallmax", sizeof(PPCcalls));
514
515 /* values from cpu_data.h */
516 DECLARE("CPU_ACTIVE_THREAD", offsetof(cpu_data_t *, active_thread));
517 DECLARE("CPU_PREEMPTION_LEVEL", offsetof(cpu_data_t *, preemption_level));
518 DECLARE("CPU_SIMPLE_LOCK_COUNT",
519 offsetof(cpu_data_t *, simple_lock_count));
520 DECLARE("CPU_INTERRUPT_LEVEL",offsetof(cpu_data_t *, interrupt_level));
521
522 /* Misc values used by assembler */
523 DECLARE("AST_ALL", AST_ALL);
524 DECLARE("AST_URGENT", AST_URGENT);
525
526 /* Simple Lock structure */
527 DECLARE("SLOCK_ILK", offsetof(simple_lock_t, interlock));
528 #if MACH_LDEBUG
529 DECLARE("SLOCK_TYPE", offsetof(simple_lock_t, lock_type));
530 DECLARE("SLOCK_PC", offsetof(simple_lock_t, debug.lock_pc));
531 DECLARE("SLOCK_THREAD", offsetof(simple_lock_t, debug.lock_thread));
532 DECLARE("SLOCK_DURATIONH",offsetof(simple_lock_t, debug.duration[0]));
533 DECLARE("SLOCK_DURATIONL",offsetof(simple_lock_t, debug.duration[1]));
534 DECLARE("USLOCK_TAG", USLOCK_TAG);
535 #endif /* MACH_LDEBUG */
536
537 /* Mutex structure */
538 DECLARE("MUTEX_ILK", offsetof(mutex_t *, interlock));
539 DECLARE("MUTEX_LOCKED", offsetof(mutex_t *, locked));
540 DECLARE("MUTEX_WAITERS",offsetof(mutex_t *, waiters));
541 #if MACH_LDEBUG
542 DECLARE("MUTEX_TYPE", offsetof(mutex_t *, type));
543 DECLARE("MUTEX_PC", offsetof(mutex_t *, pc));
544 DECLARE("MUTEX_THREAD", offsetof(mutex_t *, thread));
545 DECLARE("MUTEX_TAG", MUTEX_TAG);
546 #endif /* MACH_LDEBUG */
547
548 #if NCPUS > 1
549 /* values from mp/PlugIn.h */
550
551 DECLARE("MPSversionID", offsetof(struct MPPlugInSpec *, versionID));
552 DECLARE("MPSareaAddr", offsetof(struct MPPlugInSpec *, areaAddr));
553 DECLARE("MPSareaSize", offsetof(struct MPPlugInSpec *, areaSize));
554 DECLARE("MPSoffsetTableAddr", offsetof(struct MPPlugInSpec *, offsetTableAddr));
555 DECLARE("MPSbaseAddr", offsetof(struct MPPlugInSpec *, baseAddr));
556 DECLARE("MPSdataArea", offsetof(struct MPPlugInSpec *, dataArea));
557 DECLARE("MPSCPUArea", offsetof(struct MPPlugInSpec *, CPUArea));
558 DECLARE("MPSSIGPhandler", offsetof(struct MPPlugInSpec *, SIGPhandler));
559
560 DECLARE("CSAstate", offsetof(struct CPUStatusArea *, state));
561 DECLARE("CSAregsAreValid", offsetof(struct CPUStatusArea *,
562 regsAreValid));
563 DECLARE("CSAgpr", offsetof(struct CPUStatusArea *, gpr));
564 DECLARE("CSAfpr", offsetof(struct CPUStatusArea *, fpr));
565 DECLARE("CSAcr", offsetof(struct CPUStatusArea *, cr));
566 DECLARE("CSAfpscr", offsetof(struct CPUStatusArea *, fpscr));
567 DECLARE("CSAxer", offsetof(struct CPUStatusArea *, xer));
568 DECLARE("CSAlr", offsetof(struct CPUStatusArea *, lr));
569 DECLARE("CSActr", offsetof(struct CPUStatusArea *, ctr));
570 DECLARE("CSAtbu", offsetof(struct CPUStatusArea *, tbu));
571 DECLARE("CSAtbl", offsetof(struct CPUStatusArea *, tbl));
572 DECLARE("CSApvr", offsetof(struct CPUStatusArea *, pvr));
573 DECLARE("CSAibat", offsetof(struct CPUStatusArea *, ibat));
574 DECLARE("CSAdbat", offsetof(struct CPUStatusArea *, dbat));
575 DECLARE("CSAsdr1", offsetof(struct CPUStatusArea *, sdr1));
576 DECLARE("CSAsr", offsetof(struct CPUStatusArea *, sr));
577 DECLARE("CSAdar", offsetof(struct CPUStatusArea *, dar));
578 DECLARE("CSAdsisr", offsetof(struct CPUStatusArea *, dsisr));
579 DECLARE("CSAsprg", offsetof(struct CPUStatusArea *, sprg));
580 DECLARE("CSAsrr0", offsetof(struct CPUStatusArea *, srr0));
581 DECLARE("CSAsrr1", offsetof(struct CPUStatusArea *, srr1));
582 DECLARE("CSAdec", offsetof(struct CPUStatusArea *, dec));
583 DECLARE("CSAdabr", offsetof(struct CPUStatusArea *, dabr));
584 DECLARE("CSAiabr", offsetof(struct CPUStatusArea *, iabr));
585 DECLARE("CSAear", offsetof(struct CPUStatusArea *, ear));
586 DECLARE("CSAhid", offsetof(struct CPUStatusArea *, hid));
587 DECLARE("CSAmmcr", offsetof(struct CPUStatusArea *, mmcr));
588 DECLARE("CSApmc", offsetof(struct CPUStatusArea *, pmc));
589 DECLARE("CSApir", offsetof(struct CPUStatusArea *, pir));
590 DECLARE("CSAsda", offsetof(struct CPUStatusArea *, sda));
591 DECLARE("CSAsia", offsetof(struct CPUStatusArea *, sia));
592 DECLARE("CSAmq", offsetof(struct CPUStatusArea *, mq));
593 DECLARE("CSAmsr", offsetof(struct CPUStatusArea *, msr));
594 DECLARE("CSApc", offsetof(struct CPUStatusArea *, pc));
595 DECLARE("CSAsysregs", offsetof(struct CPUStatusArea *, sysregs));
596 DECLARE("CSAsize", sizeof(struct CPUStatusArea));
597
598
599 DECLARE("MPPICStat", offsetof(struct MPPInterface *, MPPICStat));
600 DECLARE("MPPICParm0", offsetof(struct MPPInterface *, MPPICParm0));
601 DECLARE("MPPICParm1", offsetof(struct MPPInterface *, MPPICParm1));
602 DECLARE("MPPICParm2", offsetof(struct MPPInterface *, MPPICParm2));
603 DECLARE("MPPICspare0", offsetof(struct MPPInterface *, MPPICspare0));
604 DECLARE("MPPICspare1", offsetof(struct MPPInterface *, MPPICspare1));
605 DECLARE("MPPICParm0BU", offsetof(struct MPPInterface *, MPPICParm0BU));
606 DECLARE("MPPICPriv", offsetof(struct MPPInterface *, MPPICPriv));
607
608
609
610 #endif /* NCPUS > 1 */
611
612 /* values from low_trace.h */
613 DECLARE("LTR_cpu", offsetof(struct LowTraceRecord *, LTR_cpu));
614 DECLARE("LTR_excpt", offsetof(struct LowTraceRecord *, LTR_excpt));
615 DECLARE("LTR_timeHi", offsetof(struct LowTraceRecord *, LTR_timeHi));
616 DECLARE("LTR_timeLo", offsetof(struct LowTraceRecord *, LTR_timeLo));
617 DECLARE("LTR_cr", offsetof(struct LowTraceRecord *, LTR_cr));
618 DECLARE("LTR_srr0", offsetof(struct LowTraceRecord *, LTR_srr0));
619 DECLARE("LTR_srr1", offsetof(struct LowTraceRecord *, LTR_srr1));
620 DECLARE("LTR_dar", offsetof(struct LowTraceRecord *, LTR_dar));
621 DECLARE("LTR_save", offsetof(struct LowTraceRecord *, LTR_save));
622 DECLARE("LTR_lr", offsetof(struct LowTraceRecord *, LTR_lr));
623 DECLARE("LTR_ctr", offsetof(struct LowTraceRecord *, LTR_ctr));
624 DECLARE("LTR_r0", offsetof(struct LowTraceRecord *, LTR_r0));
625 DECLARE("LTR_r1", offsetof(struct LowTraceRecord *, LTR_r1));
626 DECLARE("LTR_r2", offsetof(struct LowTraceRecord *, LTR_r2));
627 DECLARE("LTR_r3", offsetof(struct LowTraceRecord *, LTR_r3));
628 DECLARE("LTR_r4", offsetof(struct LowTraceRecord *, LTR_r4));
629 DECLARE("LTR_r5", offsetof(struct LowTraceRecord *, LTR_r5));
630 DECLARE("LTR_size", sizeof(struct LowTraceRecord));
631
632 /* Values from pexpert.h */
633 DECLARE("PECFIcpurate", offsetof(struct clock_frequency_info_t *, cpu_clock_rate_hz));
634 DECLARE("PECFIbusrate", offsetof(struct clock_frequency_info_t *, bus_clock_rate_hz));
635
636 /* Values from pmap_internals.h and mappings.h */
637 DECLARE("mmnext", offsetof(struct mapping *, next));
638 DECLARE("mmhashnext", offsetof(struct mapping *, hashnext));
639 DECLARE("mmPTEhash", offsetof(struct mapping *, PTEhash));
640 DECLARE("mmPTEent", offsetof(struct mapping *, PTEent));
641 DECLARE("mmPTEv", offsetof(struct mapping *, PTEv));
642 DECLARE("mmPTEr", offsetof(struct mapping *, PTEr));
643 DECLARE("mmphysent", offsetof(struct mapping *, physent));
644 DECLARE("mmpmap", offsetof(struct mapping *, pmap));
645
646 DECLARE("bmnext", offsetof(struct blokmap *, next));
647 DECLARE("bmstart", offsetof(struct blokmap *, start));
648 DECLARE("bmend", offsetof(struct blokmap *, end));
649 DECLARE("bmPTEr", offsetof(struct blokmap *, PTEr));
650 DECLARE("bmspace", offsetof(struct blokmap *, space));
651 DECLARE("blkFlags", offsetof(struct blokmap *, blkFlags));
652 DECLARE("blkPerm", blkPerm);
653 DECLARE("blkPermbit", blkPermbit);
654
655 DECLARE("mbvrswap", offsetof(struct mappingblok *, mapblokvrswap));
656 DECLARE("mbfree", offsetof(struct mappingblok *, mapblokfree));
657 DECLARE("mapcsize", sizeof(struct mappingctl));
658
659 DECLARE("pephyslink", offsetof(struct phys_entry *, phys_link));
660 DECLARE("pepte1", offsetof(struct phys_entry *, pte1));
661
662 DECLARE("PCAlock", offsetof(struct PCA *, PCAlock));
663 DECLARE("PCAallo", offsetof(struct PCA *, flgs.PCAallo));
664 DECLARE("PCAfree", offsetof(struct PCA *, flgs.PCAalflgs.PCAfree));
665 DECLARE("PCAauto", offsetof(struct PCA *, flgs.PCAalflgs.PCAauto));
666 DECLARE("PCAslck", offsetof(struct PCA *, flgs.PCAalflgs.PCAslck));
667 DECLARE("PCAsteal", offsetof(struct PCA *, flgs.PCAalflgs.PCAsteal));
668 DECLARE("PCAgas", offsetof(struct PCA *, PCAgas));
669 DECLARE("PCAhash", offsetof(struct PCA *, PCAhash));
670
671 DECLARE("SVlock", offsetof(struct Saveanchor *, savelock));
672 DECLARE("SVcount", offsetof(struct Saveanchor *, savecount));
673 DECLARE("SVinuse", offsetof(struct Saveanchor *, saveinuse));
674 DECLARE("SVmin", offsetof(struct Saveanchor *, savemin));
675 DECLARE("SVneghyst", offsetof(struct Saveanchor *, saveneghyst));
676 DECLARE("SVtarget", offsetof(struct Saveanchor *, savetarget));
677 DECLARE("SVposhyst", offsetof(struct Saveanchor *, saveposhyst));
678 DECLARE("SVfree", offsetof(struct Saveanchor *, savefree));
679 DECLARE("SVsize", sizeof(struct Saveanchor));
680
681 #if 1
682 DECLARE("GDsave", offsetof(struct GDWorkArea *, GDsave));
683 DECLARE("GDfp0", offsetof(struct GDWorkArea *, GDfp0));
684 DECLARE("GDfp1", offsetof(struct GDWorkArea *, GDfp1));
685 DECLARE("GDfp2", offsetof(struct GDWorkArea *, GDfp2));
686 DECLARE("GDfp3", offsetof(struct GDWorkArea *, GDfp3));
687 DECLARE("GDtop", offsetof(struct GDWorkArea *, GDtop));
688 DECLARE("GDleft", offsetof(struct GDWorkArea *, GDleft));
689 DECLARE("GDtopleft", offsetof(struct GDWorkArea *, GDtopleft));
690 DECLARE("GDrowbytes", offsetof(struct GDWorkArea *, GDrowbytes));
691 DECLARE("GDrowchar", offsetof(struct GDWorkArea *, GDrowchar));
692 DECLARE("GDdepth", offsetof(struct GDWorkArea *, GDdepth));
693 DECLARE("GDcollgn", offsetof(struct GDWorkArea *, GDcollgn));
694 DECLARE("GDready", offsetof(struct GDWorkArea *, GDready));
695 DECLARE("GDrowbuf1", offsetof(struct GDWorkArea *, GDrowbuf1));
696 DECLARE("GDrowbuf2", offsetof(struct GDWorkArea *, GDrowbuf2));
697 #endif
698
699 DECLARE("dgLock", offsetof(struct diagWork *, dgLock));
700 DECLARE("dgFlags", offsetof(struct diagWork *, dgFlags));
701 DECLARE("dgMisc0", offsetof(struct diagWork *, dgMisc0));
702 DECLARE("enaExpTrace", enaExpTrace);
703 DECLARE("enaExpTraceb", enaExpTraceb);
704 DECLARE("enaUsrFCall", enaUsrFCall);
705 DECLARE("enaUsrFCallb", enaUsrFCallb);
706 DECLARE("enaUsrPhyMp", enaUsrPhyMp);
707 DECLARE("enaUsrPhyMpb", enaUsrPhyMpb);
708 DECLARE("enaDiagSCs", enaDiagSCs);
709 DECLARE("enaDiagSCsb", enaDiagSCsb);
710 DECLARE("disLkType", disLkType);
711 DECLARE("disLktypeb", disLktypeb);
712 DECLARE("disLkThread", disLkThread);
713 DECLARE("disLkThreadb", disLkThreadb);
714 DECLARE("disLkNmSimp", disLkNmSimp);
715 DECLARE("disLkNmSimpb", disLkNmSimpb);
716 DECLARE("disLkMyLck", disLkMyLck);
717 DECLARE("disLkMyLckb", disLkMyLckb);
718 DECLARE("dgMisc1", offsetof(struct diagWork *, dgMisc1));
719 DECLARE("dgMisc2", offsetof(struct diagWork *, dgMisc2));
720 DECLARE("dgMisc3", offsetof(struct diagWork *, dgMisc3));
721 DECLARE("dgMisc4", offsetof(struct diagWork *, dgMisc4));
722 DECLARE("dgMisc5", offsetof(struct diagWork *, dgMisc5));
723
724 DECLARE("traceMask", offsetof(struct traceWork *, traceMask));
725 DECLARE("traceCurr", offsetof(struct traceWork *, traceCurr));
726 DECLARE("traceStart", offsetof(struct traceWork *, traceStart));
727 DECLARE("traceEnd", offsetof(struct traceWork *, traceEnd));
728 DECLARE("traceMsnd", offsetof(struct traceWork *, traceMsnd));
729
730 DECLARE("SACsize", sizeof(struct savectl));
731 DECLARE("SACspot", 4096-sizeof(struct savectl));
732 DECLARE("SACnext", offsetof(struct savectl *, sac_next)+4096-sizeof(struct savectl));
733 DECLARE("SACvrswap", offsetof(struct savectl *, sac_vrswap)+4096-sizeof(struct savectl));
734 DECLARE("SACalloc", offsetof(struct savectl *, sac_alloc)+4096-sizeof(struct savectl));
735 DECLARE("SACflags", offsetof(struct savectl *, sac_flags)+4096-sizeof(struct savectl));
736
737 DECLARE("SAVprev", offsetof(struct savearea *, save_prev));
738 DECLARE("SAVprefp", offsetof(struct savearea *, save_prev_float));
739 DECLARE("SAVprevec", offsetof(struct savearea *, save_prev_vector));
740 DECLARE("SAVphys", offsetof(struct savearea *, save_phys));
741 DECLARE("SAVqfret", offsetof(struct savearea *, save_qfret));
742 DECLARE("SAVact", offsetof(struct savearea *, save_act));
743 DECLARE("SAVflags", offsetof(struct savearea *, save_flags));
744 DECLARE("SAVlvlfp", offsetof(struct savearea *, save_level_fp));
745 DECLARE("SAVlvlvec", offsetof(struct savearea *, save_level_vec));
746 DECLARE("SAVsize", sizeof(struct savearea));
747
748 DECLARE("savesrr0", offsetof(struct savearea *, save_srr0));
749 DECLARE("savesrr1", offsetof(struct savearea *, save_srr1));
750 DECLARE("savecr", offsetof(struct savearea *, save_cr));
751 DECLARE("savexer", offsetof(struct savearea *, save_xer));
752 DECLARE("savelr", offsetof(struct savearea *, save_lr));
753 DECLARE("savectr", offsetof(struct savearea *, save_ctr));
754 DECLARE("savemq", offsetof(struct savearea *, save_mq));
755 DECLARE("savecopyin", offsetof(struct savearea *, save_sr_copyin));
756 DECLARE("savedar", offsetof(struct savearea *, save_dar));
757 DECLARE("savedsisr", offsetof(struct savearea *, save_dsisr));
758 DECLARE("saveexception", offsetof(struct savearea *, save_exception));
759 DECLARE("savexfpscrpad", offsetof(struct savearea *, save_xfpscrpad));
760 DECLARE("savexfpscr", offsetof(struct savearea *, save_xfpscr));
761 DECLARE("savevrsave", offsetof(struct savearea *, save_vrsave));
762
763 DECLARE("saver0", offsetof(struct savearea *, save_r0));
764 DECLARE("saver1", offsetof(struct savearea *, save_r1));
765 DECLARE("saver2", offsetof(struct savearea *, save_r2));
766 DECLARE("saver3", offsetof(struct savearea *, save_r3));
767 DECLARE("saver4", offsetof(struct savearea *, save_r4));
768 DECLARE("saver5", offsetof(struct savearea *, save_r5));
769 DECLARE("saver6", offsetof(struct savearea *, save_r6));
770 DECLARE("saver7", offsetof(struct savearea *, save_r7));
771 DECLARE("saver8", offsetof(struct savearea *, save_r8));
772 DECLARE("saver9", offsetof(struct savearea *, save_r9));
773 DECLARE("saver10", offsetof(struct savearea *, save_r10));
774 DECLARE("saver11", offsetof(struct savearea *, save_r11));
775 DECLARE("saver12", offsetof(struct savearea *, save_r12));
776 DECLARE("saver13", offsetof(struct savearea *, save_r13));
777 DECLARE("saver14", offsetof(struct savearea *, save_r14));
778 DECLARE("saver15", offsetof(struct savearea *, save_r15));
779 DECLARE("saver16", offsetof(struct savearea *, save_r16));
780 DECLARE("saver17", offsetof(struct savearea *, save_r17));
781 DECLARE("saver18", offsetof(struct savearea *, save_r18));
782 DECLARE("saver19", offsetof(struct savearea *, save_r19));
783 DECLARE("saver20", offsetof(struct savearea *, save_r20));
784 DECLARE("saver21", offsetof(struct savearea *, save_r21));
785 DECLARE("saver22", offsetof(struct savearea *, save_r22));
786 DECLARE("saver23", offsetof(struct savearea *, save_r23));
787 DECLARE("saver24", offsetof(struct savearea *, save_r24));
788 DECLARE("saver25", offsetof(struct savearea *, save_r25));
789 DECLARE("saver26", offsetof(struct savearea *, save_r26));
790 DECLARE("saver27", offsetof(struct savearea *, save_r27));
791 DECLARE("saver28", offsetof(struct savearea *, save_r28));
792 DECLARE("saver29", offsetof(struct savearea *, save_r29));
793 DECLARE("saver30", offsetof(struct savearea *, save_r30));
794 DECLARE("saver31", offsetof(struct savearea *, save_r31));
795
796 DECLARE("savefp0", offsetof(struct savearea *, save_fp0));
797 DECLARE("savefp1", offsetof(struct savearea *, save_fp1));
798 DECLARE("savefp2", offsetof(struct savearea *, save_fp2));
799 DECLARE("savefp3", offsetof(struct savearea *, save_fp3));
800 DECLARE("savefp4", offsetof(struct savearea *, save_fp4));
801 DECLARE("savefp5", offsetof(struct savearea *, save_fp5));
802 DECLARE("savefp6", offsetof(struct savearea *, save_fp6));
803 DECLARE("savefp7", offsetof(struct savearea *, save_fp7));
804 DECLARE("savefp8", offsetof(struct savearea *, save_fp8));
805 DECLARE("savefp9", offsetof(struct savearea *, save_fp9));
806 DECLARE("savefp10", offsetof(struct savearea *, save_fp10));
807 DECLARE("savefp11", offsetof(struct savearea *, save_fp11));
808 DECLARE("savefp12", offsetof(struct savearea *, save_fp12));
809 DECLARE("savefp13", offsetof(struct savearea *, save_fp13));
810 DECLARE("savefp14", offsetof(struct savearea *, save_fp14));
811 DECLARE("savefp15", offsetof(struct savearea *, save_fp15));
812 DECLARE("savefp16", offsetof(struct savearea *, save_fp16));
813 DECLARE("savefp17", offsetof(struct savearea *, save_fp17));
814 DECLARE("savefp18", offsetof(struct savearea *, save_fp18));
815 DECLARE("savefp19", offsetof(struct savearea *, save_fp19));
816 DECLARE("savefp20", offsetof(struct savearea *, save_fp20));
817 DECLARE("savefp21", offsetof(struct savearea *, save_fp21));
818 DECLARE("savefp22", offsetof(struct savearea *, save_fp22));
819 DECLARE("savefp23", offsetof(struct savearea *, save_fp23));
820 DECLARE("savefp24", offsetof(struct savearea *, save_fp24));
821 DECLARE("savefp25", offsetof(struct savearea *, save_fp25));
822 DECLARE("savefp26", offsetof(struct savearea *, save_fp26));
823 DECLARE("savefp27", offsetof(struct savearea *, save_fp27));
824 DECLARE("savefp28", offsetof(struct savearea *, save_fp28));
825 DECLARE("savefp29", offsetof(struct savearea *, save_fp29));
826 DECLARE("savefp30", offsetof(struct savearea *, save_fp30));
827 DECLARE("savefp31", offsetof(struct savearea *, save_fp31));
828 DECLARE("savefpscrpad", offsetof(struct savearea *, save_fpscr_pad));
829 DECLARE("savefpscr", offsetof(struct savearea *, save_fpscr));
830
831 DECLARE("savesr0", offsetof(struct savearea *, save_sr0));
832 DECLARE("savesr1", offsetof(struct savearea *, save_sr1));
833 DECLARE("savesr2", offsetof(struct savearea *, save_sr2));
834 DECLARE("savesr3", offsetof(struct savearea *, save_sr3));
835 DECLARE("savesr4", offsetof(struct savearea *, save_sr4));
836 DECLARE("savesr5", offsetof(struct savearea *, save_sr5));
837 DECLARE("savesr6", offsetof(struct savearea *, save_sr6));
838 DECLARE("savesr7", offsetof(struct savearea *, save_sr7));
839 DECLARE("savesr8", offsetof(struct savearea *, save_sr8));
840 DECLARE("savesr9", offsetof(struct savearea *, save_sr9));
841 DECLARE("savesr10", offsetof(struct savearea *, save_sr10));
842 DECLARE("savesr11", offsetof(struct savearea *, save_sr11));
843 DECLARE("savesr12", offsetof(struct savearea *, save_sr12));
844 DECLARE("savesr13", offsetof(struct savearea *, save_sr13));
845 DECLARE("savesr14", offsetof(struct savearea *, save_sr14));
846 DECLARE("savesr15", offsetof(struct savearea *, save_sr15));
847
848 DECLARE("savevr0", offsetof(struct savearea *, save_vr0));
849 DECLARE("savevr1", offsetof(struct savearea *, save_vr1));
850 DECLARE("savevr2", offsetof(struct savearea *, save_vr2));
851 DECLARE("savevr3", offsetof(struct savearea *, save_vr3));
852 DECLARE("savevr4", offsetof(struct savearea *, save_vr4));
853 DECLARE("savevr5", offsetof(struct savearea *, save_vr5));
854 DECLARE("savevr6", offsetof(struct savearea *, save_vr6));
855 DECLARE("savevr7", offsetof(struct savearea *, save_vr7));
856 DECLARE("savevr8", offsetof(struct savearea *, save_vr8));
857 DECLARE("savevr9", offsetof(struct savearea *, save_vr9));
858 DECLARE("savevr10", offsetof(struct savearea *, save_vr10));
859 DECLARE("savevr11", offsetof(struct savearea *, save_vr11));
860 DECLARE("savevr12", offsetof(struct savearea *, save_vr12));
861 DECLARE("savevr13", offsetof(struct savearea *, save_vr13));
862 DECLARE("savevr14", offsetof(struct savearea *, save_vr14));
863 DECLARE("savevr15", offsetof(struct savearea *, save_vr15));
864 DECLARE("savevr16", offsetof(struct savearea *, save_vr16));
865 DECLARE("savevr17", offsetof(struct savearea *, save_vr17));
866 DECLARE("savevr18", offsetof(struct savearea *, save_vr18));
867 DECLARE("savevr19", offsetof(struct savearea *, save_vr19));
868 DECLARE("savevr20", offsetof(struct savearea *, save_vr20));
869 DECLARE("savevr21", offsetof(struct savearea *, save_vr21));
870 DECLARE("savevr22", offsetof(struct savearea *, save_vr22));
871 DECLARE("savevr23", offsetof(struct savearea *, save_vr23));
872 DECLARE("savevr24", offsetof(struct savearea *, save_vr24));
873 DECLARE("savevr25", offsetof(struct savearea *, save_vr25));
874 DECLARE("savevr26", offsetof(struct savearea *, save_vr26));
875 DECLARE("savevr27", offsetof(struct savearea *, save_vr27));
876 DECLARE("savevr28", offsetof(struct savearea *, save_vr28));
877 DECLARE("savevr29", offsetof(struct savearea *, save_vr29));
878 DECLARE("savevr30", offsetof(struct savearea *, save_vr30));
879 DECLARE("savevr31", offsetof(struct savearea *, save_vr31));
880 DECLARE("savevscr", offsetof(struct savearea *, save_vscr));
881 DECLARE("savevrvalid", offsetof(struct savearea *, save_vrvalid));
882
883 /* PseudoKernel Exception Descriptor info */
884 DECLARE("BEDA_SRR0", offsetof(BEDA_t *, srr0));
885 DECLARE("BEDA_SRR1", offsetof(BEDA_t *, srr1));
886 DECLARE("BEDA_SPRG0", offsetof(BEDA_t *, sprg0));
887 DECLARE("BEDA_SPRG1", offsetof(BEDA_t *, sprg1));
888
889 /* PseudoKernel Interrupt Control Word */
890 DECLARE("BTTD_INTCONTROLWORD", offsetof(BTTD_t *, InterruptControlWord));
891
892 /* New state when exiting the pseudokernel */
893 DECLARE("BTTD_NEWEXITSTATE", offsetof(BTTD_t *, NewExitState));
894
895 /* PseudoKernel Test/Post Interrupt */
896 DECLARE("BTTD_TESTINTMASK", offsetof(BTTD_t *, testIntMask));
897 DECLARE("BTTD_POSTINTMASK", offsetof(BTTD_t *, postIntMask));
898
899 /* PseudoKernel Vectors */
900 DECLARE("BTTD_TRAP_VECTOR", offsetof(BTTD_t *, TrapVector));
901 DECLARE("BTTD_SYSCALL_VECTOR", offsetof(BTTD_t *, SysCallVector));
902 DECLARE("BTTD_INTERRUPT_VECTOR", offsetof(BTTD_t *, InterruptVector));
903 DECLARE("BTTD_PENDINGINT_VECTOR", offsetof(BTTD_t *, PendingIntVector));
904
905 /* PseudoKernel Bits, Masks and misc */
906 DECLARE("SYSCONTEXTSTATE", kInSystemContext);
907 DECLARE("PSEUDOKERNELSTATE", kInPseudoKernel);
908 DECLARE("INTSTATEMASK_B", 12);
909 DECLARE("INTSTATEMASK_E", 15);
910 DECLARE("INTCR2MASK_B", 8);
911 DECLARE("INTCR2MASK_E", 11);
912 DECLARE("INTBACKUPCR2MASK_B", 28);
913 DECLARE("INTBACKUPCR2MASK_E", 31);
914 DECLARE("INTCR2TOBACKUPSHIFT", kCR2ToBackupShift);
915 DECLARE("BB_MAX_TRAP", bbMaxTrap);
916 DECLARE("BB_RFI_TRAP", bbRFITrap);
917
918 /* Various hackery */
919 DECLARE("procState", offsetof(struct processor *, state));
920
921 DECLARE("CPU_SUBTYPE_POWERPC_ALL", CPU_SUBTYPE_POWERPC_ALL);
922 DECLARE("CPU_SUBTYPE_POWERPC_601", CPU_SUBTYPE_POWERPC_601);
923 DECLARE("CPU_SUBTYPE_POWERPC_602", CPU_SUBTYPE_POWERPC_602);
924 DECLARE("CPU_SUBTYPE_POWERPC_603", CPU_SUBTYPE_POWERPC_603);
925 DECLARE("CPU_SUBTYPE_POWERPC_603e", CPU_SUBTYPE_POWERPC_603e);
926 DECLARE("CPU_SUBTYPE_POWERPC_603ev", CPU_SUBTYPE_POWERPC_603ev);
927 DECLARE("CPU_SUBTYPE_POWERPC_604", CPU_SUBTYPE_POWERPC_604);
928 DECLARE("CPU_SUBTYPE_POWERPC_604e", CPU_SUBTYPE_POWERPC_604e);
929 DECLARE("CPU_SUBTYPE_POWERPC_620", CPU_SUBTYPE_POWERPC_620);
930 DECLARE("CPU_SUBTYPE_POWERPC_750", CPU_SUBTYPE_POWERPC_750);
931 DECLARE("CPU_SUBTYPE_POWERPC_7400", CPU_SUBTYPE_POWERPC_7400);
932 DECLARE("CPU_SUBTYPE_POWERPC_7450", CPU_SUBTYPE_POWERPC_7450);
933
934
935 return(0); /* For ANSI C :-) */
936
937
938
939 }