]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ppc/genassym.c
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / ppc / genassym.c
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
de355530
A
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.
1c79356b 11 *
de355530
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
de355530
A
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.
1c79356b
A
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>
de355530 63#include <ppc/pmap_internals.h>
1c79356b 64#include <ppc/Diagnostics.h>
de355530 65#include <ppc/POWERMAC/mp/MPPlugIn.h>
1c79356b
A
66#include <pexpert/pexpert.h>
67#include <mach/machine.h>
68#include <ppc/vmachmon.h>
69#include <ppc/PPCcalls.h>
d52fe63f 70#include <ppc/mem.h>
1c79356b
A
71
72#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE)0)->MEMBER)
73
74#define DECLARE(SYM,VAL) \
75 __asm("#DEFINITION##define\t" SYM "\t%0" : : "n" ((u_int)(VAL)))
76
77int main(int argc, char *argv[])
78{
79 /* Process Control Block */
80
1c79356b
A
81 DECLARE("ACT_MACT_KSP", offsetof(struct thread_activation *, mact.ksp));
82 DECLARE("ACT_MACT_BEDA", offsetof(struct thread_activation *, mact.bbDescAddr));
83 DECLARE("ACT_MACT_BTS", offsetof(struct thread_activation *, mact.bbTableStart));
84 DECLARE("ACT_MACT_BTE", offsetof(struct thread_activation *, mact.bbTaskEnv));
85 DECLARE("ACT_MACT_SPF", offsetof(struct thread_activation *, mact.specFlags));
86 DECLARE("qactTimer", offsetof(struct thread_activation *, mact.qactTimer));
9bccf70c 87
1c79356b
A
88 DECLARE("floatUsed", floatUsed);
89 DECLARE("vectorUsed", vectorUsed);
1c79356b 90 DECLARE("runningVM", runningVM);
9bccf70c 91 DECLARE("runningVMbit", runningVMbit);
1c79356b 92 DECLARE("floatCng", floatCng);
1c79356b 93 DECLARE("floatCngbit", floatCngbit);
9bccf70c 94 DECLARE("vectorCng", vectorCng);
1c79356b 95 DECLARE("vectorCngbit", vectorCngbit);
9bccf70c
A
96 DECLARE("userProtKey", userProtKey);
97 DECLARE("userProtKeybit", userProtKeybit);
de355530
A
98 DECLARE("trapUnalign", trapUnalign);
99 DECLARE("trapUnalignbit", trapUnalignbit);
100 DECLARE("notifyUnalign", notifyUnalign);
101 DECLARE("notifyUnalignbit", notifyUnalignbit);
9bccf70c 102
0b4e3aa0 103 DECLARE("bbThread", bbThread);
9bccf70c
A
104 DECLARE("bbThreadbit", bbThreadbit);
105 DECLARE("bbNoMachSCbit",bbNoMachSCbit);
0b4e3aa0 106 DECLARE("bbPreemptive", bbPreemptive);
9bccf70c
A
107 DECLARE("bbPreemptivebit", bbPreemptivebit);
108
0b4e3aa0
A
109 DECLARE("fvChkb", fvChkb);
110 DECLARE("fvChk", fvChk);
d7e50217
A
111 DECLARE("FamVMena", FamVMena);
112 DECLARE("FamVMenabit", FamVMenabit);
113 DECLARE("FamVMmode", FamVMmode);
114 DECLARE("FamVMmodebit", FamVMmodebit);
1c79356b
A
115
116 /* Per Proc info structure */
117 DECLARE("PP_CPU_NUMBER", offsetof(struct per_proc_info *, cpu_number));
118 DECLARE("PP_CPU_FLAGS", offsetof(struct per_proc_info *, cpu_flags));
119 DECLARE("PP_ISTACKPTR", offsetof(struct per_proc_info *, istackptr));
120 DECLARE("PP_INTSTACK_TOP_SS", offsetof(struct per_proc_info *, intstack_top_ss));
1c79356b
A
121 DECLARE("PP_DEBSTACKPTR", offsetof(struct per_proc_info *, debstackptr));
122 DECLARE("PP_DEBSTACK_TOP_SS", offsetof(struct per_proc_info *, debstack_top_ss));
de355530
A
123 DECLARE("PP_TEMPWORK1", offsetof(struct per_proc_info *, tempwork1));
124 DECLARE("PP_USERSPACE", offsetof(struct per_proc_info *, userspace));
125 DECLARE("PP_USERPMAP", offsetof(struct per_proc_info *, userpmap));
126 DECLARE("PP_LASTPMAP", offsetof(struct per_proc_info *, Lastpmap));
9bccf70c
A
127 DECLARE("FPUowner", offsetof(struct per_proc_info *, FPU_owner));
128 DECLARE("VMXowner", offsetof(struct per_proc_info *, VMX_owner));
1c79356b 129
de355530 130 DECLARE("PP_SAVE_EXCEPTION_TYPE", offsetof(struct per_proc_info *, save_exception_type));
1c79356b
A
131 DECLARE("PP_ACTIVE_KLOADED", offsetof(struct per_proc_info *, active_kloaded));
132 DECLARE("PP_ACTIVE_STACKS", offsetof(struct per_proc_info *, active_stacks));
133 DECLARE("PP_NEED_AST", offsetof(struct per_proc_info *, need_ast));
9bccf70c
A
134 DECLARE("quickfret", offsetof(struct per_proc_info *, quickfret));
135 DECLARE("lclfree", offsetof(struct per_proc_info *, lclfree));
136 DECLARE("lclfreecnt", offsetof(struct per_proc_info *, lclfreecnt));
0b4e3aa0 137 DECLARE("PP_INTS_ENABLED", offsetof(struct per_proc_info *, interrupts_enabled));
1c79356b 138 DECLARE("UAW", offsetof(struct per_proc_info *, Uassist));
de355530
A
139 DECLARE("VMMareaPhys", offsetof(struct per_proc_info *, VMMareaPhys));
140 DECLARE("FAMintercept", offsetof(struct per_proc_info *, FAMintercept));
d7e50217 141 DECLARE("next_savearea", offsetof(struct per_proc_info *, next_savearea));
9bccf70c 142 DECLARE("PP_ACTIVE_THREAD", offsetof(struct per_proc_info *, pp_active_thread));
de355530 143 DECLARE("PP_PREEMPT_CNT", offsetof(struct per_proc_info *, pp_preemption_count));
9bccf70c
A
144 DECLARE("PP_SIMPLE_LOCK_CNT", offsetof(struct per_proc_info *, pp_simple_lock_count));
145 DECLARE("PP_INTERRUPT_LVL", offsetof(struct per_proc_info *, pp_interrupt_level));
0b4e3aa0 146 DECLARE("ppbbTaskEnv", offsetof(struct per_proc_info *, ppbbTaskEnv));
1c79356b 147 DECLARE("liveVRS", offsetof(struct per_proc_info *, liveVRSave));
1c79356b
A
148 DECLARE("spcFlags", offsetof(struct per_proc_info *, spcFlags));
149 DECLARE("spcTRc", offsetof(struct per_proc_info *, spcTRc));
150 DECLARE("spcTRp", offsetof(struct per_proc_info *, spcTRp));
151 DECLARE("ruptStamp", offsetof(struct per_proc_info *, ruptStamp));
152 DECLARE("pfAvailable", offsetof(struct per_proc_info *, pf.Available));
153 DECLARE("pfFloat", pfFloat);
154 DECLARE("pfFloatb", pfFloatb);
155 DECLARE("pfAltivec", pfAltivec);
156 DECLARE("pfAltivecb", pfAltivecb);
157 DECLARE("pfAvJava", pfAvJava);
158 DECLARE("pfAvJavab", pfAvJavab);
159 DECLARE("pfSMPcap", pfSMPcap);
160 DECLARE("pfSMPcapb", pfSMPcapb);
161 DECLARE("pfCanSleep", pfCanSleep);
162 DECLARE("pfCanSleepb", pfCanSleepb);
163 DECLARE("pfCanNap", pfCanNap);
164 DECLARE("pfCanNapb", pfCanNapb);
165 DECLARE("pfCanDoze", pfCanDoze);
166 DECLARE("pfCanDozeb", pfCanDozeb);
de355530
A
167 DECLARE("pfCanDoze", pfCanDoze);
168 DECLARE("pfCanDozeb", pfCanDozeb);
1c79356b
A
169 DECLARE("pfThermal", pfThermal);
170 DECLARE("pfThermalb", pfThermalb);
171 DECLARE("pfThermInt", pfThermInt);
172 DECLARE("pfThermIntb", pfThermIntb);
de355530
A
173 DECLARE("pfWillNap", pfWillNap);
174 DECLARE("pfWillNapb", pfWillNapb);
175 DECLARE("pfNoMSRir", pfNoMSRir);
176 DECLARE("pfNoMSRirb", pfNoMSRirb);
177 DECLARE("pfNoL2PFNap", pfNoL2PFNap);
178 DECLARE("pfNoL2PFNapb", pfNoL2PFNapb);
d52fe63f
A
179 DECLARE("pfSlowNap", pfSlowNap);
180 DECLARE("pfSlowNapb", pfSlowNapb);
181 DECLARE("pfNoMuMMCK", pfNoMuMMCK);
182 DECLARE("pfNoMuMMCKb", pfNoMuMMCKb);
de355530
A
183 DECLARE("pfLClck", pfLClck);
184 DECLARE("pfLClckb", pfLClckb);
185 DECLARE("pfL3pdet", pfL3pdet);
186 DECLARE("pfL3pdetb", pfL3pdetb);
187 DECLARE("pfL1i", pfL1i);
188 DECLARE("pfL1ib", pfL1ib);
189 DECLARE("pfL1d", pfL1d);
190 DECLARE("pfL1db", pfL1db);
1c79356b
A
191 DECLARE("pfL1fa", pfL1fa);
192 DECLARE("pfL1fab", pfL1fab);
193 DECLARE("pfL2", pfL2);
194 DECLARE("pfL2b", pfL2b);
195 DECLARE("pfL2fa", pfL2fa);
196 DECLARE("pfL2fab", pfL2fab);
197 DECLARE("pfL2i", pfL2i);
198 DECLARE("pfL2ib", pfL2ib);
199 DECLARE("pfL3", pfL3);
200 DECLARE("pfL3b", pfL3b);
201 DECLARE("pfL3fa", pfL3fa);
202 DECLARE("pfL3fab", pfL3fab);
203 DECLARE("pfValid", pfValid);
204 DECLARE("pfValidb", pfValidb);
205 DECLARE("pfrptdProc", offsetof(struct per_proc_info *, pf.rptdProc));
206 DECLARE("pflineSize", offsetof(struct per_proc_info *, pf.lineSize));
207 DECLARE("pfl1iSize", offsetof(struct per_proc_info *, pf.l1iSize));
208 DECLARE("pfl1dSize", offsetof(struct per_proc_info *, pf.l1dSize));
209 DECLARE("pfl2cr", offsetof(struct per_proc_info *, pf.l2cr));
210 DECLARE("pfl2Size", offsetof(struct per_proc_info *, pf.l2Size));
211 DECLARE("pfl3cr", offsetof(struct per_proc_info *, pf.l3cr));
212 DECLARE("pfl3Size", offsetof(struct per_proc_info *, pf.l3Size));
213 DECLARE("pfHID0", offsetof(struct per_proc_info *, pf.pfHID0));
214 DECLARE("pfHID1", offsetof(struct per_proc_info *, pf.pfHID1));
215 DECLARE("pfHID2", offsetof(struct per_proc_info *, pf.pfHID2));
216 DECLARE("pfHID3", offsetof(struct per_proc_info *, pf.pfHID3));
217 DECLARE("pfMSSCR0", offsetof(struct per_proc_info *, pf.pfMSSCR0));
218 DECLARE("pfMSSCR1", offsetof(struct per_proc_info *, pf.pfMSSCR1));
9bccf70c 219 DECLARE("pfICTRL", offsetof(struct per_proc_info *, pf.pfICTRL));
1c79356b 220 DECLARE("pfLDSTCR", offsetof(struct per_proc_info *, pf.pfLDSTCR));
0b4e3aa0 221 DECLARE("pfLDSTDB", offsetof(struct per_proc_info *, pf.pfLDSTDB));
d52fe63f
A
222 DECLARE("pfl2crOriginal", offsetof(struct per_proc_info *, pf.l2crOriginal));
223 DECLARE("pfl3crOriginal", offsetof(struct per_proc_info *, pf.l3crOriginal));
9bccf70c 224 DECLARE("pfBootConfig", offsetof(struct per_proc_info *, pf.pfBootConfig));
1c79356b
A
225 DECLARE("pfSize", sizeof(procFeatures));
226
227 DECLARE("thrmmaxTemp", offsetof(struct per_proc_info *, thrm.maxTemp));
228 DECLARE("thrmthrottleTemp", offsetof(struct per_proc_info *, thrm.throttleTemp));
229 DECLARE("thrmlowTemp", offsetof(struct per_proc_info *, thrm.lowTemp));
230 DECLARE("thrmhighTemp", offsetof(struct per_proc_info *, thrm.highTemp));
231 DECLARE("thrm3val", offsetof(struct per_proc_info *, thrm.thrm3val));
232 DECLARE("thrmSize", sizeof(thrmControl));
233
de355530
A
234 DECLARE("napStamp", offsetof(struct per_proc_info *, napStamp));
235 DECLARE("napTotal", offsetof(struct per_proc_info *, napTotal));
1c79356b
A
236
237 DECLARE("emfp0", offsetof(struct per_proc_info *, emfp0));
238 DECLARE("emfp1", offsetof(struct per_proc_info *, emfp1));
239 DECLARE("emfp2", offsetof(struct per_proc_info *, emfp2));
240 DECLARE("emfp3", offsetof(struct per_proc_info *, emfp3));
241 DECLARE("emfp4", offsetof(struct per_proc_info *, emfp4));
242 DECLARE("emfp5", offsetof(struct per_proc_info *, emfp5));
243 DECLARE("emfp6", offsetof(struct per_proc_info *, emfp6));
244 DECLARE("emfp7", offsetof(struct per_proc_info *, emfp7));
245 DECLARE("emfp8", offsetof(struct per_proc_info *, emfp8));
246 DECLARE("emfp9", offsetof(struct per_proc_info *, emfp9));
247 DECLARE("emfp10", offsetof(struct per_proc_info *, emfp10));
248 DECLARE("emfp11", offsetof(struct per_proc_info *, emfp11));
249 DECLARE("emfp12", offsetof(struct per_proc_info *, emfp12));
250 DECLARE("emfp13", offsetof(struct per_proc_info *, emfp13));
251 DECLARE("emfp14", offsetof(struct per_proc_info *, emfp14));
252 DECLARE("emfp15", offsetof(struct per_proc_info *, emfp15));
253 DECLARE("emfp16", offsetof(struct per_proc_info *, emfp16));
254 DECLARE("emfp17", offsetof(struct per_proc_info *, emfp17));
255 DECLARE("emfp18", offsetof(struct per_proc_info *, emfp18));
256 DECLARE("emfp19", offsetof(struct per_proc_info *, emfp19));
257 DECLARE("emfp20", offsetof(struct per_proc_info *, emfp20));
258 DECLARE("emfp21", offsetof(struct per_proc_info *, emfp21));
259 DECLARE("emfp22", offsetof(struct per_proc_info *, emfp22));
260 DECLARE("emfp23", offsetof(struct per_proc_info *, emfp23));
261 DECLARE("emfp24", offsetof(struct per_proc_info *, emfp24));
262 DECLARE("emfp25", offsetof(struct per_proc_info *, emfp25));
263 DECLARE("emfp26", offsetof(struct per_proc_info *, emfp26));
264 DECLARE("emfp27", offsetof(struct per_proc_info *, emfp27));
265 DECLARE("emfp28", offsetof(struct per_proc_info *, emfp28));
266 DECLARE("emfp29", offsetof(struct per_proc_info *, emfp29));
267 DECLARE("emfp30", offsetof(struct per_proc_info *, emfp30));
268 DECLARE("emfp31", offsetof(struct per_proc_info *, emfp31));
269 DECLARE("emfpscr_pad", offsetof(struct per_proc_info *, emfpscr_pad));
270 DECLARE("emfpscr", offsetof(struct per_proc_info *, emfpscr));
271
272 DECLARE("emvr0", offsetof(struct per_proc_info *, emvr0));
273 DECLARE("emvr1", offsetof(struct per_proc_info *, emvr1));
274 DECLARE("emvr2", offsetof(struct per_proc_info *, emvr2));
275 DECLARE("emvr3", offsetof(struct per_proc_info *, emvr3));
276 DECLARE("emvr4", offsetof(struct per_proc_info *, emvr4));
277 DECLARE("emvr5", offsetof(struct per_proc_info *, emvr5));
278 DECLARE("emvr6", offsetof(struct per_proc_info *, emvr6));
279 DECLARE("emvr7", offsetof(struct per_proc_info *, emvr7));
280 DECLARE("emvr8", offsetof(struct per_proc_info *, emvr8));
281 DECLARE("emvr9", offsetof(struct per_proc_info *, emvr9));
282 DECLARE("emvr10", offsetof(struct per_proc_info *, emvr10));
283 DECLARE("emvr11", offsetof(struct per_proc_info *, emvr11));
284 DECLARE("emvr12", offsetof(struct per_proc_info *, emvr12));
285 DECLARE("emvr13", offsetof(struct per_proc_info *, emvr13));
286 DECLARE("emvr14", offsetof(struct per_proc_info *, emvr14));
287 DECLARE("emvr15", offsetof(struct per_proc_info *, emvr15));
288 DECLARE("emvr16", offsetof(struct per_proc_info *, emvr16));
289 DECLARE("emvr17", offsetof(struct per_proc_info *, emvr17));
290 DECLARE("emvr18", offsetof(struct per_proc_info *, emvr18));
291 DECLARE("emvr19", offsetof(struct per_proc_info *, emvr19));
292 DECLARE("emvr20", offsetof(struct per_proc_info *, emvr20));
293 DECLARE("emvr21", offsetof(struct per_proc_info *, emvr21));
294 DECLARE("emvr22", offsetof(struct per_proc_info *, emvr22));
295 DECLARE("emvr23", offsetof(struct per_proc_info *, emvr23));
296 DECLARE("emvr24", offsetof(struct per_proc_info *, emvr24));
297 DECLARE("emvr25", offsetof(struct per_proc_info *, emvr25));
298 DECLARE("emvr26", offsetof(struct per_proc_info *, emvr26));
299 DECLARE("emvr27", offsetof(struct per_proc_info *, emvr27));
300 DECLARE("emvr28", offsetof(struct per_proc_info *, emvr28));
301 DECLARE("emvr29", offsetof(struct per_proc_info *, emvr29));
302 DECLARE("emvr30", offsetof(struct per_proc_info *, emvr30));
303 DECLARE("emvr31", offsetof(struct per_proc_info *, emvr31));
304 DECLARE("empadvr", offsetof(struct per_proc_info *, empadvr));
305 DECLARE("ppSize", sizeof(struct per_proc_info));
0b4e3aa0 306 DECLARE("patcharea", offsetof(struct per_proc_info *, patcharea));
1c79356b 307
9bccf70c
A
308 DECLARE("RESETHANDLER_TYPE", offsetof(struct resethandler *, type));
309 DECLARE("RESETHANDLER_CALL", offsetof(struct resethandler *, call_paddr));
310 DECLARE("RESETHANDLER_ARG", offsetof(struct resethandler *, arg__paddr));
1c79356b
A
311
312 /* we want offset from
313 * bottom of kernel stack, not offset into structure
314 */
315#define IKSBASE (u_int)STACK_IKS(0)
316
317 /* values from kern/thread.h */
9bccf70c
A
318 DECLARE("THREAD_TOP_ACT", offsetof(struct thread_shuttle *, top_act));
319 DECLARE("THREAD_KERNEL_STACK", offsetof(struct thread_shuttle *, kernel_stack));
320 DECLARE("THREAD_CONTINUATION", offsetof(struct thread_shuttle *, continuation));
321 DECLARE("THREAD_RECOVER", offsetof(struct thread_shuttle *, recover));
322 DECLARE("THREAD_FUNNEL_LOCK",
323 offsetof(struct thread_shuttle *, funnel_lock));
324 DECLARE("THREAD_FUNNEL_STATE",
325 offsetof(struct thread_shuttle *, funnel_state));
326 DECLARE("LOCK_FNL_MUTEX",
327 offsetof(struct funnel_lock *, fnl_mutex));
1c79356b 328#if MACH_LDEBUG
9bccf70c 329 DECLARE("THREAD_MUTEX_COUNT", offsetof(struct thread_shuttle *, mutex_count));
1c79356b 330#endif /* MACH_LDEBUG */
9bccf70c
A
331 DECLARE("THREAD_PSET", offsetof(struct thread_shuttle *, processor_set));
332 DECLARE("THREAD_LINKS", offsetof(struct thread_shuttle *, links));
333 DECLARE("THREAD_PSTHRN", offsetof(struct thread_shuttle *, pset_threads.next));
1c79356b
A
334
335 /* values from kern/thread_act.h */
9bccf70c
A
336 DECLARE("ACT_TASK", offsetof(struct thread_activation *, task));
337 DECLARE("ACT_THREAD", offsetof(struct thread_activation *, thread));
338 DECLARE("ACT_LOWER", offsetof(struct thread_activation *, lower));
339 DECLARE("ACT_MACT_PCB", offsetof(struct thread_activation *, mact.pcb));
340 DECLARE("ACT_AST", offsetof(struct thread_activation *, ast));
341 DECLARE("ACT_VMMAP", offsetof(struct thread_activation *, map));
342 DECLARE("ACT_KLOADED", offsetof(struct thread_activation *, kernel_loaded));
343 DECLARE("ACT_KLOADING", offsetof(struct thread_activation *, kernel_loading));
344 DECLARE("vmmCEntry", offsetof(struct thread_activation *, mact.vmmCEntry));
345 DECLARE("vmmControl", offsetof(struct thread_activation *, mact.vmmControl));
346 DECLARE("curctx", offsetof(struct thread_activation *, mact.curctx));
347 DECLARE("deferctx", offsetof(struct thread_activation *, mact.deferctx));
348 DECLARE("facctx", offsetof(struct thread_activation *, mact.facctx));
1c79356b 349#ifdef MACH_BSD
9bccf70c 350 DECLARE("CTHREAD_SELF", offsetof(struct thread_activation *, mact.cthread_self));
1c79356b
A
351#endif
352
9bccf70c
A
353 DECLARE("FPUsave", offsetof(struct facility_context *,FPUsave));
354 DECLARE("FPUlevel", offsetof(struct facility_context *,FPUlevel));
355 DECLARE("FPUcpu", offsetof(struct facility_context *,FPUcpu));
356 DECLARE("VMXsave", offsetof(struct facility_context *,VMXsave));
357 DECLARE("VMXlevel", offsetof(struct facility_context *,VMXlevel));
358 DECLARE("VMXcpu", offsetof(struct facility_context *,VMXcpu));
359 DECLARE("facAct", offsetof(struct facility_context *,facAct));
360
1c79356b
A
361 /* Values from vmachmon.h */
362
363 DECLARE("kVmmGetVersion", kVmmGetVersion);
364 DECLARE("kVmmvGetFeatures", kVmmvGetFeatures);
365 DECLARE("kVmmInitContext", kVmmInitContext);
366 DECLARE("kVmmTearDownContext", kVmmTearDownContext);
367 DECLARE("kVmmTearDownAll", kVmmTearDownAll);
368 DECLARE("kVmmMapPage", kVmmMapPage);
369 DECLARE("kVmmGetPageMapping", kVmmGetPageMapping);
370 DECLARE("kVmmUnmapPage", kVmmUnmapPage);
371 DECLARE("kVmmUnmapAllPages", kVmmUnmapAllPages);
372 DECLARE("kVmmGetPageDirtyFlag", kVmmGetPageDirtyFlag);
373 DECLARE("kVmmGetFloatState", kVmmGetFloatState);
374 DECLARE("kVmmGetVectorState", kVmmGetVectorState);
375 DECLARE("kVmmSetTimer", kVmmSetTimer);
376 DECLARE("kVmmExecuteVM", kVmmExecuteVM);
0b4e3aa0 377 DECLARE("kVmmProtectPage", kVmmProtectPage);
de355530 378
d7e50217
A
379 DECLARE("kvmmExitToHost", kvmmExitToHost);
380 DECLARE("kvmmResumeGuest", kvmmResumeGuest);
381 DECLARE("kvmmGetGuestRegister", kvmmGetGuestRegister);
382 DECLARE("kvmmSetGuestRegister", kvmmSetGuestRegister);
1c79356b
A
383
384 DECLARE("kVmmReturnNull", kVmmReturnNull);
0b4e3aa0 385 DECLARE("kVmmStopped", kVmmStopped);
1c79356b
A
386 DECLARE("kVmmBogusContext", kVmmBogusContext);
387 DECLARE("kVmmReturnDataPageFault", kVmmReturnDataPageFault);
388 DECLARE("kVmmReturnInstrPageFault", kVmmReturnInstrPageFault);
389 DECLARE("kVmmReturnAlignmentFault", kVmmReturnAlignmentFault);
390 DECLARE("kVmmReturnProgramException", kVmmReturnProgramException);
391 DECLARE("kVmmReturnSystemCall", kVmmReturnSystemCall);
392 DECLARE("kVmmReturnTraceException", kVmmReturnTraceException);
0b4e3aa0
A
393
394 DECLARE("kVmmProtXtnd", kVmmProtXtnd);
395 DECLARE("kVmmProtNARW", kVmmProtNARW);
396 DECLARE("kVmmProtRORW", kVmmProtRORW);
397 DECLARE("kVmmProtRWRW", kVmmProtRWRW);
398 DECLARE("kVmmProtRORO", kVmmProtRORO);
1c79356b
A
399
400 DECLARE("vmmFlags", offsetof(struct vmmCntrlEntry *, vmmFlags));
401 DECLARE("vmmInUseb", vmmInUseb);
402 DECLARE("vmmInUse", vmmInUse);
de355530 403 DECLARE("vmmPmap", offsetof(struct vmmCntrlEntry *, vmmPmap));
1c79356b 404 DECLARE("vmmContextKern", offsetof(struct vmmCntrlEntry *, vmmContextKern));
d7e50217 405 DECLARE("vmmContextPhys", offsetof(struct vmmCntrlEntry *, vmmContextPhys));
1c79356b 406 DECLARE("vmmContextUser", offsetof(struct vmmCntrlEntry *, vmmContextUser));
9bccf70c 407 DECLARE("vmmFacCtx", offsetof(struct vmmCntrlEntry *, vmmFacCtx));
de355530 408 DECLARE("vmmLastMap", offsetof(struct vmmCntrlEntry *, vmmLastMap));
d7e50217 409 DECLARE("vmmFAMintercept", offsetof(struct vmmCntrlEntry *, vmmFAMintercept));
1c79356b 410 DECLARE("vmmCEntrySize", sizeof(struct vmmCntrlEntry));
de355530 411 DECLARE("kVmmMaxContextsPerThread", kVmmMaxContextsPerThread);
1c79356b
A
412
413 DECLARE("interface_version", offsetof(struct vmm_state_page_t *, interface_version));
414 DECLARE("thread_index", offsetof(struct vmm_state_page_t *, thread_index));
415 DECLARE("vmmStat", offsetof(struct vmm_state_page_t *, vmmStat));
416 DECLARE("vmmCntrl", offsetof(struct vmm_state_page_t *, vmmCntrl));
417 DECLARE("return_code", offsetof(struct vmm_state_page_t *, return_code));
418 DECLARE("return_params", offsetof(struct vmm_state_page_t *, return_params));
419 DECLARE("vmm_proc_state", offsetof(struct vmm_state_page_t *, vmm_proc_state));
1c79356b
A
420 DECLARE("vmmppcVRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVRs));
421 DECLARE("vmmppcVSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCR));
de355530 422 DECLARE("vmmppcVSCRshadow", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCRshadow));
1c79356b
A
423 DECLARE("vmmppcFPRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPRs));
424 DECLARE("vmmppcFPSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR));
de355530
A
425 DECLARE("vmmppcFPSCRshadow", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCRshadow));
426
427 DECLARE("vmmppcpc", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcPC));
428 DECLARE("vmmppcmsr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcMSR));
429 DECLARE("vmmppcr0", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x00));
430 DECLARE("vmmppcr1", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x04));
431 DECLARE("vmmppcr2", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x08));
432 DECLARE("vmmppcr3", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x0C));
433 DECLARE("vmmppcr4", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x10));
434 DECLARE("vmmppcr5", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x14));
435
436 DECLARE("vmmppcr6", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x18));
437 DECLARE("vmmppcr7", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x1C));
438 DECLARE("vmmppcr8", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x20));
439 DECLARE("vmmppcr9", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x24));
440 DECLARE("vmmppcr10", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x28));
441 DECLARE("vmmppcr11", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x2C));
442 DECLARE("vmmppcr12", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x30));
443 DECLARE("vmmppcr13", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x34));
444
445 DECLARE("vmmppcr14", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x38));
446 DECLARE("vmmppcr15", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x3C));
447 DECLARE("vmmppcr16", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x40));
448 DECLARE("vmmppcr17", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x44));
449 DECLARE("vmmppcr18", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x48));
450 DECLARE("vmmppcr19", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x4C));
451 DECLARE("vmmppcr20", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x50));
452 DECLARE("vmmppcr21", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x54));
453
454 DECLARE("vmmppcr22", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x58));
455 DECLARE("vmmppcr23", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x5C));
456 DECLARE("vmmppcr24", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x60));
457 DECLARE("vmmppcr25", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x64));
458 DECLARE("vmmppcr26", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x68));
459 DECLARE("vmmppcr27", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x6C));
460 DECLARE("vmmppcr28", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x70));
461 DECLARE("vmmppcr29", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x74));
462
463 DECLARE("vmmppcr30", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x78));
464 DECLARE("vmmppcr31", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcGPRs+0x7C));
465 DECLARE("vmmppccr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcCR));
466 DECLARE("vmmppcxer", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcXER));
467 DECLARE("vmmppclr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcLR));
468 DECLARE("vmmppcctr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcCTR));
469 DECLARE("vmmppcmq", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcMQ));
470 DECLARE("vmmppcvrsave", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVRSave));
9bccf70c
A
471
472 DECLARE("vmmppcvscr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCR+0x00));
473 DECLARE("vmmppcfpscrpad", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR));
474 DECLARE("vmmppcfpscr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR+4));
475
de355530
A
476 DECLARE("famguestr0", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register));
477 DECLARE("famguestr1", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x4));
478 DECLARE("famguestr2", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x8));
479 DECLARE("famguestr3", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0xC));
480 DECLARE("famguestr4", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x10));
481 DECLARE("famguestr5", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x14));
482 DECLARE("famguestr6", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x18));
483 DECLARE("famguestr7", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_register+0x1C));
484 DECLARE("famguestpc", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_pc));
485 DECLARE("famguestmsr", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.guest_msr));
486
487 DECLARE("famdispcode", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.fastassist_dispatch_code));
488 DECLARE("famrefcon", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.fastassist_refcon));
489 DECLARE("famparam", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.fastassist_parameter));
490 DECLARE("famhandler", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.fastassist_dispatch));
491 DECLARE("famintercepts", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.fastassist_intercepts));
d7e50217 492
1c79356b
A
493 DECLARE("vmmFloatCngd", vmmFloatCngd);
494 DECLARE("vmmFloatCngdb", vmmFloatCngdb);
495 DECLARE("vmmVectCngd", vmmVectCngd);
496 DECLARE("vmmVectCngdb", vmmVectCngdb);
497 DECLARE("vmmTimerPop", vmmTimerPop);
498 DECLARE("vmmTimerPopb", vmmTimerPopb);
de355530
A
499 DECLARE("vmmMapDone", vmmMapDone);
500 DECLARE("vmmMapDoneb", vmmMapDoneb);
d7e50217
A
501 DECLARE("vmmFAMmode", vmmFAMmode);
502 DECLARE("vmmFAMmodeb", vmmFAMmodeb);
1c79356b
A
503 DECLARE("vmmSpfSave", vmmSpfSave);
504 DECLARE("vmmSpfSaveb", vmmSpfSaveb);
505 DECLARE("vmmFloatLoad", vmmFloatLoad);
506 DECLARE("vmmFloatLoadb", vmmFloatLoadb);
507 DECLARE("vmmVectLoad", vmmVectLoad);
508 DECLARE("vmmVectLoadb", vmmVectLoadb);
509 DECLARE("vmmVectVRall", vmmVectVRall);
510 DECLARE("vmmVectVRallb", vmmVectVRallb);
511 DECLARE("vmmVectVAss", vmmVectVAss);
512 DECLARE("vmmVectVAssb", vmmVectVAssb);
0b4e3aa0
A
513 DECLARE("vmmXStart", vmmXStart);
514 DECLARE("vmmXStartb", vmmXStartb);
de355530 515 DECLARE("vmmXStop", vmmXStop);
0b4e3aa0 516 DECLARE("vmmXStopb", vmmXStopb);
de355530
A
517 DECLARE("vmmKey", vmmKey);
518 DECLARE("vmmKeyb", vmmKeyb);
d7e50217
A
519 DECLARE("vmmFamSet", vmmFamSet);
520 DECLARE("vmmFamSetb", vmmFamSetb);
521 DECLARE("vmmFamEna", vmmFamEna);
522 DECLARE("vmmFamEnab", vmmFamEnab);
1c79356b
A
523
524 /* values from kern/task.h */
1c79356b
A
525 DECLARE("TASK_SYSCALLS_MACH",
526 offsetof(struct task *, syscalls_mach));
9bccf70c
A
527 DECLARE("TASK_SYSCALLS_UNIX",
528 offsetof(struct task *, syscalls_unix));
1c79356b
A
529
530 /* values from vm/vm_map.h */
531 DECLARE("VMMAP_PMAP", offsetof(struct vm_map *, pmap));
532
533 /* values from machine/pmap.h */
de355530
A
534 DECLARE("PMAP_SPACE", offsetof(struct pmap *, space));
535 DECLARE("PMAP_BMAPS", offsetof(struct pmap *, bmaps));
536 DECLARE("PMAP_PMAPVR", offsetof(struct pmap *, pmapvr));
537 DECLARE("PMAP_VFLAGS", offsetof(struct pmap *, vflags));
538 DECLARE("PMAP_USAGE", offsetof(struct pmap *, pmapUsage));
539 DECLARE("PMAP_SEGS", offsetof(struct pmap *, pmapSegs));
540 DECLARE("PMAP_SIZE", pmapSize);
9bccf70c
A
541
542 /* values from kern/processor.h */
543 DECLARE("psthreads", offsetof(struct processor_set *, threads));
544 DECLARE("psthreadcnt", offsetof(struct processor_set *, thread_count));
1c79356b
A
545
546
547 /* Constants from pmap.h */
548 DECLARE("PPC_SID_KERNEL", PPC_SID_KERNEL);
549
550 /* values for accessing mach_trap table */
551 DECLARE("MACH_TRAP_OFFSET_POW2", 4);
552
553 DECLARE("MACH_TRAP_ARGC",
554 offsetof(mach_trap_t *, mach_trap_arg_count));
555 DECLARE("MACH_TRAP_FUNCTION",
556 offsetof(mach_trap_t *, mach_trap_function));
557
558 DECLARE("HOST_SELF", offsetof(host_t, host_self));
559
560 DECLARE("PPCcallmax", sizeof(PPCcalls));
561
de355530
A
562 /* values from cpu_data.h */
563 DECLARE("CPU_ACTIVE_THREAD", offsetof(cpu_data_t *, active_thread));
564 DECLARE("CPU_PREEMPTION_LEVEL", offsetof(cpu_data_t *, preemption_level));
565 DECLARE("CPU_SIMPLE_LOCK_COUNT",
566 offsetof(cpu_data_t *, simple_lock_count));
567 DECLARE("CPU_INTERRUPT_LEVEL",offsetof(cpu_data_t *, interrupt_level));
568
1c79356b
A
569 /* Misc values used by assembler */
570 DECLARE("AST_ALL", AST_ALL);
571 DECLARE("AST_URGENT", AST_URGENT);
572
573 /* Simple Lock structure */
9bccf70c 574 DECLARE("SLOCK_ILK", offsetof(usimple_lock_t, interlock));
1c79356b 575#if MACH_LDEBUG
9bccf70c
A
576 DECLARE("SLOCK_TYPE", offsetof(usimple_lock_t, lock_type));
577 DECLARE("SLOCK_PC", offsetof(usimple_lock_t, debug.lock_pc));
578 DECLARE("SLOCK_THREAD", offsetof(usimple_lock_t, debug.lock_thread));
579 DECLARE("SLOCK_DURATIONH",offsetof(usimple_lock_t, debug.duration[0]));
580 DECLARE("SLOCK_DURATIONL",offsetof(usimple_lock_t, debug.duration[1]));
1c79356b
A
581 DECLARE("USLOCK_TAG", USLOCK_TAG);
582#endif /* MACH_LDEBUG */
583
584 /* Mutex structure */
0b4e3aa0 585 DECLARE("LOCK_DATA", offsetof(mutex_t *, interlock));
1c79356b 586 DECLARE("MUTEX_WAITERS",offsetof(mutex_t *, waiters));
9bccf70c 587 DECLARE("MUTEX_PROMOTED_PRI",offsetof(mutex_t *, promoted_pri));
1c79356b
A
588#if MACH_LDEBUG
589 DECLARE("MUTEX_TYPE", offsetof(mutex_t *, type));
590 DECLARE("MUTEX_PC", offsetof(mutex_t *, pc));
591 DECLARE("MUTEX_THREAD", offsetof(mutex_t *, thread));
592 DECLARE("MUTEX_TAG", MUTEX_TAG);
593#endif /* MACH_LDEBUG */
1c79356b
A
594
595 /* values from low_trace.h */
596 DECLARE("LTR_cpu", offsetof(struct LowTraceRecord *, LTR_cpu));
597 DECLARE("LTR_excpt", offsetof(struct LowTraceRecord *, LTR_excpt));
598 DECLARE("LTR_timeHi", offsetof(struct LowTraceRecord *, LTR_timeHi));
599 DECLARE("LTR_timeLo", offsetof(struct LowTraceRecord *, LTR_timeLo));
600 DECLARE("LTR_cr", offsetof(struct LowTraceRecord *, LTR_cr));
601 DECLARE("LTR_srr0", offsetof(struct LowTraceRecord *, LTR_srr0));
602 DECLARE("LTR_srr1", offsetof(struct LowTraceRecord *, LTR_srr1));
603 DECLARE("LTR_dar", offsetof(struct LowTraceRecord *, LTR_dar));
604 DECLARE("LTR_save", offsetof(struct LowTraceRecord *, LTR_save));
605 DECLARE("LTR_lr", offsetof(struct LowTraceRecord *, LTR_lr));
606 DECLARE("LTR_ctr", offsetof(struct LowTraceRecord *, LTR_ctr));
607 DECLARE("LTR_r0", offsetof(struct LowTraceRecord *, LTR_r0));
608 DECLARE("LTR_r1", offsetof(struct LowTraceRecord *, LTR_r1));
609 DECLARE("LTR_r2", offsetof(struct LowTraceRecord *, LTR_r2));
610 DECLARE("LTR_r3", offsetof(struct LowTraceRecord *, LTR_r3));
611 DECLARE("LTR_r4", offsetof(struct LowTraceRecord *, LTR_r4));
612 DECLARE("LTR_r5", offsetof(struct LowTraceRecord *, LTR_r5));
613 DECLARE("LTR_size", sizeof(struct LowTraceRecord));
614
615/* Values from pexpert.h */
616 DECLARE("PECFIcpurate", offsetof(struct clock_frequency_info_t *, cpu_clock_rate_hz));
617 DECLARE("PECFIbusrate", offsetof(struct clock_frequency_info_t *, bus_clock_rate_hz));
618
619/* Values from pmap_internals.h and mappings.h */
de355530
A
620 DECLARE("mmnext", offsetof(struct mapping *, next));
621 DECLARE("mmhashnext", offsetof(struct mapping *, hashnext));
622 DECLARE("mmPTEhash", offsetof(struct mapping *, PTEhash));
623 DECLARE("mmPTEent", offsetof(struct mapping *, PTEent));
624 DECLARE("mmPTEv", offsetof(struct mapping *, PTEv));
625 DECLARE("mmPTEr", offsetof(struct mapping *, PTEr));
626 DECLARE("mmphysent", offsetof(struct mapping *, physent));
627 DECLARE("mmpmap", offsetof(struct mapping *, pmap));
628
629 DECLARE("bmnext", offsetof(struct blokmap *, next));
630 DECLARE("bmstart", offsetof(struct blokmap *, start));
631 DECLARE("bmend", offsetof(struct blokmap *, end));
632 DECLARE("bmcurrent", offsetof(struct blokmap *, current));
633 DECLARE("bmPTEr", offsetof(struct blokmap *, PTEr));
634 DECLARE("bmspace", offsetof(struct blokmap *, space));
635 DECLARE("blkFlags", offsetof(struct blokmap *, blkFlags));
636 DECLARE("blkPerm", blkPerm);
637 DECLARE("blkRem", blkRem);
638 DECLARE("blkPermbit", blkPermbit);
639 DECLARE("blkRembit", blkRembit);
640 DECLARE("BLKREMMAX", BLKREMMAX);
641
1c79356b
A
642 DECLARE("mbvrswap", offsetof(struct mappingblok *, mapblokvrswap));
643 DECLARE("mbfree", offsetof(struct mappingblok *, mapblokfree));
644 DECLARE("mapcsize", sizeof(struct mappingctl));
645
de355530
A
646 DECLARE("pephyslink", offsetof(struct phys_entry *, phys_link));
647 DECLARE("pepte1", offsetof(struct phys_entry *, pte1));
1c79356b 648
de355530 649 DECLARE("PCAlock", offsetof(struct PCA *, PCAlock));
1c79356b
A
650 DECLARE("PCAallo", offsetof(struct PCA *, flgs.PCAallo));
651 DECLARE("PCAfree", offsetof(struct PCA *, flgs.PCAalflgs.PCAfree));
652 DECLARE("PCAauto", offsetof(struct PCA *, flgs.PCAalflgs.PCAauto));
de355530 653 DECLARE("PCAslck", offsetof(struct PCA *, flgs.PCAalflgs.PCAslck));
1c79356b 654 DECLARE("PCAsteal", offsetof(struct PCA *, flgs.PCAalflgs.PCAsteal));
de355530
A
655 DECLARE("PCAgas", offsetof(struct PCA *, PCAgas));
656 DECLARE("PCAhash", offsetof(struct PCA *, PCAhash));
1c79356b 657
9bccf70c
A
658 DECLARE("MFpcaptr", offsetof(struct mappingflush *, pcaptr));
659 DECLARE("MFmappingcnt", offsetof(struct mappingflush *, mappingcnt));
660 DECLARE("MFmapping", offsetof(struct mappingflush *, mapping));
661 DECLARE("MFmappingSize", sizeof(struct mfmapping));
de355530
A
662
663 DECLARE("SVlock", offsetof(struct Saveanchor *, savelock));
664 DECLARE("SVpoolfwd", offsetof(struct Saveanchor *, savepoolfwd));
665 DECLARE("SVpoolbwd", offsetof(struct Saveanchor *, savepoolbwd));
666 DECLARE("SVfree", offsetof(struct Saveanchor *, savefree));
667 DECLARE("SVfreecnt", offsetof(struct Saveanchor *, savefreecnt));
668 DECLARE("SVadjust", offsetof(struct Saveanchor *, saveadjust));
669 DECLARE("SVinuse", offsetof(struct Saveanchor *, saveinuse));
670 DECLARE("SVtarget", offsetof(struct Saveanchor *, savetarget));
671 DECLARE("SVsize", sizeof(struct Saveanchor));
1c79356b
A
672
673#if 1
674 DECLARE("GDsave", offsetof(struct GDWorkArea *, GDsave));
675 DECLARE("GDfp0", offsetof(struct GDWorkArea *, GDfp0));
676 DECLARE("GDfp1", offsetof(struct GDWorkArea *, GDfp1));
677 DECLARE("GDfp2", offsetof(struct GDWorkArea *, GDfp2));
678 DECLARE("GDfp3", offsetof(struct GDWorkArea *, GDfp3));
679 DECLARE("GDtop", offsetof(struct GDWorkArea *, GDtop));
680 DECLARE("GDleft", offsetof(struct GDWorkArea *, GDleft));
681 DECLARE("GDtopleft", offsetof(struct GDWorkArea *, GDtopleft));
682 DECLARE("GDrowbytes", offsetof(struct GDWorkArea *, GDrowbytes));
683 DECLARE("GDrowchar", offsetof(struct GDWorkArea *, GDrowchar));
684 DECLARE("GDdepth", offsetof(struct GDWorkArea *, GDdepth));
685 DECLARE("GDcollgn", offsetof(struct GDWorkArea *, GDcollgn));
686 DECLARE("GDready", offsetof(struct GDWorkArea *, GDready));
687 DECLARE("GDrowbuf1", offsetof(struct GDWorkArea *, GDrowbuf1));
688 DECLARE("GDrowbuf2", offsetof(struct GDWorkArea *, GDrowbuf2));
689#endif
690
de355530
A
691 DECLARE("dgLock", offsetof(struct diagWork *, dgLock));
692 DECLARE("dgFlags", offsetof(struct diagWork *, dgFlags));
693 DECLARE("dgMisc0", offsetof(struct diagWork *, dgMisc0));
1c79356b
A
694 DECLARE("enaExpTrace", enaExpTrace);
695 DECLARE("enaExpTraceb", enaExpTraceb);
696 DECLARE("enaUsrFCall", enaUsrFCall);
697 DECLARE("enaUsrFCallb", enaUsrFCallb);
698 DECLARE("enaUsrPhyMp", enaUsrPhyMp);
699 DECLARE("enaUsrPhyMpb", enaUsrPhyMpb);
700 DECLARE("enaDiagSCs", enaDiagSCs);
701 DECLARE("enaDiagSCsb", enaDiagSCsb);
9bccf70c
A
702 DECLARE("enaDiagEM", enaDiagEM);
703 DECLARE("enaDiagEMb", enaDiagEMb);
1c79356b
A
704 DECLARE("disLkType", disLkType);
705 DECLARE("disLktypeb", disLktypeb);
706 DECLARE("disLkThread", disLkThread);
707 DECLARE("disLkThreadb", disLkThreadb);
708 DECLARE("disLkNmSimp", disLkNmSimp);
709 DECLARE("disLkNmSimpb", disLkNmSimpb);
710 DECLARE("disLkMyLck", disLkMyLck);
711 DECLARE("disLkMyLckb", disLkMyLckb);
712 DECLARE("dgMisc1", offsetof(struct diagWork *, dgMisc1));
713 DECLARE("dgMisc2", offsetof(struct diagWork *, dgMisc2));
714 DECLARE("dgMisc3", offsetof(struct diagWork *, dgMisc3));
715 DECLARE("dgMisc4", offsetof(struct diagWork *, dgMisc4));
716 DECLARE("dgMisc5", offsetof(struct diagWork *, dgMisc5));
717
de355530
A
718 DECLARE("traceMask", offsetof(struct traceWork *, traceMask));
719 DECLARE("traceCurr", offsetof(struct traceWork *, traceCurr));
720 DECLARE("traceStart", offsetof(struct traceWork *, traceStart));
721 DECLARE("traceEnd", offsetof(struct traceWork *, traceEnd));
722 DECLARE("traceMsnd", offsetof(struct traceWork *, traceMsnd));
723
9bccf70c
A
724 DECLARE("SACnext", offsetof(struct savearea_comm *, sac_next));
725 DECLARE("SACprev", offsetof(struct savearea_comm *, sac_prev));
726 DECLARE("SACvrswap", offsetof(struct savearea_comm *, sac_vrswap));
727 DECLARE("SACalloc", offsetof(struct savearea_comm *, sac_alloc));
728 DECLARE("SACflags", offsetof(struct savearea_comm *, sac_flags));
729 DECLARE("sac_cnt", sac_cnt);
730 DECLARE("sac_empty", sac_empty);
731 DECLARE("sac_perm", sac_perm);
732 DECLARE("sac_permb", sac_permb);
733
734 DECLARE("LocalSaveTarget", LocalSaveTarget);
735 DECLARE("LocalSaveMin", LocalSaveMin);
736 DECLARE("LocalSaveMax", LocalSaveMax);
737 DECLARE("FreeListMin", FreeListMin);
738 DECLARE("SaveLowHysteresis", SaveLowHysteresis);
739 DECLARE("SaveHighHysteresis", SaveHighHysteresis);
740 DECLARE("InitialSaveAreas", InitialSaveAreas);
741 DECLARE("InitialSaveTarget", InitialSaveTarget);
742 DECLARE("InitialSaveBloks", InitialSaveBloks);
743
744 DECLARE("SAVprev", offsetof(struct savearea_comm *, save_prev));
745 DECLARE("SAVact", offsetof(struct savearea_comm *, save_act));
746 DECLARE("SAVflags", offsetof(struct savearea_comm *, save_flags));
747 DECLARE("SAVlevel", offsetof(struct savearea_comm *, save_level));
748 DECLARE("SAVtime", offsetof(struct savearea_comm *, save_time));
1c79356b 749 DECLARE("SAVsize", sizeof(struct savearea));
9bccf70c
A
750 DECLARE("SAVsizefpu", sizeof(struct savearea_vec));
751 DECLARE("SAVsizevec", sizeof(struct savearea_fpu));
752 DECLARE("SAVcommsize", sizeof(struct savearea_comm));
de355530 753
1c79356b
A
754 DECLARE("savesrr0", offsetof(struct savearea *, save_srr0));
755 DECLARE("savesrr1", offsetof(struct savearea *, save_srr1));
756 DECLARE("savecr", offsetof(struct savearea *, save_cr));
757 DECLARE("savexer", offsetof(struct savearea *, save_xer));
758 DECLARE("savelr", offsetof(struct savearea *, save_lr));
759 DECLARE("savectr", offsetof(struct savearea *, save_ctr));
1c79356b
A
760 DECLARE("savedar", offsetof(struct savearea *, save_dar));
761 DECLARE("savedsisr", offsetof(struct savearea *, save_dsisr));
762 DECLARE("saveexception", offsetof(struct savearea *, save_exception));
9bccf70c
A
763 DECLARE("savefpscrpad", offsetof(struct savearea *, save_fpscrpad));
764 DECLARE("savefpscr", offsetof(struct savearea *, save_fpscr));
1c79356b 765 DECLARE("savevrsave", offsetof(struct savearea *, save_vrsave));
9bccf70c 766 DECLARE("savevscr", offsetof(struct savearea *, save_vscr));
1c79356b
A
767
768 DECLARE("saver0", offsetof(struct savearea *, save_r0));
769 DECLARE("saver1", offsetof(struct savearea *, save_r1));
770 DECLARE("saver2", offsetof(struct savearea *, save_r2));
771 DECLARE("saver3", offsetof(struct savearea *, save_r3));
772 DECLARE("saver4", offsetof(struct savearea *, save_r4));
773 DECLARE("saver5", offsetof(struct savearea *, save_r5));
774 DECLARE("saver6", offsetof(struct savearea *, save_r6));
775 DECLARE("saver7", offsetof(struct savearea *, save_r7));
776 DECLARE("saver8", offsetof(struct savearea *, save_r8));
777 DECLARE("saver9", offsetof(struct savearea *, save_r9));
778 DECLARE("saver10", offsetof(struct savearea *, save_r10));
779 DECLARE("saver11", offsetof(struct savearea *, save_r11));
780 DECLARE("saver12", offsetof(struct savearea *, save_r12));
781 DECLARE("saver13", offsetof(struct savearea *, save_r13));
782 DECLARE("saver14", offsetof(struct savearea *, save_r14));
783 DECLARE("saver15", offsetof(struct savearea *, save_r15));
784 DECLARE("saver16", offsetof(struct savearea *, save_r16));
785 DECLARE("saver17", offsetof(struct savearea *, save_r17));
786 DECLARE("saver18", offsetof(struct savearea *, save_r18));
787 DECLARE("saver19", offsetof(struct savearea *, save_r19));
788 DECLARE("saver20", offsetof(struct savearea *, save_r20));
789 DECLARE("saver21", offsetof(struct savearea *, save_r21));
790 DECLARE("saver22", offsetof(struct savearea *, save_r22));
791 DECLARE("saver23", offsetof(struct savearea *, save_r23));
792 DECLARE("saver24", offsetof(struct savearea *, save_r24));
793 DECLARE("saver25", offsetof(struct savearea *, save_r25));
794 DECLARE("saver26", offsetof(struct savearea *, save_r26));
795 DECLARE("saver27", offsetof(struct savearea *, save_r27));
796 DECLARE("saver28", offsetof(struct savearea *, save_r28));
797 DECLARE("saver29", offsetof(struct savearea *, save_r29));
798 DECLARE("saver30", offsetof(struct savearea *, save_r30));
799 DECLARE("saver31", offsetof(struct savearea *, save_r31));
800
de355530
A
801 DECLARE("savesr0", offsetof(struct savearea *, save_sr0));
802 DECLARE("savesr1", offsetof(struct savearea *, save_sr1));
803 DECLARE("savesr2", offsetof(struct savearea *, save_sr2));
804 DECLARE("savesr3", offsetof(struct savearea *, save_sr3));
805 DECLARE("savesr4", offsetof(struct savearea *, save_sr4));
806 DECLARE("savesr5", offsetof(struct savearea *, save_sr5));
807 DECLARE("savesr6", offsetof(struct savearea *, save_sr6));
808 DECLARE("savesr7", offsetof(struct savearea *, save_sr7));
809 DECLARE("savesr8", offsetof(struct savearea *, save_sr8));
810 DECLARE("savesr9", offsetof(struct savearea *, save_sr9));
811 DECLARE("savesr10", offsetof(struct savearea *, save_sr10));
812 DECLARE("savesr11", offsetof(struct savearea *, save_sr11));
813 DECLARE("savesr12", offsetof(struct savearea *, save_sr12));
814 DECLARE("savesr13", offsetof(struct savearea *, save_sr13));
815 DECLARE("savesr14", offsetof(struct savearea *, save_sr14));
816 DECLARE("savesr15", offsetof(struct savearea *, save_sr15));
817
9bccf70c
A
818 DECLARE("savefp0", offsetof(struct savearea_fpu *, save_fp0));
819 DECLARE("savefp1", offsetof(struct savearea_fpu *, save_fp1));
820 DECLARE("savefp2", offsetof(struct savearea_fpu *, save_fp2));
821 DECLARE("savefp3", offsetof(struct savearea_fpu *, save_fp3));
822 DECLARE("savefp4", offsetof(struct savearea_fpu *, save_fp4));
823 DECLARE("savefp5", offsetof(struct savearea_fpu *, save_fp5));
824 DECLARE("savefp6", offsetof(struct savearea_fpu *, save_fp6));
825 DECLARE("savefp7", offsetof(struct savearea_fpu *, save_fp7));
826 DECLARE("savefp8", offsetof(struct savearea_fpu *, save_fp8));
827 DECLARE("savefp9", offsetof(struct savearea_fpu *, save_fp9));
828 DECLARE("savefp10", offsetof(struct savearea_fpu *, save_fp10));
829 DECLARE("savefp11", offsetof(struct savearea_fpu *, save_fp11));
830 DECLARE("savefp12", offsetof(struct savearea_fpu *, save_fp12));
831 DECLARE("savefp13", offsetof(struct savearea_fpu *, save_fp13));
832 DECLARE("savefp14", offsetof(struct savearea_fpu *, save_fp14));
833 DECLARE("savefp15", offsetof(struct savearea_fpu *, save_fp15));
834 DECLARE("savefp16", offsetof(struct savearea_fpu *, save_fp16));
835 DECLARE("savefp17", offsetof(struct savearea_fpu *, save_fp17));
836 DECLARE("savefp18", offsetof(struct savearea_fpu *, save_fp18));
837 DECLARE("savefp19", offsetof(struct savearea_fpu *, save_fp19));
838 DECLARE("savefp20", offsetof(struct savearea_fpu *, save_fp20));
839 DECLARE("savefp21", offsetof(struct savearea_fpu *, save_fp21));
840 DECLARE("savefp22", offsetof(struct savearea_fpu *, save_fp22));
841 DECLARE("savefp23", offsetof(struct savearea_fpu *, save_fp23));
842 DECLARE("savefp24", offsetof(struct savearea_fpu *, save_fp24));
843 DECLARE("savefp25", offsetof(struct savearea_fpu *, save_fp25));
844 DECLARE("savefp26", offsetof(struct savearea_fpu *, save_fp26));
845 DECLARE("savefp27", offsetof(struct savearea_fpu *, save_fp27));
846 DECLARE("savefp28", offsetof(struct savearea_fpu *, save_fp28));
847 DECLARE("savefp29", offsetof(struct savearea_fpu *, save_fp29));
848 DECLARE("savefp30", offsetof(struct savearea_fpu *, save_fp30));
849 DECLARE("savefp31", offsetof(struct savearea_fpu *, save_fp31));
1c79356b 850
9bccf70c
A
851 DECLARE("savevr0", offsetof(struct savearea_vec *, save_vr0));
852 DECLARE("savevr1", offsetof(struct savearea_vec *, save_vr1));
853 DECLARE("savevr2", offsetof(struct savearea_vec *, save_vr2));
854 DECLARE("savevr3", offsetof(struct savearea_vec *, save_vr3));
855 DECLARE("savevr4", offsetof(struct savearea_vec *, save_vr4));
856 DECLARE("savevr5", offsetof(struct savearea_vec *, save_vr5));
857 DECLARE("savevr6", offsetof(struct savearea_vec *, save_vr6));
858 DECLARE("savevr7", offsetof(struct savearea_vec *, save_vr7));
859 DECLARE("savevr8", offsetof(struct savearea_vec *, save_vr8));
860 DECLARE("savevr9", offsetof(struct savearea_vec *, save_vr9));
861 DECLARE("savevr10", offsetof(struct savearea_vec *, save_vr10));
862 DECLARE("savevr11", offsetof(struct savearea_vec *, save_vr11));
863 DECLARE("savevr12", offsetof(struct savearea_vec *, save_vr12));
864 DECLARE("savevr13", offsetof(struct savearea_vec *, save_vr13));
865 DECLARE("savevr14", offsetof(struct savearea_vec *, save_vr14));
866 DECLARE("savevr15", offsetof(struct savearea_vec *, save_vr15));
867 DECLARE("savevr16", offsetof(struct savearea_vec *, save_vr16));
868 DECLARE("savevr17", offsetof(struct savearea_vec *, save_vr17));
869 DECLARE("savevr18", offsetof(struct savearea_vec *, save_vr18));
870 DECLARE("savevr19", offsetof(struct savearea_vec *, save_vr19));
871 DECLARE("savevr20", offsetof(struct savearea_vec *, save_vr20));
872 DECLARE("savevr21", offsetof(struct savearea_vec *, save_vr21));
873 DECLARE("savevr22", offsetof(struct savearea_vec *, save_vr22));
874 DECLARE("savevr23", offsetof(struct savearea_vec *, save_vr23));
875 DECLARE("savevr24", offsetof(struct savearea_vec *, save_vr24));
876 DECLARE("savevr25", offsetof(struct savearea_vec *, save_vr25));
877 DECLARE("savevr26", offsetof(struct savearea_vec *, save_vr26));
878 DECLARE("savevr27", offsetof(struct savearea_vec *, save_vr27));
879 DECLARE("savevr28", offsetof(struct savearea_vec *, save_vr28));
880 DECLARE("savevr29", offsetof(struct savearea_vec *, save_vr29));
881 DECLARE("savevr30", offsetof(struct savearea_vec *, save_vr30));
882 DECLARE("savevr31", offsetof(struct savearea_vec *, save_vr31));
883 DECLARE("savevrvalid", offsetof(struct savearea_vec *, save_vrvalid));
1c79356b
A
884
885 /* PseudoKernel Exception Descriptor info */
886 DECLARE("BEDA_SRR0", offsetof(BEDA_t *, srr0));
887 DECLARE("BEDA_SRR1", offsetof(BEDA_t *, srr1));
888 DECLARE("BEDA_SPRG0", offsetof(BEDA_t *, sprg0));
889 DECLARE("BEDA_SPRG1", offsetof(BEDA_t *, sprg1));
890
891 /* PseudoKernel Interrupt Control Word */
892 DECLARE("BTTD_INTCONTROLWORD", offsetof(BTTD_t *, InterruptControlWord));
893
894 /* New state when exiting the pseudokernel */
895 DECLARE("BTTD_NEWEXITSTATE", offsetof(BTTD_t *, NewExitState));
896
897 /* PseudoKernel Test/Post Interrupt */
898 DECLARE("BTTD_TESTINTMASK", offsetof(BTTD_t *, testIntMask));
899 DECLARE("BTTD_POSTINTMASK", offsetof(BTTD_t *, postIntMask));
900
901 /* PseudoKernel Vectors */
902 DECLARE("BTTD_TRAP_VECTOR", offsetof(BTTD_t *, TrapVector));
903 DECLARE("BTTD_SYSCALL_VECTOR", offsetof(BTTD_t *, SysCallVector));
904 DECLARE("BTTD_INTERRUPT_VECTOR", offsetof(BTTD_t *, InterruptVector));
905 DECLARE("BTTD_PENDINGINT_VECTOR", offsetof(BTTD_t *, PendingIntVector));
906
907 /* PseudoKernel Bits, Masks and misc */
908 DECLARE("SYSCONTEXTSTATE", kInSystemContext);
909 DECLARE("PSEUDOKERNELSTATE", kInPseudoKernel);
910 DECLARE("INTSTATEMASK_B", 12);
911 DECLARE("INTSTATEMASK_E", 15);
912 DECLARE("INTCR2MASK_B", 8);
913 DECLARE("INTCR2MASK_E", 11);
914 DECLARE("INTBACKUPCR2MASK_B", 28);
915 DECLARE("INTBACKUPCR2MASK_E", 31);
916 DECLARE("INTCR2TOBACKUPSHIFT", kCR2ToBackupShift);
917 DECLARE("BB_MAX_TRAP", bbMaxTrap);
918 DECLARE("BB_RFI_TRAP", bbRFITrap);
919
920 /* Various hackery */
921 DECLARE("procState", offsetof(struct processor *, state));
922
923 DECLARE("CPU_SUBTYPE_POWERPC_ALL", CPU_SUBTYPE_POWERPC_ALL);
de355530
A
924 DECLARE("CPU_SUBTYPE_POWERPC_601", CPU_SUBTYPE_POWERPC_601);
925 DECLARE("CPU_SUBTYPE_POWERPC_602", CPU_SUBTYPE_POWERPC_602);
926 DECLARE("CPU_SUBTYPE_POWERPC_603", CPU_SUBTYPE_POWERPC_603);
927 DECLARE("CPU_SUBTYPE_POWERPC_603e", CPU_SUBTYPE_POWERPC_603e);
928 DECLARE("CPU_SUBTYPE_POWERPC_603ev", CPU_SUBTYPE_POWERPC_603ev);
929 DECLARE("CPU_SUBTYPE_POWERPC_604", CPU_SUBTYPE_POWERPC_604);
930 DECLARE("CPU_SUBTYPE_POWERPC_604e", CPU_SUBTYPE_POWERPC_604e);
931 DECLARE("CPU_SUBTYPE_POWERPC_620", CPU_SUBTYPE_POWERPC_620);
1c79356b
A
932 DECLARE("CPU_SUBTYPE_POWERPC_750", CPU_SUBTYPE_POWERPC_750);
933 DECLARE("CPU_SUBTYPE_POWERPC_7400", CPU_SUBTYPE_POWERPC_7400);
934 DECLARE("CPU_SUBTYPE_POWERPC_7450", CPU_SUBTYPE_POWERPC_7450);
935
d52fe63f
A
936 DECLARE("shdIBAT", offsetof(struct shadowBAT *, IBATs));
937 DECLARE("shdDBAT", offsetof(struct shadowBAT *, DBATs));
1c79356b 938
1c79356b 939
de355530 940
d7e50217 941 return(0); /* For ANSI C :-) */
de355530
A
942
943
944
1c79356b 945}