]> git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/genassym.c
xnu-1228.12.14.tar.gz
[apple/xnu.git] / osfmk / ppc / genassym.c
1 /*
2 * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /*
29 * @OSF_COPYRIGHT@
30 *
31 */
32
33 /*
34 * genassym.c is used to produce an
35 * assembly file which, intermingled with unuseful assembly code,
36 * has all the necessary definitions emitted. This assembly file is
37 * then postprocessed with sed to extract only these definitions
38 * and thus the final assyms.s is created.
39 *
40 * This convoluted means is necessary since the structure alignment
41 * and packing may be different between the host machine and the
42 * target so we are forced into using the cross compiler to generate
43 * the values, but we cannot run anything on the target machine.
44 */
45
46 #include <types.h>
47
48 #include <kern/task.h>
49 #include <kern/thread.h>
50 #include <kern/host.h>
51 #include <kern/lock.h>
52 #include <kern/locks.h>
53 #include <kern/processor.h>
54 #include <ppc/exception.h>
55 #include <ppc/thread.h>
56 #include <ppc/misc_protos.h>
57 #include <kern/syscall_sw.h>
58 #include <ppc/low_trace.h>
59 #include <ppc/PseudoKernel.h>
60 #include <ppc/mappings.h>
61 #include <ppc/Firmware.h>
62 #include <ppc/low_trace.h>
63 #include <vm/vm_map.h>
64 #include <vm/pmap.h>
65 #include <ppc/pmap.h>
66 #include <ppc/Diagnostics.h>
67 #include <pexpert/pexpert.h>
68 #include <mach/machine.h>
69 #include <ppc/vmachmon.h>
70 #include <ppc/hw_perfmon.h>
71 #include <ppc/PPCcalls.h>
72 #include <ppc/mem.h>
73 #include <ppc/boot.h>
74 #include <ppc/lowglobals.h>
75
76 #if CONFIG_DTRACE
77 #define NEED_DTRACE_DEFS
78 #include <../bsd/sys/lockstat.h>
79 #endif
80
81 /* Undefine standard offsetof because it is different than the one here */
82 #undef offsetof
83 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE)0)->MEMBER)
84
85 #define DECLARE(SYM,VAL) \
86 __asm("#DEFINITION##define\t" SYM "\t%0" : : "n" ((u_int)(VAL)))
87
88 int main(int argc, char *argv[])
89 {
90 /* Process Control Block */
91 DECLARE("ACT_MACT_KSP", offsetof(thread_t, machine.ksp));
92 DECLARE("ACT_MACT_BEDA", offsetof(thread_t, machine.bbDescAddr));
93 DECLARE("ACT_MACT_BTS", offsetof(thread_t, machine.bbTableStart));
94 DECLARE("ACT_MACT_BTE", offsetof(thread_t, machine.bbTaskEnv));
95 DECLARE("ACT_MACT_SPF", offsetof(thread_t, machine.specFlags));
96 DECLARE("ACT_PREEMPT_CNT", offsetof(thread_t, machine.preemption_count));
97 DECLARE("ACT_PER_PROC", offsetof(thread_t, machine.PerProc));
98 DECLARE("qactTimer", offsetof(thread_t, machine.qactTimer));
99 DECLARE("umwSpace", offsetof(thread_t, machine.umwSpace));
100 DECLARE("umwRelo", offsetof(thread_t, machine.umwRelo));
101 DECLARE("umwSwitchAway", umwSwitchAway);
102 DECLARE("umwSwitchAwayb", umwSwitchAwayb);
103 DECLARE("bbTrap", offsetof(thread_t, machine.bbTrap));
104 DECLARE("bbSysCall", offsetof(thread_t, machine.bbSysCall));
105 DECLARE("bbInterrupt", offsetof(thread_t, machine.bbInterrupt));
106 DECLARE("bbPending", offsetof(thread_t, machine.bbPending));
107
108 DECLARE("floatUsed", floatUsed);
109 DECLARE("vectorUsed", vectorUsed);
110 DECLARE("runningVM", runningVM);
111 DECLARE("runningVMbit", runningVMbit);
112 DECLARE("floatCng", floatCng);
113 DECLARE("floatCngbit", floatCngbit);
114 DECLARE("vectorCng", vectorCng);
115 DECLARE("vectorCngbit", vectorCngbit);
116 DECLARE("userProtKey", userProtKey);
117 DECLARE("userProtKeybit", userProtKeybit);
118
119 DECLARE("bbThread", bbThread);
120 DECLARE("bbThreadbit", bbThreadbit);
121 DECLARE("bbNoMachSC", bbNoMachSC);
122 DECLARE("bbNoMachSCbit",bbNoMachSCbit);
123 DECLARE("bbPreemptive", bbPreemptive);
124 DECLARE("bbPreemptivebit", bbPreemptivebit);
125
126 DECLARE("fvChkb", fvChkb);
127 DECLARE("fvChk", fvChk);
128 DECLARE("FamVMena", FamVMena);
129 DECLARE("FamVMenabit", FamVMenabit);
130 DECLARE("FamVMmode", FamVMmode);
131 DECLARE("FamVMmodebit", FamVMmodebit);
132 DECLARE("perfMonitor", perfMonitor);
133 DECLARE("perfMonitorbit", perfMonitorbit);
134 DECLARE("OnProc", OnProc);
135 DECLARE("OnProcbit", OnProcbit);
136
137 /* Per Proc info structure */
138 DECLARE("PP_CPU_NUMBER", offsetof(struct per_proc_info *, cpu_number));
139 DECLARE("PP_CPU_FLAGS", offsetof(struct per_proc_info *, cpu_flags));
140 DECLARE("PP_ISTACKPTR", offsetof(struct per_proc_info *, istackptr));
141 DECLARE("PP_INTSTACK_TOP_SS", offsetof(struct per_proc_info *, intstack_top_ss));
142 DECLARE("PP_DEBSTACKPTR", offsetof(struct per_proc_info *, debstackptr));
143 DECLARE("PP_DEBSTACK_TOP_SS", offsetof(struct per_proc_info *, debstack_top_ss));
144 DECLARE("PP_HIBERNATE", offsetof(struct per_proc_info *, hibernate));
145 DECLARE("FPUowner", offsetof(struct per_proc_info *, FPU_owner));
146 DECLARE("VMXowner", offsetof(struct per_proc_info *, VMX_owner));
147 DECLARE("holdQFret", offsetof(struct per_proc_info *, holdQFret));
148 DECLARE("rtcPop", offsetof(struct per_proc_info *, rtcPop));
149
150 DECLARE("PP_PENDING_AST", offsetof(struct per_proc_info *, pending_ast));
151 DECLARE("quickfret", offsetof(struct per_proc_info *, quickfret));
152 DECLARE("lclfree", offsetof(struct per_proc_info *, lclfree));
153 DECLARE("lclfreecnt", offsetof(struct per_proc_info *, lclfreecnt));
154 DECLARE("PP_INTS_ENABLED", offsetof(struct per_proc_info *, interrupts_enabled));
155 DECLARE("UAW", offsetof(struct per_proc_info *, Uassist));
156 DECLARE("next_savearea", offsetof(struct per_proc_info *, next_savearea));
157 DECLARE("ppbbTaskEnv", offsetof(struct per_proc_info *, ppbbTaskEnv));
158 DECLARE("liveVRS", offsetof(struct per_proc_info *, liveVRSave));
159 DECLARE("spcFlags", offsetof(struct per_proc_info *, spcFlags));
160 DECLARE("spcTRc", offsetof(struct per_proc_info *, spcTRc));
161 DECLARE("spcTRp", offsetof(struct per_proc_info *, spcTRp));
162 DECLARE("ruptStamp", offsetof(struct per_proc_info *, ruptStamp));
163 DECLARE("pfAvailable", offsetof(struct per_proc_info *, pf.Available));
164 DECLARE("pfFloat", pfFloat);
165 DECLARE("pfFloatb", pfFloatb);
166 DECLARE("pfAltivec", pfAltivec);
167 DECLARE("pfAltivecb", pfAltivecb);
168 DECLARE("pfAvJava", pfAvJava);
169 DECLARE("pfAvJavab", pfAvJavab);
170 DECLARE("pfSMPcap", pfSMPcap);
171 DECLARE("pfSMPcapb", pfSMPcapb);
172 DECLARE("pfCanSleep", pfCanSleep);
173 DECLARE("pfCanSleepb", pfCanSleepb);
174 DECLARE("pfCanNap", pfCanNap);
175 DECLARE("pfCanNapb", pfCanNapb);
176 DECLARE("pfCanDoze", pfCanDoze);
177 DECLARE("pfCanDozeb", pfCanDozeb);
178 DECLARE("pfSlowNap", pfSlowNap);
179 DECLARE("pfSlowNapb", pfSlowNapb);
180 DECLARE("pfNoMuMMCK", pfNoMuMMCK);
181 DECLARE("pfNoMuMMCKb", pfNoMuMMCKb);
182 DECLARE("pfNoL2PFNap", pfNoL2PFNap);
183 DECLARE("pfNoL2PFNapb", pfNoL2PFNapb);
184 DECLARE("pfSCOMFixUp", pfSCOMFixUp);
185 DECLARE("pfSCOMFixUpb", pfSCOMFixUpb);
186 DECLARE("pfHasDcba", pfHasDcba);
187 DECLARE("pfHasDcbab", pfHasDcbab);
188 DECLARE("pfL1fa", pfL1fa);
189 DECLARE("pfL1fab", pfL1fab);
190 DECLARE("pfL2", pfL2);
191 DECLARE("pfL2b", pfL2b);
192 DECLARE("pfL2fa", pfL2fa);
193 DECLARE("pfL2fab", pfL2fab);
194 DECLARE("pfL2i", pfL2i);
195 DECLARE("pfL2ib", pfL2ib);
196 DECLARE("pfLClck", pfLClck);
197 DECLARE("pfLClckb", pfLClckb);
198 DECLARE("pfWillNap", pfWillNap);
199 DECLARE("pfWillNapb", pfWillNapb);
200 DECLARE("pfNoMSRir", pfNoMSRir);
201 DECLARE("pfNoMSRirb", pfNoMSRirb);
202 DECLARE("pfL3pdet", pfL3pdet);
203 DECLARE("pfL3pdetb", pfL3pdetb);
204 DECLARE("pf128Byte", pf128Byte);
205 DECLARE("pf128Byteb", pf128Byteb);
206 DECLARE("pf32Byte", pf32Byte);
207 DECLARE("pf32Byteb", pf32Byteb);
208 DECLARE("pf64Bit", pf64Bit);
209 DECLARE("pf64Bitb", pf64Bitb);
210 DECLARE("pfL3", pfL3);
211 DECLARE("pfL3b", pfL3b);
212 DECLARE("pfL3fa", pfL3fa);
213 DECLARE("pfL3fab", pfL3fab);
214 DECLARE("pfValid", pfValid);
215 DECLARE("pfValidb", pfValidb);
216 DECLARE("pfrptdProc", offsetof(struct per_proc_info *, pf.rptdProc));
217 DECLARE("pflineSize", offsetof(struct per_proc_info *, pf.lineSize));
218 DECLARE("pfl1iSize", offsetof(struct per_proc_info *, pf.l1iSize));
219 DECLARE("pfl1dSize", offsetof(struct per_proc_info *, pf.l1dSize));
220 DECLARE("pfl2cr", offsetof(struct per_proc_info *, pf.l2cr));
221 DECLARE("pfl2Size", offsetof(struct per_proc_info *, pf.l2Size));
222 DECLARE("pfl3cr", offsetof(struct per_proc_info *, pf.l3cr));
223 DECLARE("pfl3Size", offsetof(struct per_proc_info *, pf.l3Size));
224 DECLARE("pfHID0", offsetof(struct per_proc_info *, pf.pfHID0));
225 DECLARE("pfHID1", offsetof(struct per_proc_info *, pf.pfHID1));
226 DECLARE("pfHID2", offsetof(struct per_proc_info *, pf.pfHID2));
227 DECLARE("pfHID3", offsetof(struct per_proc_info *, pf.pfHID3));
228 DECLARE("pfHID4", offsetof(struct per_proc_info *, pf.pfHID4));
229 DECLARE("pfHID5", offsetof(struct per_proc_info *, pf.pfHID5));
230 DECLARE("pfMSSCR0", offsetof(struct per_proc_info *, pf.pfMSSCR0));
231 DECLARE("pfMSSCR1", offsetof(struct per_proc_info *, pf.pfMSSCR1));
232 DECLARE("pfICTRL", offsetof(struct per_proc_info *, pf.pfICTRL));
233 DECLARE("pfLDSTCR", offsetof(struct per_proc_info *, pf.pfLDSTCR));
234 DECLARE("pfLDSTDB", offsetof(struct per_proc_info *, pf.pfLDSTDB));
235 DECLARE("pfl2crOriginal", offsetof(struct per_proc_info *, pf.l2crOriginal));
236 DECLARE("pfl3crOriginal", offsetof(struct per_proc_info *, pf.l3crOriginal));
237 DECLARE("pfBootConfig", offsetof(struct per_proc_info *, pf.pfBootConfig));
238 DECLARE("pfPowerModes", offsetof(struct per_proc_info *, pf.pfPowerModes));
239 DECLARE("pfPowerTune0", offsetof(struct per_proc_info *, pf.pfPowerTune0));
240 DECLARE("pfPowerTune1", offsetof(struct per_proc_info *, pf.pfPowerTune1));
241 DECLARE("pmType", pmType);
242 DECLARE("pmDPLLVmin", pmDPLLVmin);
243 DECLARE("pmDPLLVminb", pmDPLLVminb);
244 DECLARE("pmPowerTune", pmPowerTune);
245 DECLARE("pmDFS", pmDFS);
246 DECLARE("pmDualPLL", pmDualPLL);
247 DECLARE("pfPTEG", offsetof(struct per_proc_info *, pf.pfPTEG));
248 DECLARE("pfMaxVAddr", offsetof(struct per_proc_info *, pf.pfMaxVAddr));
249 DECLARE("pfMaxPAddr", offsetof(struct per_proc_info *, pf.pfMaxPAddr));
250 DECLARE("pfSize", sizeof(procFeatures));
251
252 DECLARE("validSegs", offsetof(struct per_proc_info *, validSegs));
253 DECLARE("ppUserPmapVirt", offsetof(struct per_proc_info *, ppUserPmapVirt));
254 DECLARE("ppUserPmap", offsetof(struct per_proc_info *, ppUserPmap));
255 DECLARE("ppMapFlags", offsetof(struct per_proc_info *, ppMapFlags));
256 DECLARE("ppInvSeg", offsetof(struct per_proc_info *, ppInvSeg));
257 DECLARE("ppCurSeg", offsetof(struct per_proc_info *, ppCurSeg));
258 DECLARE("ppSegSteal", offsetof(struct per_proc_info *, ppSegSteal));
259
260 DECLARE("VMMareaPhys", offsetof(struct per_proc_info *, VMMareaPhys));
261 DECLARE("VMMXAFlgs", offsetof(struct per_proc_info *, VMMXAFlgs));
262 DECLARE("FAMintercept", offsetof(struct per_proc_info *, FAMintercept));
263
264 DECLARE("ppUMWmp", offsetof(struct per_proc_info *, ppUMWmp));
265
266 DECLARE("tempr0", offsetof(struct per_proc_info *, tempr0));
267 DECLARE("tempr1", offsetof(struct per_proc_info *, tempr1));
268 DECLARE("tempr2", offsetof(struct per_proc_info *, tempr2));
269 DECLARE("tempr3", offsetof(struct per_proc_info *, tempr3));
270 DECLARE("tempr4", offsetof(struct per_proc_info *, tempr4));
271 DECLARE("tempr5", offsetof(struct per_proc_info *, tempr5));
272 DECLARE("tempr6", offsetof(struct per_proc_info *, tempr6));
273 DECLARE("tempr7", offsetof(struct per_proc_info *, tempr7));
274 DECLARE("tempr8", offsetof(struct per_proc_info *, tempr8));
275 DECLARE("tempr9", offsetof(struct per_proc_info *, tempr9));
276 DECLARE("tempr10", offsetof(struct per_proc_info *, tempr10));
277 DECLARE("tempr11", offsetof(struct per_proc_info *, tempr11));
278 DECLARE("tempr12", offsetof(struct per_proc_info *, tempr12));
279 DECLARE("tempr13", offsetof(struct per_proc_info *, tempr13));
280 DECLARE("tempr14", offsetof(struct per_proc_info *, tempr14));
281 DECLARE("tempr15", offsetof(struct per_proc_info *, tempr15));
282 DECLARE("tempr16", offsetof(struct per_proc_info *, tempr16));
283 DECLARE("tempr17", offsetof(struct per_proc_info *, tempr17));
284 DECLARE("tempr18", offsetof(struct per_proc_info *, tempr18));
285 DECLARE("tempr19", offsetof(struct per_proc_info *, tempr19));
286 DECLARE("tempr20", offsetof(struct per_proc_info *, tempr20));
287 DECLARE("tempr21", offsetof(struct per_proc_info *, tempr21));
288 DECLARE("tempr22", offsetof(struct per_proc_info *, tempr22));
289 DECLARE("tempr23", offsetof(struct per_proc_info *, tempr23));
290 DECLARE("tempr24", offsetof(struct per_proc_info *, tempr24));
291 DECLARE("tempr25", offsetof(struct per_proc_info *, tempr25));
292 DECLARE("tempr26", offsetof(struct per_proc_info *, tempr26));
293 DECLARE("tempr27", offsetof(struct per_proc_info *, tempr27));
294 DECLARE("tempr28", offsetof(struct per_proc_info *, tempr28));
295 DECLARE("tempr29", offsetof(struct per_proc_info *, tempr29));
296 DECLARE("tempr30", offsetof(struct per_proc_info *, tempr30));
297 DECLARE("tempr31", offsetof(struct per_proc_info *, tempr31));
298
299 DECLARE("emfp0", offsetof(struct per_proc_info *, emfp0));
300 DECLARE("emfp1", offsetof(struct per_proc_info *, emfp1));
301 DECLARE("emfp2", offsetof(struct per_proc_info *, emfp2));
302 DECLARE("emfp3", offsetof(struct per_proc_info *, emfp3));
303 DECLARE("emfp4", offsetof(struct per_proc_info *, emfp4));
304 DECLARE("emfp5", offsetof(struct per_proc_info *, emfp5));
305 DECLARE("emfp6", offsetof(struct per_proc_info *, emfp6));
306 DECLARE("emfp7", offsetof(struct per_proc_info *, emfp7));
307 DECLARE("emfp8", offsetof(struct per_proc_info *, emfp8));
308 DECLARE("emfp9", offsetof(struct per_proc_info *, emfp9));
309 DECLARE("emfp10", offsetof(struct per_proc_info *, emfp10));
310 DECLARE("emfp11", offsetof(struct per_proc_info *, emfp11));
311 DECLARE("emfp12", offsetof(struct per_proc_info *, emfp12));
312 DECLARE("emfp13", offsetof(struct per_proc_info *, emfp13));
313 DECLARE("emfp14", offsetof(struct per_proc_info *, emfp14));
314 DECLARE("emfp15", offsetof(struct per_proc_info *, emfp15));
315 DECLARE("emfp16", offsetof(struct per_proc_info *, emfp16));
316 DECLARE("emfp17", offsetof(struct per_proc_info *, emfp17));
317 DECLARE("emfp18", offsetof(struct per_proc_info *, emfp18));
318 DECLARE("emfp19", offsetof(struct per_proc_info *, emfp19));
319 DECLARE("emfp20", offsetof(struct per_proc_info *, emfp20));
320 DECLARE("emfp21", offsetof(struct per_proc_info *, emfp21));
321 DECLARE("emfp22", offsetof(struct per_proc_info *, emfp22));
322 DECLARE("emfp23", offsetof(struct per_proc_info *, emfp23));
323 DECLARE("emfp24", offsetof(struct per_proc_info *, emfp24));
324 DECLARE("emfp25", offsetof(struct per_proc_info *, emfp25));
325 DECLARE("emfp26", offsetof(struct per_proc_info *, emfp26));
326 DECLARE("emfp27", offsetof(struct per_proc_info *, emfp27));
327 DECLARE("emfp28", offsetof(struct per_proc_info *, emfp28));
328 DECLARE("emfp29", offsetof(struct per_proc_info *, emfp29));
329 DECLARE("emfp30", offsetof(struct per_proc_info *, emfp30));
330 DECLARE("emfp31", offsetof(struct per_proc_info *, emfp31));
331 DECLARE("emfpscr_pad", offsetof(struct per_proc_info *, emfpscr_pad));
332 DECLARE("emfpscr", offsetof(struct per_proc_info *, emfpscr));
333
334 DECLARE("emvr0", offsetof(struct per_proc_info *, emvr0));
335 DECLARE("emvr1", offsetof(struct per_proc_info *, emvr1));
336 DECLARE("emvr2", offsetof(struct per_proc_info *, emvr2));
337 DECLARE("emvr3", offsetof(struct per_proc_info *, emvr3));
338 DECLARE("emvr4", offsetof(struct per_proc_info *, emvr4));
339 DECLARE("emvr5", offsetof(struct per_proc_info *, emvr5));
340 DECLARE("emvr6", offsetof(struct per_proc_info *, emvr6));
341 DECLARE("emvr7", offsetof(struct per_proc_info *, emvr7));
342 DECLARE("emvr8", offsetof(struct per_proc_info *, emvr8));
343 DECLARE("emvr9", offsetof(struct per_proc_info *, emvr9));
344 DECLARE("emvr10", offsetof(struct per_proc_info *, emvr10));
345 DECLARE("emvr11", offsetof(struct per_proc_info *, emvr11));
346 DECLARE("emvr12", offsetof(struct per_proc_info *, emvr12));
347 DECLARE("emvr13", offsetof(struct per_proc_info *, emvr13));
348 DECLARE("emvr14", offsetof(struct per_proc_info *, emvr14));
349 DECLARE("emvr15", offsetof(struct per_proc_info *, emvr15));
350 DECLARE("emvr16", offsetof(struct per_proc_info *, emvr16));
351 DECLARE("emvr17", offsetof(struct per_proc_info *, emvr17));
352 DECLARE("emvr18", offsetof(struct per_proc_info *, emvr18));
353 DECLARE("emvr19", offsetof(struct per_proc_info *, emvr19));
354 DECLARE("emvr20", offsetof(struct per_proc_info *, emvr20));
355 DECLARE("emvr21", offsetof(struct per_proc_info *, emvr21));
356 DECLARE("emvr22", offsetof(struct per_proc_info *, emvr22));
357 DECLARE("emvr23", offsetof(struct per_proc_info *, emvr23));
358 DECLARE("emvr24", offsetof(struct per_proc_info *, emvr24));
359 DECLARE("emvr25", offsetof(struct per_proc_info *, emvr25));
360 DECLARE("emvr26", offsetof(struct per_proc_info *, emvr26));
361 DECLARE("emvr27", offsetof(struct per_proc_info *, emvr27));
362 DECLARE("emvr28", offsetof(struct per_proc_info *, emvr28));
363 DECLARE("emvr29", offsetof(struct per_proc_info *, emvr29));
364 DECLARE("emvr30", offsetof(struct per_proc_info *, emvr30));
365 DECLARE("emvr31", offsetof(struct per_proc_info *, emvr31));
366 DECLARE("empadvr", offsetof(struct per_proc_info *, empadvr));
367 DECLARE("skipListPrev", offsetof(struct per_proc_info *, skipListPrev));
368 DECLARE("ppSize", sizeof(struct per_proc_info));
369 DECLARE("ppe_paddr", offsetof(struct per_proc_entry *, ppe_paddr));
370 DECLARE("ppe_vaddr", offsetof(struct per_proc_entry *, ppe_vaddr));
371 DECLARE("ppeSize", sizeof(struct per_proc_entry));
372 DECLARE("MAX_CPUS", MAX_CPUS);
373 DECLARE("patcharea", offsetof(struct per_proc_info *, patcharea));
374
375 DECLARE("hwCounts", offsetof(struct per_proc_info *, hwCtr));
376 DECLARE("hwInVains", offsetof(struct per_proc_info *, hwCtr.hwInVains));
377 DECLARE("hwResets", offsetof(struct per_proc_info *, hwCtr.hwResets));
378 DECLARE("hwMachineChecks", offsetof(struct per_proc_info *, hwCtr.hwMachineChecks));
379 DECLARE("hwDSIs", offsetof(struct per_proc_info *, hwCtr.hwDSIs));
380 DECLARE("hwISIs", offsetof(struct per_proc_info *, hwCtr.hwISIs));
381 DECLARE("hwExternals", offsetof(struct per_proc_info *, hwCtr.hwExternals));
382 DECLARE("hwAlignments", offsetof(struct per_proc_info *, hwCtr.hwAlignments));
383 DECLARE("hwPrograms", offsetof(struct per_proc_info *, hwCtr.hwPrograms));
384 DECLARE("hwFloatPointUnavailable", offsetof(struct per_proc_info *, hwCtr.hwFloatPointUnavailable));
385 DECLARE("hwDecrementers", offsetof(struct per_proc_info *, hwCtr.hwDecrementers));
386 DECLARE("hwIOErrors", offsetof(struct per_proc_info *, hwCtr.hwIOErrors));
387 DECLARE("hwrsvd0", offsetof(struct per_proc_info *, hwCtr.hwrsvd0));
388 DECLARE("hwSystemCalls", offsetof(struct per_proc_info *, hwCtr.hwSystemCalls));
389 DECLARE("hwTraces", offsetof(struct per_proc_info *, hwCtr.hwTraces));
390 DECLARE("hwFloatingPointAssists", offsetof(struct per_proc_info *, hwCtr.hwFloatingPointAssists));
391 DECLARE("hwPerformanceMonitors", offsetof(struct per_proc_info *, hwCtr.hwPerformanceMonitors));
392 DECLARE("hwAltivecs", offsetof(struct per_proc_info *, hwCtr.hwAltivecs));
393 DECLARE("hwrsvd1", offsetof(struct per_proc_info *, hwCtr.hwrsvd1));
394 DECLARE("hwrsvd2", offsetof(struct per_proc_info *, hwCtr.hwrsvd2));
395 DECLARE("hwrsvd3", offsetof(struct per_proc_info *, hwCtr.hwrsvd3));
396 DECLARE("hwInstBreakpoints", offsetof(struct per_proc_info *, hwCtr.hwInstBreakpoints));
397 DECLARE("hwSystemManagements", offsetof(struct per_proc_info *, hwCtr.hwSystemManagements));
398 DECLARE("hwAltivecAssists", offsetof(struct per_proc_info *, hwCtr.hwAltivecAssists));
399 DECLARE("hwThermal", offsetof(struct per_proc_info *, hwCtr.hwThermal));
400 DECLARE("hwrsvd5", offsetof(struct per_proc_info *, hwCtr.hwrsvd5));
401 DECLARE("hwrsvd6", offsetof(struct per_proc_info *, hwCtr.hwrsvd6));
402 DECLARE("hwrsvd7", offsetof(struct per_proc_info *, hwCtr.hwrsvd7));
403 DECLARE("hwrsvd8", offsetof(struct per_proc_info *, hwCtr.hwrsvd8));
404 DECLARE("hwrsvd9", offsetof(struct per_proc_info *, hwCtr.hwrsvd9));
405 DECLARE("hwrsvd10", offsetof(struct per_proc_info *, hwCtr.hwrsvd10));
406 DECLARE("hwrsvd11", offsetof(struct per_proc_info *, hwCtr.hwrsvd11));
407 DECLARE("hwrsvd12", offsetof(struct per_proc_info *, hwCtr.hwrsvd12));
408 DECLARE("hwrsvd13", offsetof(struct per_proc_info *, hwCtr.hwrsvd13));
409 DECLARE("hwTrace601", offsetof(struct per_proc_info *, hwCtr.hwTrace601));
410 DECLARE("hwSIGPs", offsetof(struct per_proc_info *, hwCtr.hwSIGPs));
411 DECLARE("hwPreemptions", offsetof(struct per_proc_info *, hwCtr.hwPreemptions));
412 DECLARE("hwContextSwitchs", offsetof(struct per_proc_info *, hwCtr.hwContextSwitchs));
413 DECLARE("hwShutdowns", offsetof(struct per_proc_info *, hwCtr.hwShutdowns));
414 DECLARE("hwChokes", offsetof(struct per_proc_info *, hwCtr.hwChokes));
415 DECLARE("hwDataSegments", offsetof(struct per_proc_info *, hwCtr.hwDataSegments));
416 DECLARE("hwInstructionSegments", offsetof(struct per_proc_info *, hwCtr.hwInstructionSegments));
417 DECLARE("hwSoftPatches", offsetof(struct per_proc_info *, hwCtr.hwSoftPatches));
418 DECLARE("hwMaintenances", offsetof(struct per_proc_info *, hwCtr.hwMaintenances));
419 DECLARE("hwInstrumentations", offsetof(struct per_proc_info *, hwCtr.hwInstrumentations));
420 DECLARE("hwRedrives", offsetof(struct per_proc_info *, hwCtr.hwRedrives));
421 DECLARE("hwIgnored", offsetof(struct per_proc_info *, hwCtr.hwIgnored));
422 DECLARE("hwhdec", offsetof(struct per_proc_info *, hwCtr.hwhdec));
423 DECLARE("hwSteals", offsetof(struct per_proc_info *, hwCtr.hwSteals));
424
425 DECLARE("hwWalkPhys", offsetof(struct per_proc_info *, hwCtr.hwWalkPhys));
426 DECLARE("hwWalkFull", offsetof(struct per_proc_info *, hwCtr.hwWalkFull));
427 DECLARE("hwWalkMerge", offsetof(struct per_proc_info *, hwCtr.hwWalkMerge));
428 DECLARE("hwWalkQuick", offsetof(struct per_proc_info *, hwCtr.hwWalkQuick));
429
430 DECLARE("hwMckHang", offsetof(struct per_proc_info *, hwCtr.hwMckHang));
431 DECLARE("hwMckSLBPE", offsetof(struct per_proc_info *, hwCtr.hwMckSLBPE));
432 DECLARE("hwMckTLBPE", offsetof(struct per_proc_info *, hwCtr.hwMckTLBPE));
433 DECLARE("hwMckERCPE", offsetof(struct per_proc_info *, hwCtr.hwMckERCPE));
434 DECLARE("hwMckL1DPE", offsetof(struct per_proc_info *, hwCtr.hwMckL1DPE));
435 DECLARE("hwMckL1TPE", offsetof(struct per_proc_info *, hwCtr.hwMckL1TPE));
436 DECLARE("hwMckUE", offsetof(struct per_proc_info *, hwCtr.hwMckUE));
437 DECLARE("hwMckIUE", offsetof(struct per_proc_info *, hwCtr.hwMckIUE));
438 DECLARE("hwMckIUEr", offsetof(struct per_proc_info *, hwCtr.hwMckIUEr));
439 DECLARE("hwMckDUE", offsetof(struct per_proc_info *, hwCtr.hwMckDUE));
440 DECLARE("hwMckDTW", offsetof(struct per_proc_info *, hwCtr.hwMckDTW));
441 DECLARE("hwMckUnk", offsetof(struct per_proc_info *, hwCtr.hwMckUnk));
442 DECLARE("hwMckExt", offsetof(struct per_proc_info *, hwCtr.hwMckExt));
443 DECLARE("hwMckICachePE", offsetof(struct per_proc_info *, hwCtr.hwMckICachePE));
444 DECLARE("hwMckITagPE", offsetof(struct per_proc_info *, hwCtr.hwMckITagPE));
445 DECLARE("hwMckIEratPE", offsetof(struct per_proc_info *, hwCtr.hwMckIEratPE));
446 DECLARE("hwMckDEratPE", offsetof(struct per_proc_info *, hwCtr.hwMckDEratPE));
447
448 DECLARE("ijsave", offsetof(struct per_proc_info *, ijsave));
449
450 DECLARE("napStamp", offsetof(struct per_proc_info *, hwCtr.napStamp));
451 DECLARE("napTotal", offsetof(struct per_proc_info *, hwCtr.napTotal));
452 DECLARE("PP_PROCESSOR", offsetof(struct per_proc_info *, processor[0]));
453 DECLARE("PP_PROCESSOR_SIZE", sizeof(((struct per_proc_info *)0)->processor));
454 DECLARE("PROCESSOR_SIZE", sizeof (struct processor));
455
456 DECLARE("patchAddr", offsetof(struct patch_entry *, addr));
457 DECLARE("patchData", offsetof(struct patch_entry *, data));
458 DECLARE("patchType", offsetof(struct patch_entry *, type));
459 DECLARE("patchValue", offsetof(struct patch_entry *, value));
460 DECLARE("peSize", sizeof(patch_entry_t));
461 DECLARE("PATCH_PROCESSOR", PATCH_PROCESSOR);
462 DECLARE("PATCH_FEATURE", PATCH_FEATURE);
463 DECLARE("PATCH_END_OF_TABLE", PATCH_END_OF_TABLE);
464 DECLARE("PatchExt32", PatchExt32);
465 DECLARE("PatchExt32b", PatchExt32b);
466 DECLARE("PatchLwsync", PatchLwsync);
467 DECLARE("PatchLwsyncb", PatchLwsyncb);
468
469 DECLARE("RESETHANDLER_TYPE", offsetof(struct resethandler *, type));
470 DECLARE("RESETHANDLER_CALL", offsetof(struct resethandler *, call_paddr));
471 DECLARE("RESETHANDLER_ARG", offsetof(struct resethandler *, arg__paddr));
472
473 /* we want offset from
474 * bottom of kernel stack, not offset into structure
475 */
476 #define IKSBASE (u_int)STACK_IKS(0)
477
478 /* values from kern/thread.h */
479 DECLARE("THREAD_STATE", offsetof(thread_t, state));
480 DECLARE("TH_IDLE", TH_IDLE);
481 DECLARE("THREAD_KERNEL_STACK", offsetof(thread_t, kernel_stack));
482 DECLARE("THREAD_RECOVER", offsetof(thread_t, recover));
483 DECLARE("THREAD_FUNNEL_LOCK",
484 offsetof(thread_t, funnel_lock));
485 DECLARE("THREAD_FUNNEL_STATE",
486 offsetof(thread_t, funnel_state));
487 DECLARE("LOCK_FNL_MUTEX",
488 offsetof(struct funnel_lock *, fnl_mutex));
489
490 DECLARE("ACT_TASK", offsetof(thread_t, task));
491 DECLARE("ACT_MACT_PCB", offsetof(thread_t, machine.pcb));
492 DECLARE("ACT_MACT_UPCB", offsetof(thread_t, machine.upcb));
493 DECLARE("ACT_AST", offsetof(thread_t, ast));
494 DECLARE("ACT_VMMAP", offsetof(thread_t, map));
495 DECLARE("vmmCEntry", offsetof(thread_t, machine.vmmCEntry));
496 DECLARE("vmmControl", offsetof(thread_t, machine.vmmControl));
497 DECLARE("curctx", offsetof(thread_t, machine.curctx));
498 DECLARE("deferctx", offsetof(thread_t, machine.deferctx));
499 DECLARE("facctx", offsetof(thread_t, machine.facctx));
500 #ifdef MACH_BSD
501 DECLARE("CTHREAD_SELF", offsetof(thread_t, machine.cthread_self));
502 #endif
503
504 DECLARE("FPUsave", offsetof(struct facility_context *,FPUsave));
505 DECLARE("FPUlevel", offsetof(struct facility_context *,FPUlevel));
506 DECLARE("FPUcpu", offsetof(struct facility_context *,FPUcpu));
507 DECLARE("FPUsync", offsetof(struct facility_context *,FPUsync));
508 DECLARE("VMXsave", offsetof(struct facility_context *,VMXsave));
509 DECLARE("VMXlevel", offsetof(struct facility_context *,VMXlevel));
510 DECLARE("VMXcpu", offsetof(struct facility_context *,VMXcpu));
511 DECLARE("VMXsync", offsetof(struct facility_context *,VMXsync));
512 DECLARE("facAct", offsetof(struct facility_context *,facAct));
513
514 /* Values from vmachmon.h */
515
516 DECLARE("kVmmGetVersion", kVmmGetVersion);
517 DECLARE("kVmmvGetFeatures", kVmmvGetFeatures);
518 DECLARE("kVmmInitContext", kVmmInitContext);
519 DECLARE("kVmmTearDownContext", kVmmTearDownContext);
520 DECLARE("kVmmTearDownAll", kVmmTearDownAll);
521 DECLARE("kVmmMapPage", kVmmMapPage);
522 DECLARE("kVmmGetPageMapping", kVmmGetPageMapping);
523 DECLARE("kVmmUnmapPage", kVmmUnmapPage);
524 DECLARE("kVmmUnmapAllPages", kVmmUnmapAllPages);
525 DECLARE("kVmmGetPageDirtyFlag", kVmmGetPageDirtyFlag);
526 DECLARE("kVmmGetFloatState", kVmmGetFloatState);
527 DECLARE("kVmmGetVectorState", kVmmGetVectorState);
528 DECLARE("kVmmSetTimer", kVmmSetTimer);
529 DECLARE("kVmmGetTimer", kVmmGetTimer);
530 DECLARE("kVmmExecuteVM", kVmmExecuteVM);
531 DECLARE("kVmmProtectPage", kVmmProtectPage);
532 DECLARE("kVmmMapList", kVmmMapList);
533 DECLARE("kVmmUnmapList", kVmmUnmapList);
534 DECLARE("kVmmActivateXA", kVmmActivateXA);
535 DECLARE("kVmmDeactivateXA", kVmmDeactivateXA);
536 DECLARE("kVmmGetXA", kVmmGetXA);
537 DECLARE("kVmmMapPage64", kVmmMapPage64);
538 DECLARE("kVmmGetPageMapping64", kVmmGetPageMapping64);
539 DECLARE("kVmmUnmapPage64", kVmmUnmapPage64);
540 DECLARE("kVmmGetPageDirtyFlag64", kVmmGetPageDirtyFlag64);
541 DECLARE("kVmmMapExecute64", kVmmMapExecute64);
542 DECLARE("kVmmProtectExecute64", kVmmProtectExecute64);
543 DECLARE("kVmmMapList64", kVmmMapList64);
544 DECLARE("kVmmUnmapList64", kVmmUnmapList64);
545 DECLARE("kvmmExitToHost", kvmmExitToHost);
546 DECLARE("kvmmResumeGuest", kvmmResumeGuest);
547 DECLARE("kvmmGetGuestRegister", kvmmGetGuestRegister);
548 DECLARE("kvmmSetGuestRegister", kvmmSetGuestRegister);
549
550 DECLARE("kVmmReturnNull", kVmmReturnNull);
551 DECLARE("kVmmStopped", kVmmStopped);
552 DECLARE("kVmmBogusContext", kVmmBogusContext);
553 DECLARE("kVmmReturnDataPageFault", kVmmReturnDataPageFault);
554 DECLARE("kVmmReturnInstrPageFault", kVmmReturnInstrPageFault);
555 DECLARE("kVmmReturnAlignmentFault", kVmmReturnAlignmentFault);
556 DECLARE("kVmmReturnProgramException", kVmmReturnProgramException);
557 DECLARE("kVmmReturnSystemCall", kVmmReturnSystemCall);
558 DECLARE("kVmmReturnTraceException", kVmmReturnTraceException);
559 DECLARE("kVmmInvalidAdSpace", kVmmInvalidAdSpace);
560
561 DECLARE("kVmmProtXtnd", kVmmProtXtnd);
562 DECLARE("kVmmProtNARW", kVmmProtNARW);
563 DECLARE("kVmmProtRORW", kVmmProtRORW);
564 DECLARE("kVmmProtRWRW", kVmmProtRWRW);
565 DECLARE("kVmmProtRORO", kVmmProtRORO);
566
567 DECLARE("vmmFlags", offsetof(struct vmmCntrlEntry *, vmmFlags));
568 DECLARE("vmmXAFlgs", offsetof(struct vmmCntrlEntry *, vmmXAFlgs));
569 DECLARE("vmmPmap", offsetof(struct vmmCntrlEntry *, vmmPmap));
570 DECLARE("vmmInUseb", vmmInUseb);
571 DECLARE("vmmInUse", vmmInUse);
572 DECLARE("vmmContextKern", offsetof(struct vmmCntrlEntry *, vmmContextKern));
573 DECLARE("vmmContextPhys", offsetof(struct vmmCntrlEntry *, vmmContextPhys));
574 DECLARE("vmmContextUser", offsetof(struct vmmCntrlEntry *, vmmContextUser));
575 DECLARE("vmmFacCtx", offsetof(struct vmmCntrlEntry *, vmmFacCtx));
576 DECLARE("vmmLastMap", offsetof(struct vmmCntrlTable *, vmmLastMap));
577 DECLARE("vmmGFlags", offsetof(struct vmmCntrlTable *, vmmGFlags));
578 DECLARE("vmmc", offsetof(struct vmmCntrlTable *, vmmc));
579 DECLARE("vmmAdsp", offsetof(struct vmmCntrlTable *, vmmAdsp));
580 DECLARE("vmmLastAdSp", vmmLastAdSp);
581 DECLARE("vmmFAMintercept", offsetof(struct vmmCntrlEntry *, vmmFAMintercept));
582 DECLARE("vmmCEntrySize", sizeof(struct vmmCntrlEntry));
583 DECLARE("kVmmMaxContexts", kVmmMaxContexts);
584
585 DECLARE("interface_version", offsetof(struct vmm_state_page_t *, interface_version));
586 DECLARE("thread_index", offsetof(struct vmm_state_page_t *, thread_index));
587 DECLARE("vmmStat", offsetof(struct vmm_state_page_t *, vmmStat));
588 DECLARE("vmmCntrl", offsetof(struct vmm_state_page_t *, vmmCntrl));
589 DECLARE("vmm_proc_state", offsetof(struct vmm_state_page_t *, vmm_proc_state));
590
591 DECLARE("return_code", offsetof(struct vmm_state_page_t *, return_code));
592
593 DECLARE("return_params", offsetof(struct vmm_state_page_t *, vmmRet.vmmrp32.return_params));
594 DECLARE("return_paramsX", offsetof(struct vmm_state_page_t *, vmmRet.vmmrp64.return_params));
595
596 #if 0
597 DECLARE("return_params", offsetof(struct vmm_state_page_t *, return_params));
598 DECLARE("vmm_proc_state", offsetof(struct vmm_state_page_t *, vmm_proc_state));
599 #endif
600 DECLARE("vmmppcVRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVRs));
601 DECLARE("vmmppcVSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCR));
602 DECLARE("vmmppcFPRs", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPRs));
603 DECLARE("vmmppcFPSCR", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR));
604
605 DECLARE("vmmppcpc", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcPC));
606 DECLARE("vmmppcmsr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcMSR));
607 DECLARE("vmmppcr0", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x00));
608 DECLARE("vmmppcr1", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x04));
609 DECLARE("vmmppcr2", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x08));
610 DECLARE("vmmppcr3", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x0C));
611 DECLARE("vmmppcr4", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x10));
612 DECLARE("vmmppcr5", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x14));
613
614 DECLARE("vmmppcr6", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x18));
615 DECLARE("vmmppcr7", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x1C));
616 DECLARE("vmmppcr8", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x20));
617 DECLARE("vmmppcr9", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x24));
618 DECLARE("vmmppcr10", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x28));
619 DECLARE("vmmppcr11", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x2C));
620 DECLARE("vmmppcr12", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x30));
621 DECLARE("vmmppcr13", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x34));
622
623 DECLARE("vmmppcr14", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x38));
624 DECLARE("vmmppcr15", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x3C));
625 DECLARE("vmmppcr16", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x40));
626 DECLARE("vmmppcr17", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x44));
627 DECLARE("vmmppcr18", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x48));
628 DECLARE("vmmppcr19", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x4C));
629 DECLARE("vmmppcr20", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x50));
630 DECLARE("vmmppcr21", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x54));
631
632 DECLARE("vmmppcr22", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x58));
633 DECLARE("vmmppcr23", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x5C));
634 DECLARE("vmmppcr24", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x60));
635 DECLARE("vmmppcr25", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x64));
636 DECLARE("vmmppcr26", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x68));
637 DECLARE("vmmppcr27", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x6C));
638 DECLARE("vmmppcr28", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x70));
639 DECLARE("vmmppcr29", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x74));
640
641 DECLARE("vmmppcr30", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x78));
642 DECLARE("vmmppcr31", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcGPRs+0x7C));
643 DECLARE("vmmppccr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcCR));
644 DECLARE("vmmppcxer", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcXER));
645 DECLARE("vmmppclr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcLR));
646 DECLARE("vmmppcctr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcCTR));
647 DECLARE("vmmppcmq", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcMQ));
648 DECLARE("vmmppcvrsave", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs32.ppcVRSave));
649
650 DECLARE("vmmppcXpc", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcPC));
651 DECLARE("vmmppcXmsr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcMSR));
652 DECLARE("vmmppcXr0", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x00));
653 DECLARE("vmmppcXr1", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x08));
654 DECLARE("vmmppcXr2", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x10));
655 DECLARE("vmmppcXr3", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x18));
656 DECLARE("vmmppcXr4", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x20));
657 DECLARE("vmmppcXr5", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x28));
658
659 DECLARE("vmmppcXr6", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x30));
660 DECLARE("vmmppcXr7", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x38));
661 DECLARE("vmmppcXr8", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x40));
662 DECLARE("vmmppcXr9", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x48));
663 DECLARE("vmmppcXr10", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x50));
664 DECLARE("vmmppcXr11", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x58));
665 DECLARE("vmmppcXr12", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x60));
666 DECLARE("vmmppcXr13", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x68));
667
668 DECLARE("vmmppcXr14", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x70));
669 DECLARE("vmmppcXr15", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x78));
670 DECLARE("vmmppcXr16", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x80));
671 DECLARE("vmmppcXr17", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x88));
672 DECLARE("vmmppcXr18", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x90));
673 DECLARE("vmmppcXr19", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0x98));
674 DECLARE("vmmppcXr20", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xA0));
675 DECLARE("vmmppcXr21", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xA8));
676
677 DECLARE("vmmppcXr22", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xB0));
678 DECLARE("vmmppcXr23", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xB8));
679 DECLARE("vmmppcXr24", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xC0));
680 DECLARE("vmmppcXr25", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xC8));
681 DECLARE("vmmppcXr26", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xD0));
682 DECLARE("vmmppcXr27", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xD8));
683 DECLARE("vmmppcXr28", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xE0));
684 DECLARE("vmmppcXr29", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xE8));
685
686 DECLARE("vmmppcXr30", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xF0));
687 DECLARE("vmmppcXr31", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcGPRs+0xF8));
688 DECLARE("vmmppcXcr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcCR));
689 DECLARE("vmmppcXxer", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcXER));
690 DECLARE("vmmppcXlr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcLR));
691 DECLARE("vmmppcXctr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcCTR));
692 DECLARE("vmmppcXvrsave", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcRegs.ppcRegs64.ppcVRSave));
693
694 DECLARE("vmmppcvscr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcVSCR+0x00));
695 DECLARE("vmmppcfpscrpad", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR));
696 DECLARE("vmmppcfpscr", offsetof(struct vmm_state_page_t *, vmm_proc_state.ppcFPSCR+4));
697
698 DECLARE("famguestr0", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register));
699 DECLARE("famguestr1", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x4));
700 DECLARE("famguestr2", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x8));
701 DECLARE("famguestr3", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0xC));
702 DECLARE("famguestr4", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x10));
703 DECLARE("famguestr5", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x14));
704 DECLARE("famguestr6", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x18));
705 DECLARE("famguestr7", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_register+0x1C));
706 DECLARE("famguestpc", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_pc));
707 DECLARE("famguestmsr", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.guest_msr));
708 DECLARE("famdispcode", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.fastassist_dispatch_code));
709 DECLARE("famrefcon", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.fastassist_refcon));
710 DECLARE("famparam", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.fastassist_parameter));
711 DECLARE("famhandler", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.fastassist_dispatch));
712 DECLARE("famintercepts", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs32.fastassist_intercepts));
713
714 DECLARE("famguestXr0", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register));
715 DECLARE("famguestXr1", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x8));
716 DECLARE("famguestXr2", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x10));
717 DECLARE("famguestXr3", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x18));
718 DECLARE("famguestXr4", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x20));
719 DECLARE("famguestXr5", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x28));
720 DECLARE("famguestXr6", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x30));
721 DECLARE("famguestXr7", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_register+0x38));
722 DECLARE("famguestXpc", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_pc));
723 DECLARE("famguestXmsr", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.guest_msr));
724 DECLARE("famdispcodeX", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.fastassist_dispatch_code));
725 DECLARE("famrefconX", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.fastassist_refcon));
726 DECLARE("famparamX", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.fastassist_parameter));
727 DECLARE("famhandlerX", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.fastassist_dispatch));
728 DECLARE("faminterceptsX", offsetof(struct vmm_state_page_t *, vmm_fastassist_state.vmmfs64.fastassist_intercepts));
729
730 DECLARE("vmmFloatCngd", vmmFloatCngd);
731 DECLARE("vmmFloatCngdb", vmmFloatCngdb);
732 DECLARE("vmmVectCngd", vmmVectCngd);
733 DECLARE("vmmVectCngdb", vmmVectCngdb);
734 DECLARE("vmmTimerPop", vmmTimerPop);
735 DECLARE("vmmTimerPopb", vmmTimerPopb);
736 DECLARE("vmmFAMmode", vmmFAMmode);
737 DECLARE("vmmFAMmodeb", vmmFAMmodeb);
738 DECLARE("vmmSpfSave", vmmSpfSave);
739 DECLARE("vmmSpfSaveb", vmmSpfSaveb);
740 DECLARE("vmmFloatLoad", vmmFloatLoad);
741 DECLARE("vmmFloatLoadb", vmmFloatLoadb);
742 DECLARE("vmmVectLoad", vmmVectLoad);
743 DECLARE("vmmVectLoadb", vmmVectLoadb);
744 DECLARE("vmmVectVRall", vmmVectVRall);
745 DECLARE("vmmVectVRallb", vmmVectVRallb);
746 DECLARE("vmmVectVAss", vmmVectVAss);
747 DECLARE("vmmVectVAssb", vmmVectVAssb);
748 DECLARE("vmmXStart", vmmXStart);
749 DECLARE("vmmXStartb", vmmXStartb);
750 DECLARE("vmmXStop", vmmXStop);
751 DECLARE("vmmXStopb", vmmXStopb);
752 DECLARE("vmmKey", vmmKey);
753 DECLARE("vmmKeyb", vmmKeyb);
754 DECLARE("vmmFamSet", vmmFamSet);
755 DECLARE("vmmFamSetb", vmmFamSetb);
756 DECLARE("vmmFamEna", vmmFamEna);
757 DECLARE("vmmFamEnab", vmmFamEnab);
758 DECLARE("vmm64Bit", vmm64Bit);
759
760 /* values from kern/task.h */
761 DECLARE("TASK_SYSCALLS_MACH", offsetof(struct task *, syscalls_mach));
762 DECLARE("TASK_SYSCALLS_UNIX", offsetof(struct task *, syscalls_unix));
763
764 DECLARE("TASK_VTIMERS", offsetof(struct task *, vtimers));
765
766 /* values from vm/vm_map.h */
767 DECLARE("VMMAP_PMAP", offsetof(struct _vm_map *, pmap));
768
769 /* values from machine/pmap.h */
770 DECLARE("pmapSpace", offsetof(struct pmap *, space));
771 DECLARE("spaceNum", offsetof(struct pmap *, spaceNum));
772 DECLARE("pmapSXlk", offsetof(struct pmap *, pmapSXlk));
773 DECLARE("pmapCCtl", offsetof(struct pmap *, pmapCCtl));
774 DECLARE("pmapCCtlVal", pmapCCtlVal);
775 DECLARE("pmapCCtlLck", pmapCCtlLck);
776 DECLARE("pmapCCtlLckb", pmapCCtlLckb);
777 DECLARE("pmapCCtlGen", pmapCCtlGen);
778 DECLARE("pmapSegCacheCnt", pmapSegCacheCnt);
779 DECLARE("pmapSegCacheUse", pmapSegCacheUse);
780 DECLARE("pmapvr", offsetof(struct pmap *, pmapvr));
781 DECLARE("pmapFlags", offsetof(struct pmap *, pmapFlags));
782 DECLARE("pmapKeys", pmapKeys);
783 DECLARE("pmapKeyDef", pmapKeyDef);
784 DECLARE("pmapSCSubTag", offsetof(struct pmap *, pmapSCSubTag));
785 DECLARE("pmapVmmExt", offsetof(struct pmap *, pmapVmmExt));
786 DECLARE("pmapVmmExtPhys", offsetof(struct pmap *, pmapVmmExtPhys));
787 DECLARE("pmapVMhost", pmapVMhost);
788 DECLARE("pmapVMgsaa", pmapVMgsaa);
789 DECLARE("pmapSegCache", offsetof(struct pmap *, pmapSegCache));
790 DECLARE("pmapCurLists", offsetof(struct pmap *, pmapCurLists));
791 DECLARE("pmapRandNum", offsetof(struct pmap *, pmapRandNum));
792 DECLARE("pmapSkipLists", offsetof(struct pmap *, pmapSkipLists));
793 DECLARE("pmapSearchVisits", offsetof(struct pmap *, pmapSearchVisits));
794 DECLARE("pmapSearchCnt", offsetof(struct pmap *, pmapSearchCnt));
795 DECLARE("pmapSize", pmapSize);
796 DECLARE("kSkipListFanoutShift", kSkipListFanoutShift);
797 DECLARE("kSkipListMaxLists", kSkipListMaxLists);
798 DECLARE("invalSpace", invalSpace);
799
800 DECLARE("sgcESID", offsetof(struct sgc *, sgcESID));
801 DECLARE("sgcESmsk", sgcESmsk);
802 DECLARE("sgcVSID", offsetof(struct sgc *, sgcVSID));
803 DECLARE("sgcVSmsk", sgcVSmsk);
804 DECLARE("sgcVSKeys", sgcVSKeys);
805 DECLARE("sgcVSKeyUsr", sgcVSKeyUsr);
806 DECLARE("sgcVSNoEx", sgcVSNoEx);
807 DECLARE("pmapPAddr", offsetof(struct pmapTransTab *, pmapPAddr));
808 DECLARE("pmapVAddr", offsetof(struct pmapTransTab *, pmapVAddr));
809 DECLARE("pmapTransSize", sizeof(pmapTransTab));
810 DECLARE("pmapResidentCnt", offsetof(struct pmap *, stats.resident_count));
811 DECLARE("pmapResidentMax", offsetof(struct pmap *, stats.resident_max));
812
813 DECLARE("maxAdrSp", maxAdrSp);
814 DECLARE("maxAdrSpb", maxAdrSpb);
815
816 DECLARE("cppvPsnkb", cppvPsnkb);
817 DECLARE("cppvPsrcb", cppvPsrcb);
818 DECLARE("cppvFsnkb", cppvFsnkb);
819 DECLARE("cppvFsrcb", cppvFsrcb);
820 DECLARE("cppvNoModSnkb", cppvNoModSnkb);
821 DECLARE("cppvNoRefSrcb", cppvNoRefSrcb);
822 DECLARE("cppvKmapb", cppvKmapb);
823
824 DECLARE("vmxSalt", offsetof(struct pmap_vmm_ext *, vmxSalt));
825 DECLARE("vmxHostPmapPhys", offsetof(struct pmap_vmm_ext *, vmxHostPmapPhys));
826 DECLARE("vmxHostPmap", offsetof(struct pmap_vmm_ext *, vmxHostPmap));
827 DECLARE("vmxHashPgIdx", offsetof(struct pmap_vmm_ext *, vmxHashPgIdx));
828 DECLARE("vmxHashPgList", offsetof(struct pmap_vmm_ext *, vmxHashPgList));
829 DECLARE("vmxStats", offsetof(struct pmap_vmm_ext *, vmxStats));
830 DECLARE("vmxSize", sizeof(struct pmap_vmm_ext));
831 DECLARE("VMX_HPIDX_OFFSET", VMX_HPIDX_OFFSET);
832 DECLARE("VMX_HPLIST_OFFSET", VMX_HPLIST_OFFSET);
833 DECLARE("VMX_ACTMAP_OFFSET", VMX_ACTMAP_OFFSET);
834 DECLARE("vxsGpf", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGpf));
835 DECLARE("vxsGpfMiss", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGpfMiss));
836 DECLARE("vxsGrm", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrm));
837 DECLARE("vxsGrmMiss", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrmMiss));
838 DECLARE("vxsGrmActive", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrmActive));
839 DECLARE("vxsGra", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGra));
840 DECLARE("vxsGraHits", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGraHits));
841 DECLARE("vxsGraActive", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGraActive));
842 DECLARE("vxsGrl", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrl));
843 DECLARE("vxsGrlActive", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrlActive));
844 DECLARE("vxsGrs", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrs));
845 DECLARE("vxsGrsHitAct", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrsHitAct));
846 DECLARE("vxsGrsHitSusp", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrsHitSusp));
847 DECLARE("vxsGrsMissGV", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrsMissGV));
848 DECLARE("vxsGrsHitPE", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrsHitPE));
849 DECLARE("vxsGrsMissPE", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGrsMissPE));
850 DECLARE("vxsGad", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGad));
851 DECLARE("vxsGadHit", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGadHit));
852 DECLARE("vxsGadFree", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGadFree));
853 DECLARE("vxsGadDormant", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGadDormant));
854 DECLARE("vxsGadSteal", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGadSteal));
855 DECLARE("vxsGsu", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGsu));
856 DECLARE("vxsGsuHit", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGsuHit));
857 DECLARE("vxsGsuMiss", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGsuMiss));
858 DECLARE("vxsGtd", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGtd));
859 DECLARE("vxsGtdHit", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGtdHit));
860 DECLARE("vxsGtdMiss", offsetof(struct pmap_vmm_ext *, vmxStats.vxsGtdMiss));
861
862 /* values from kern/timer.h */
863 DECLARE("TIMER_LOW", offsetof(struct timer *, low_bits));
864 DECLARE("TIMER_HIGH", offsetof(struct timer *, high_bits));
865 DECLARE("TIMER_HIGHCHK", offsetof(struct timer *, high_bits_check));
866 DECLARE("TIMER_TSTAMP", offsetof(struct timer *, tstamp));
867
868 DECLARE("THREAD_TIMER", offsetof(struct processor *, processor_data.thread_timer));
869 DECLARE("KERNEL_TIMER", offsetof(struct processor *, processor_data.kernel_timer));
870 DECLARE("SYSTEM_TIMER", offsetof(struct thread *, system_timer));
871 DECLARE("USER_TIMER", offsetof(struct thread *, user_timer));
872 DECLARE("SYSTEM_STATE", offsetof(struct processor *, processor_data.system_state));
873 DECLARE("USER_STATE", offsetof(struct processor *, processor_data.user_state));
874 DECLARE("CURRENT_STATE", offsetof(struct processor *, processor_data.current_state));
875
876 /* Constants from pmap.h */
877 DECLARE("PPC_SID_KERNEL", PPC_SID_KERNEL);
878
879 /* values for accessing mach_trap table */
880 DECLARE("MACH_TRAP_ARG_MUNGE32",
881 offsetof(mach_trap_t *, mach_trap_arg_munge32));
882 DECLARE("MACH_TRAP_ARG_MUNGE64",
883 offsetof(mach_trap_t *, mach_trap_arg_munge64));
884 DECLARE("MACH_TRAP_ARGC",
885 offsetof(mach_trap_t *, mach_trap_arg_count));
886 DECLARE("MACH_TRAP_FUNCTION",
887 offsetof(mach_trap_t *, mach_trap_function));
888
889 DECLARE("MACH_TRAP_TABLE_COUNT", MACH_TRAP_TABLE_COUNT);
890
891 DECLARE("PPCcallmax", sizeof(PPCcalls));
892
893 /* Misc values used by assembler */
894 DECLARE("AST_ALL", AST_ALL);
895 DECLARE("AST_URGENT", AST_URGENT);
896 DECLARE("AST_BSD", AST_BSD);
897
898 /* Spin Lock structure */
899 DECLARE("SLOCK_ILK", offsetof(lck_spin_t *, interlock));
900
901 /* Mutex structure */
902 DECLARE("MUTEX_DATA", offsetof(lck_mtx_t *, lck_mtx_data));
903 DECLARE("MUTEX_WAITERS",offsetof(lck_mtx_t *, lck_mtx_waiters));
904 DECLARE("MUTEX_PROMOTED_PRI",offsetof(lck_mtx_t *, lck_mtx_pri));
905 DECLARE("MUTEX_TYPE", offsetof(lck_mtx_ext_t *, lck_mtx_deb.type));
906 DECLARE("MUTEX_STACK", offsetof(lck_mtx_ext_t *, lck_mtx_deb.stack));
907 DECLARE("MUTEX_FRAMES", LCK_FRAMES_MAX);
908 DECLARE("MUTEX_THREAD", offsetof(lck_mtx_ext_t *, lck_mtx_deb.thread));
909 DECLARE("MUTEX_ATTR", offsetof(lck_mtx_ext_t *, lck_mtx_attr));
910 DECLARE("MUTEX_ATTR_DEBUG", LCK_MTX_ATTR_DEBUG);
911 DECLARE("MUTEX_ATTR_DEBUGb", LCK_MTX_ATTR_DEBUGb);
912 DECLARE("MUTEX_ATTR_STAT", LCK_MTX_ATTR_STAT);
913 DECLARE("MUTEX_ATTR_STATb", LCK_MTX_ATTR_STATb);
914 DECLARE("MUTEX_GRP", offsetof(lck_mtx_ext_t *, lck_mtx_grp));
915 DECLARE("MUTEX_TAG", MUTEX_TAG);
916 DECLARE("MUTEX_IND", LCK_MTX_TAG_INDIRECT);
917 DECLARE("MUTEX_ITAG",offsetof(lck_mtx_t *, lck_mtx_tag));
918 DECLARE("MUTEX_PTR",offsetof(lck_mtx_t *, lck_mtx_ptr));
919 DECLARE("MUTEX_ASSERT_OWNED", LCK_MTX_ASSERT_OWNED);
920 DECLARE("MUTEX_ASSERT_NOTOWNED",LCK_MTX_ASSERT_NOTOWNED);
921 DECLARE("GRP_MTX_STAT_UTIL", offsetof(lck_grp_t *, lck_grp_stat.lck_grp_mtx_stat.lck_grp_mtx_util_cnt));
922 DECLARE("GRP_MTX_STAT_MISS", offsetof(lck_grp_t *, lck_grp_stat.lck_grp_mtx_stat.lck_grp_mtx_miss_cnt));
923 DECLARE("GRP_MTX_STAT_WAIT", offsetof(lck_grp_t *, lck_grp_stat.lck_grp_mtx_stat.lck_grp_mtx_wait_cnt));
924
925 /* RW lock structure */
926 DECLARE("RW_IND", LCK_RW_TAG_INDIRECT);
927 DECLARE("RW_PTR", offsetof(lck_rw_t *, lck_rw_ptr));
928 DECLARE("RW_SHARED", LCK_RW_TYPE_SHARED);
929 DECLARE("RW_EXCL", LCK_RW_TYPE_EXCLUSIVE);
930 DECLARE("RW_EVENT", (((sizeof(lck_rw_t)-1))/sizeof(unsigned int))*sizeof(unsigned int));
931
932 /* values from low_trace.h */
933 DECLARE("LTR_cpu", offsetof(struct LowTraceRecord *, LTR_cpu));
934 DECLARE("LTR_excpt", offsetof(struct LowTraceRecord *, LTR_excpt));
935 DECLARE("LTR_timeHi", offsetof(struct LowTraceRecord *, LTR_timeHi));
936 DECLARE("LTR_timeLo", offsetof(struct LowTraceRecord *, LTR_timeLo));
937 DECLARE("LTR_cr", offsetof(struct LowTraceRecord *, LTR_cr));
938 DECLARE("LTR_srr0", offsetof(struct LowTraceRecord *, LTR_srr0));
939 DECLARE("LTR_srr1", offsetof(struct LowTraceRecord *, LTR_srr1));
940 DECLARE("LTR_dar", offsetof(struct LowTraceRecord *, LTR_dar));
941 DECLARE("LTR_dsisr", offsetof(struct LowTraceRecord *, LTR_dsisr));
942 DECLARE("LTR_rsvd0", offsetof(struct LowTraceRecord *, LTR_rsvd0));
943 DECLARE("LTR_save", offsetof(struct LowTraceRecord *, LTR_save));
944 DECLARE("LTR_lr", offsetof(struct LowTraceRecord *, LTR_lr));
945 DECLARE("LTR_ctr", offsetof(struct LowTraceRecord *, LTR_ctr));
946 DECLARE("LTR_r0", offsetof(struct LowTraceRecord *, LTR_r0));
947 DECLARE("LTR_r1", offsetof(struct LowTraceRecord *, LTR_r1));
948 DECLARE("LTR_r2", offsetof(struct LowTraceRecord *, LTR_r2));
949 DECLARE("LTR_r3", offsetof(struct LowTraceRecord *, LTR_r3));
950 DECLARE("LTR_r4", offsetof(struct LowTraceRecord *, LTR_r4));
951 DECLARE("LTR_r5", offsetof(struct LowTraceRecord *, LTR_r5));
952 DECLARE("LTR_r6", offsetof(struct LowTraceRecord *, LTR_r6));
953 DECLARE("LTR_size", sizeof(struct LowTraceRecord));
954
955 /* Values from pexpert.h */
956 DECLARE("PECFIcpurate", offsetof(struct clock_frequency_info_t *, cpu_clock_rate_hz));
957 DECLARE("PECFIbusrate", offsetof(struct clock_frequency_info_t *, bus_clock_rate_hz));
958
959 /* Values from pmap_internals.h and mappings.h */
960
961 DECLARE("mpFlags", offsetof(struct mapping *, mpFlags));
962 DECLARE("mpBusy", mpBusy);
963 DECLARE("mpPrevious", mpPrevious);
964 DECLARE("mpNext", mpNext);
965 DECLARE("mpPIndex", mpPIndex);
966 DECLARE("mpType", mpType);
967 DECLARE("mpNormal", mpNormal);
968 DECLARE("mpBlock", mpBlock);
969 DECLARE("mpMinSpecial", mpMinSpecial);
970 DECLARE("mpNest", mpNest);
971 DECLARE("mpLinkage", mpLinkage);
972 DECLARE("mpACID", mpACID);
973 DECLARE("mpGuest", mpGuest);
974 DECLARE("mpFIP", mpFIP);
975 DECLARE("mpFIPb", mpFIPb);
976 DECLARE("mpPcfg", mpPcfg);
977 DECLARE("mpPcfgb", mpPcfgb);
978 DECLARE("mpRIP", mpRIP);
979 DECLARE("mpRIPb", mpRIPb);
980 DECLARE("mpPerm", mpPerm);
981 DECLARE("mpPermb", mpPermb);
982 DECLARE("mpBSu", mpBSu);
983 DECLARE("mpBSub", mpBSub);
984 DECLARE("mpLists", mpLists);
985 DECLARE("mpListsb", mpListsb);
986 DECLARE("mpgFlags", mpgFlags);
987 DECLARE("mpgFree", mpgFree);
988 DECLARE("mpgGlobal", mpgGlobal);
989 DECLARE("mpgDormant", mpgDormant);
990
991 DECLARE("mpSpace", offsetof(struct mapping *, mpSpace));
992 DECLARE("mpBSize", offsetof(struct mapping *, u.mpBSize));
993 DECLARE("mpgCursor", offsetof(struct mapping *, u.mpgCursor));
994 DECLARE("mpPte", offsetof(struct mapping *, mpPte));
995 DECLARE("mpHValid", mpHValid);
996 DECLARE("mpHValidb", mpHValidb);
997
998 DECLARE("mpPAddr", offsetof(struct mapping *, mpPAddr));
999 DECLARE("mpVAddr", offsetof(struct mapping *, mpVAddr));
1000 DECLARE("mpHWFlags", mpHWFlags);
1001 DECLARE("mpHWFlagsb", mpHWFlagsb);
1002 DECLARE("mpN", mpN);
1003 DECLARE("mpNb", mpNb);
1004 DECLARE("mpPP", mpPP);
1005 DECLARE("mpPPb", mpPPb);
1006 DECLARE("mpPPe", mpPPe);
1007 DECLARE("mpKKN", mpKKN);
1008 DECLARE("mpKKNb", mpKKNb);
1009 DECLARE("mpWIMG", mpWIMG);
1010 DECLARE("mpWIMGb", mpWIMGb);
1011 DECLARE("mpW", mpW);
1012 DECLARE("mpWb", mpWb);
1013 DECLARE("mpI", mpI);
1014 DECLARE("mpIb", mpIb);
1015 DECLARE("mpM", mpM);
1016 DECLARE("mpMb", mpMb);
1017 DECLARE("mpG", mpG);
1018 DECLARE("mpGb", mpGb);
1019 DECLARE("mpWIMGe", mpWIMGe);
1020 DECLARE("mpC", mpC);
1021 DECLARE("mpCb", mpCb);
1022 DECLARE("mpR", mpR);
1023 DECLARE("mpRb", mpRb);
1024 DECLARE("mpAlias", offsetof(struct mapping *, mpAlias));
1025 DECLARE("mpNestReloc", offsetof(struct mapping *, mpNestReloc));
1026 DECLARE("mpBlkRemCur", offsetof(struct mapping *, mpBlkRemCur));
1027 DECLARE("mpList0", offsetof(struct mapping *, mpList0));
1028 DECLARE("mpList ", offsetof(struct mapping *, mpList));
1029 DECLARE("mpBasicSize", mpBasicSize);
1030 DECLARE("mpBasicLists", mpBasicLists);
1031
1032 DECLARE("mbvrswap", offsetof(struct mappingblok *, mapblokvrswap));
1033 DECLARE("mbfree", offsetof(struct mappingblok *, mapblokfree));
1034 DECLARE("mapcsize", sizeof(struct mappingctl));
1035
1036 DECLARE("hwpPurgePTE", hwpPurgePTE);
1037 DECLARE("hwpMergePTE", hwpMergePTE);
1038 DECLARE("hwpNoopPTE", hwpNoopPTE);
1039
1040 // DANGER WIL ROBINSON!!! This wonderfully magical tool doesn't seem to handle 64-bit constants,
1041 // leaving us with only the cold ash of a zero. ppI, ppG, and who knows what else is affected.
1042 DECLARE("ppLink", offsetof(struct phys_entry *, ppLink));
1043 DECLARE("ppLock", ppLock);
1044 DECLARE("ppFlags", ppFlags);
1045 // DECLARE("ppI", ppI);
1046 DECLARE("ppIb", ppIb);
1047 // DECLARE("ppG", ppG);
1048 DECLARE("ppGb", ppGb);
1049 DECLARE("ppR", ppR);
1050 DECLARE("ppRb", ppRb);
1051 DECLARE("ppC", ppC);
1052 DECLARE("ppCb", ppCb);
1053 DECLARE("physEntrySize",physEntrySize);
1054 DECLARE("ppLFAmask", ppLFAmask);
1055 DECLARE("ppLFArrot", ppLFArrot);
1056
1057 DECLARE("pcfFlags", offsetof(struct pcfg *, pcfFlags));
1058 DECLARE("pcfEncode", offsetof(struct pcfg *, pcfEncode));
1059 DECLARE("pcfPSize", offsetof(struct pcfg *, pcfPSize));
1060 DECLARE("pcfShift", offsetof(struct pcfg *, pcfShift));
1061 DECLARE("pcfValid", pcfValid);
1062 DECLARE("pcfLarge", pcfLarge);
1063 DECLARE("pcfDedSeg", pcfDedSeg);
1064 DECLARE("pcfSize", sizeof(struct pcfg));
1065 DECLARE("pcfDefPcfg", pcfDefPcfg);
1066 DECLARE("pcfLargePcfg", pcfLargePcfg);
1067
1068 DECLARE("PCAallo", offsetof(struct PCA *, flgs.PCAallo));
1069 DECLARE("PCAfree", offsetof(struct PCA *, flgs.PCAalflgs.PCAfree));
1070 DECLARE("PCAauto", offsetof(struct PCA *, flgs.PCAalflgs.PCAauto));
1071 DECLARE("PCAmisc", offsetof(struct PCA *, flgs.PCAalflgs.PCAmisc));
1072 DECLARE("PCAlock", PCAlock);
1073 DECLARE("PCAlockb", PCAlockb);
1074 DECLARE("PCAsteal", offsetof(struct PCA *, flgs.PCAalflgs.PCAsteal));
1075
1076 DECLARE("mrPhysTab", offsetof(struct mem_region *, mrPhysTab));
1077 DECLARE("mrStart", offsetof(struct mem_region *, mrStart));
1078 DECLARE("mrEnd", offsetof(struct mem_region *, mrEnd));
1079 DECLARE("mrAStart", offsetof(struct mem_region *, mrAStart));
1080 DECLARE("mrAEnd", offsetof(struct mem_region *, mrAEnd));
1081 DECLARE("mrSize", sizeof(struct mem_region));
1082
1083 DECLARE("mapRemChunk", mapRemChunk);
1084
1085 DECLARE("mapRetCode", mapRetCode);
1086 DECLARE("mapRtOK", mapRtOK);
1087 DECLARE("mapRtBadLk", mapRtBadLk);
1088 DECLARE("mapRtPerm", mapRtPerm);
1089 DECLARE("mapRtNotFnd", mapRtNotFnd);
1090 DECLARE("mapRtBlock", mapRtBlock);
1091 DECLARE("mapRtNest", mapRtNest);
1092 DECLARE("mapRtRemove", mapRtRemove);
1093 DECLARE("mapRtMapDup", mapRtMapDup);
1094 DECLARE("mapRtGuest", mapRtGuest);
1095 DECLARE("mapRtEmpty", mapRtEmpty);
1096 DECLARE("mapRtSmash", mapRtSmash);
1097
1098 #if 0
1099 DECLARE("MFpcaptr", offsetof(struct mappingflush *, pcaptr));
1100 DECLARE("MFmappingcnt", offsetof(struct mappingflush *, mappingcnt));
1101 DECLARE("MFmapping", offsetof(struct mappingflush *, mapping));
1102 DECLARE("MFmappingSize", sizeof(struct mfmapping));
1103 #endif
1104
1105 DECLARE("GV_GROUPS_LG2", GV_GROUPS_LG2);
1106 DECLARE("GV_GROUPS", GV_GROUPS);
1107 DECLARE("GV_SLOT_SZ_LG2", GV_SLOT_SZ_LG2);
1108 DECLARE("GV_SLOT_SZ", GV_SLOT_SZ);
1109 DECLARE("GV_SLOTS_LG2", GV_SLOTS_LG2);
1110 DECLARE("GV_SLOTS", GV_SLOTS);
1111 DECLARE("GV_PGIDX_SZ_LG2", GV_PGIDX_SZ_LG2);
1112 DECLARE("GV_PAGE_SZ_LG2", GV_PAGE_SZ_LG2);
1113 DECLARE("GV_PAGE_SZ", GV_PAGE_SZ);
1114 DECLARE("GV_PAGE_MASK", GV_PAGE_MASK);
1115 DECLARE("GV_HPAGES", GV_HPAGES);
1116 DECLARE("GV_GRPS_PPG_LG2", GV_GRPS_PPG_LG2);
1117 DECLARE("GV_GRPS_PPG", GV_GRPS_PPG);
1118 DECLARE("GV_GRP_MASK", GV_GRP_MASK);
1119 DECLARE("GV_SLOT_MASK", GV_SLOT_MASK);
1120 DECLARE("GV_HPAGE_SHIFT", GV_HPAGE_SHIFT);
1121 DECLARE("GV_HPAGE_MASK", GV_HPAGE_MASK);
1122 DECLARE("GV_HGRP_SHIFT", GV_HGRP_SHIFT);
1123 DECLARE("GV_HGRP_MASK", GV_HGRP_MASK);
1124 DECLARE("GV_MAPWD_BITS_LG2",GV_MAPWD_BITS_LG2);
1125 DECLARE("GV_MAPWD_SZ_LG2", GV_MAPWD_SZ_LG2);
1126 DECLARE("GV_MAP_WORDS", GV_MAP_WORDS);
1127 DECLARE("GV_MAP_MASK", GV_MAP_MASK);
1128 DECLARE("GV_MAP_SHIFT", GV_MAP_SHIFT);
1129 DECLARE("GV_BAND_SHIFT", GV_BAND_SHIFT);
1130 DECLARE("GV_BAND_SZ_LG2", GV_BAND_SZ_LG2);
1131 DECLARE("GV_BAND_MASK", GV_BAND_MASK);
1132
1133 #if 1
1134 DECLARE("GDsave", offsetof(struct GDWorkArea *, GDsave));
1135 DECLARE("GDfp0", offsetof(struct GDWorkArea *, GDfp0));
1136 DECLARE("GDfp1", offsetof(struct GDWorkArea *, GDfp1));
1137 DECLARE("GDfp2", offsetof(struct GDWorkArea *, GDfp2));
1138 DECLARE("GDfp3", offsetof(struct GDWorkArea *, GDfp3));
1139 DECLARE("GDtop", offsetof(struct GDWorkArea *, GDtop));
1140 DECLARE("GDleft", offsetof(struct GDWorkArea *, GDleft));
1141 DECLARE("GDtopleft", offsetof(struct GDWorkArea *, GDtopleft));
1142 DECLARE("GDrowbytes", offsetof(struct GDWorkArea *, GDrowbytes));
1143 DECLARE("GDrowchar", offsetof(struct GDWorkArea *, GDrowchar));
1144 DECLARE("GDdepth", offsetof(struct GDWorkArea *, GDdepth));
1145 DECLARE("GDcollgn", offsetof(struct GDWorkArea *, GDcollgn));
1146 DECLARE("GDready", offsetof(struct GDWorkArea *, GDready));
1147 DECLARE("GDrowbuf1", offsetof(struct GDWorkArea *, GDrowbuf1));
1148 DECLARE("GDrowbuf2", offsetof(struct GDWorkArea *, GDrowbuf2));
1149 #endif
1150
1151 DECLARE("enaExpTrace", enaExpTrace);
1152 DECLARE("enaExpTraceb", enaExpTraceb);
1153 DECLARE("enaUsrFCall", enaUsrFCall);
1154 DECLARE("enaUsrFCallb", enaUsrFCallb);
1155 DECLARE("enaUsrPhyMp", enaUsrPhyMp);
1156 DECLARE("enaUsrPhyMpb", enaUsrPhyMpb);
1157 DECLARE("enaDiagSCs", enaDiagSCs);
1158 DECLARE("enaDiagSCsb", enaDiagSCsb);
1159 DECLARE("enaDiagEM", enaDiagEM);
1160 DECLARE("enaDiagEMb", enaDiagEMb);
1161 DECLARE("enaNotifyEM", enaNotifyEM);
1162 DECLARE("enaNotifyEMb", enaNotifyEMb);
1163 DECLARE("disLkType", disLkType);
1164 DECLARE("disLktypeb", disLktypeb);
1165 DECLARE("disLkThread", disLkThread);
1166 DECLARE("disLkThreadb", disLkThreadb);
1167 DECLARE("enaLkExtStck", enaLkExtStck);
1168 DECLARE("enaLkExtStckb",enaLkExtStckb);
1169 DECLARE("disLkMyLck", disLkMyLck);
1170 DECLARE("disLkMyLckb", disLkMyLckb);
1171 DECLARE("dgMisc1", offsetof(struct diagWork *, dgMisc1));
1172 DECLARE("dgMisc2", offsetof(struct diagWork *, dgMisc2));
1173 DECLARE("dgMisc3", offsetof(struct diagWork *, dgMisc3));
1174 DECLARE("dgMisc4", offsetof(struct diagWork *, dgMisc4));
1175 DECLARE("dgMisc5", offsetof(struct diagWork *, dgMisc5));
1176
1177 DECLARE("SACnext", offsetof(struct savearea_comm *, sac_next));
1178 DECLARE("SACprev", offsetof(struct savearea_comm *, sac_prev));
1179 DECLARE("SACvrswap", offsetof(struct savearea_comm *, sac_vrswap));
1180 DECLARE("SACalloc", offsetof(struct savearea_comm *, sac_alloc));
1181 DECLARE("SACflags", offsetof(struct savearea_comm *, sac_flags));
1182 DECLARE("sac_cnt", sac_cnt);
1183 DECLARE("sac_empty", sac_empty);
1184 DECLARE("sac_perm", sac_perm);
1185 DECLARE("sac_permb", sac_permb);
1186
1187 DECLARE("LocalSaveTarget", LocalSaveTarget);
1188 DECLARE("LocalSaveMin", LocalSaveMin);
1189 DECLARE("LocalSaveMax", LocalSaveMax);
1190 DECLARE("FreeListMin", FreeListMin);
1191 DECLARE("SaveLowHysteresis", SaveLowHysteresis);
1192 DECLARE("SaveHighHysteresis", SaveHighHysteresis);
1193 DECLARE("InitialSaveAreas", InitialSaveAreas);
1194 DECLARE("InitialSaveTarget", InitialSaveTarget);
1195 DECLARE("InitialSaveBloks", InitialSaveBloks);
1196
1197 DECLARE("SAVprev", offsetof(struct savearea_comm *, save_prev));
1198 DECLARE("SAVact", offsetof(struct savearea_comm *, save_act));
1199 DECLARE("SAVflags", offsetof(struct savearea_comm *, save_flags));
1200 DECLARE("SAVlevel", offsetof(struct savearea_comm *, save_level));
1201 DECLARE("SAVtime", offsetof(struct savearea_comm *, save_time));
1202 DECLARE("savemisc0", offsetof(struct savearea_comm *, save_misc0));
1203 DECLARE("savemisc1", offsetof(struct savearea_comm *, save_misc1));
1204 DECLARE("savemisc2", offsetof(struct savearea_comm *, save_misc2));
1205 DECLARE("savemisc3", offsetof(struct savearea_comm *, save_misc3));
1206
1207 DECLARE("SAVsize", sizeof(struct savearea));
1208 DECLARE("SAVsizefpu", sizeof(struct savearea_vec));
1209 DECLARE("SAVsizevec", sizeof(struct savearea_fpu));
1210 DECLARE("SAVcommsize", sizeof(struct savearea_comm));
1211
1212 DECLARE("savesrr0", offsetof(struct savearea *, save_srr0));
1213 DECLARE("savesrr1", offsetof(struct savearea *, save_srr1));
1214 DECLARE("savecr", offsetof(struct savearea *, save_cr));
1215 DECLARE("savexer", offsetof(struct savearea *, save_xer));
1216 DECLARE("savelr", offsetof(struct savearea *, save_lr));
1217 DECLARE("savectr", offsetof(struct savearea *, save_ctr));
1218 DECLARE("savedar", offsetof(struct savearea *, save_dar));
1219 DECLARE("savedsisr", offsetof(struct savearea *, save_dsisr));
1220 DECLARE("saveexception", offsetof(struct savearea *, save_exception));
1221 DECLARE("savefpscrpad", offsetof(struct savearea *, save_fpscrpad));
1222 DECLARE("savefpscr", offsetof(struct savearea *, save_fpscr));
1223 DECLARE("savevrsave", offsetof(struct savearea *, save_vrsave));
1224 DECLARE("savevscr", offsetof(struct savearea *, save_vscr));
1225
1226 DECLARE("savemmcr0", offsetof(struct savearea *, save_mmcr0));
1227 DECLARE("savemmcr1", offsetof(struct savearea *, save_mmcr1));
1228 DECLARE("savemmcr2", offsetof(struct savearea *, save_mmcr2));
1229 DECLARE("savepmc", offsetof(struct savearea *, save_pmc));
1230
1231 DECLARE("saveinstr", offsetof(struct savearea *, save_instr));
1232
1233 DECLARE("savexdat0", offsetof(struct savearea *, save_xdat0));
1234 DECLARE("savexdat1", offsetof(struct savearea *, save_xdat1));
1235 DECLARE("savexdat2", offsetof(struct savearea *, save_xdat2));
1236 DECLARE("savexdat3", offsetof(struct savearea *, save_xdat3));
1237
1238 DECLARE("saver0", offsetof(struct savearea *, save_r0));
1239 DECLARE("saver1", offsetof(struct savearea *, save_r1));
1240 DECLARE("saver2", offsetof(struct savearea *, save_r2));
1241 DECLARE("saver3", offsetof(struct savearea *, save_r3));
1242 DECLARE("saver4", offsetof(struct savearea *, save_r4));
1243 DECLARE("saver5", offsetof(struct savearea *, save_r5));
1244 DECLARE("saver6", offsetof(struct savearea *, save_r6));
1245 DECLARE("saver7", offsetof(struct savearea *, save_r7));
1246 DECLARE("saver8", offsetof(struct savearea *, save_r8));
1247 DECLARE("saver9", offsetof(struct savearea *, save_r9));
1248 DECLARE("saver10", offsetof(struct savearea *, save_r10));
1249 DECLARE("saver11", offsetof(struct savearea *, save_r11));
1250 DECLARE("saver12", offsetof(struct savearea *, save_r12));
1251 DECLARE("saver13", offsetof(struct savearea *, save_r13));
1252 DECLARE("saver14", offsetof(struct savearea *, save_r14));
1253 DECLARE("saver15", offsetof(struct savearea *, save_r15));
1254 DECLARE("saver16", offsetof(struct savearea *, save_r16));
1255 DECLARE("saver17", offsetof(struct savearea *, save_r17));
1256 DECLARE("saver18", offsetof(struct savearea *, save_r18));
1257 DECLARE("saver19", offsetof(struct savearea *, save_r19));
1258 DECLARE("saver20", offsetof(struct savearea *, save_r20));
1259 DECLARE("saver21", offsetof(struct savearea *, save_r21));
1260 DECLARE("saver22", offsetof(struct savearea *, save_r22));
1261 DECLARE("saver23", offsetof(struct savearea *, save_r23));
1262 DECLARE("saver24", offsetof(struct savearea *, save_r24));
1263 DECLARE("saver25", offsetof(struct savearea *, save_r25));
1264 DECLARE("saver26", offsetof(struct savearea *, save_r26));
1265 DECLARE("saver27", offsetof(struct savearea *, save_r27));
1266 DECLARE("saver28", offsetof(struct savearea *, save_r28));
1267 DECLARE("saver29", offsetof(struct savearea *, save_r29));
1268 DECLARE("saver30", offsetof(struct savearea *, save_r30));
1269 DECLARE("saver31", offsetof(struct savearea *, save_r31));
1270
1271 DECLARE("savefp0", offsetof(struct savearea_fpu *, save_fp0));
1272 DECLARE("savefp1", offsetof(struct savearea_fpu *, save_fp1));
1273 DECLARE("savefp2", offsetof(struct savearea_fpu *, save_fp2));
1274 DECLARE("savefp3", offsetof(struct savearea_fpu *, save_fp3));
1275 DECLARE("savefp4", offsetof(struct savearea_fpu *, save_fp4));
1276 DECLARE("savefp5", offsetof(struct savearea_fpu *, save_fp5));
1277 DECLARE("savefp6", offsetof(struct savearea_fpu *, save_fp6));
1278 DECLARE("savefp7", offsetof(struct savearea_fpu *, save_fp7));
1279 DECLARE("savefp8", offsetof(struct savearea_fpu *, save_fp8));
1280 DECLARE("savefp9", offsetof(struct savearea_fpu *, save_fp9));
1281 DECLARE("savefp10", offsetof(struct savearea_fpu *, save_fp10));
1282 DECLARE("savefp11", offsetof(struct savearea_fpu *, save_fp11));
1283 DECLARE("savefp12", offsetof(struct savearea_fpu *, save_fp12));
1284 DECLARE("savefp13", offsetof(struct savearea_fpu *, save_fp13));
1285 DECLARE("savefp14", offsetof(struct savearea_fpu *, save_fp14));
1286 DECLARE("savefp15", offsetof(struct savearea_fpu *, save_fp15));
1287 DECLARE("savefp16", offsetof(struct savearea_fpu *, save_fp16));
1288 DECLARE("savefp17", offsetof(struct savearea_fpu *, save_fp17));
1289 DECLARE("savefp18", offsetof(struct savearea_fpu *, save_fp18));
1290 DECLARE("savefp19", offsetof(struct savearea_fpu *, save_fp19));
1291 DECLARE("savefp20", offsetof(struct savearea_fpu *, save_fp20));
1292 DECLARE("savefp21", offsetof(struct savearea_fpu *, save_fp21));
1293 DECLARE("savefp22", offsetof(struct savearea_fpu *, save_fp22));
1294 DECLARE("savefp23", offsetof(struct savearea_fpu *, save_fp23));
1295 DECLARE("savefp24", offsetof(struct savearea_fpu *, save_fp24));
1296 DECLARE("savefp25", offsetof(struct savearea_fpu *, save_fp25));
1297 DECLARE("savefp26", offsetof(struct savearea_fpu *, save_fp26));
1298 DECLARE("savefp27", offsetof(struct savearea_fpu *, save_fp27));
1299 DECLARE("savefp28", offsetof(struct savearea_fpu *, save_fp28));
1300 DECLARE("savefp29", offsetof(struct savearea_fpu *, save_fp29));
1301 DECLARE("savefp30", offsetof(struct savearea_fpu *, save_fp30));
1302 DECLARE("savefp31", offsetof(struct savearea_fpu *, save_fp31));
1303
1304 DECLARE("savevr0", offsetof(struct savearea_vec *, save_vr0));
1305 DECLARE("savevr1", offsetof(struct savearea_vec *, save_vr1));
1306 DECLARE("savevr2", offsetof(struct savearea_vec *, save_vr2));
1307 DECLARE("savevr3", offsetof(struct savearea_vec *, save_vr3));
1308 DECLARE("savevr4", offsetof(struct savearea_vec *, save_vr4));
1309 DECLARE("savevr5", offsetof(struct savearea_vec *, save_vr5));
1310 DECLARE("savevr6", offsetof(struct savearea_vec *, save_vr6));
1311 DECLARE("savevr7", offsetof(struct savearea_vec *, save_vr7));
1312 DECLARE("savevr8", offsetof(struct savearea_vec *, save_vr8));
1313 DECLARE("savevr9", offsetof(struct savearea_vec *, save_vr9));
1314 DECLARE("savevr10", offsetof(struct savearea_vec *, save_vr10));
1315 DECLARE("savevr11", offsetof(struct savearea_vec *, save_vr11));
1316 DECLARE("savevr12", offsetof(struct savearea_vec *, save_vr12));
1317 DECLARE("savevr13", offsetof(struct savearea_vec *, save_vr13));
1318 DECLARE("savevr14", offsetof(struct savearea_vec *, save_vr14));
1319 DECLARE("savevr15", offsetof(struct savearea_vec *, save_vr15));
1320 DECLARE("savevr16", offsetof(struct savearea_vec *, save_vr16));
1321 DECLARE("savevr17", offsetof(struct savearea_vec *, save_vr17));
1322 DECLARE("savevr18", offsetof(struct savearea_vec *, save_vr18));
1323 DECLARE("savevr19", offsetof(struct savearea_vec *, save_vr19));
1324 DECLARE("savevr20", offsetof(struct savearea_vec *, save_vr20));
1325 DECLARE("savevr21", offsetof(struct savearea_vec *, save_vr21));
1326 DECLARE("savevr22", offsetof(struct savearea_vec *, save_vr22));
1327 DECLARE("savevr23", offsetof(struct savearea_vec *, save_vr23));
1328 DECLARE("savevr24", offsetof(struct savearea_vec *, save_vr24));
1329 DECLARE("savevr25", offsetof(struct savearea_vec *, save_vr25));
1330 DECLARE("savevr26", offsetof(struct savearea_vec *, save_vr26));
1331 DECLARE("savevr27", offsetof(struct savearea_vec *, save_vr27));
1332 DECLARE("savevr28", offsetof(struct savearea_vec *, save_vr28));
1333 DECLARE("savevr29", offsetof(struct savearea_vec *, save_vr29));
1334 DECLARE("savevr30", offsetof(struct savearea_vec *, save_vr30));
1335 DECLARE("savevr31", offsetof(struct savearea_vec *, save_vr31));
1336 DECLARE("savevrvalid", offsetof(struct savearea_vec *, save_vrvalid));
1337
1338 /* PseudoKernel Exception Descriptor info */
1339 DECLARE("BEDA_SRR0", offsetof(BEDA_t *, srr0));
1340 DECLARE("BEDA_SRR1", offsetof(BEDA_t *, srr1));
1341 DECLARE("BEDA_SPRG0", offsetof(BEDA_t *, sprg0));
1342 DECLARE("BEDA_SPRG1", offsetof(BEDA_t *, sprg1));
1343
1344 /* PseudoKernel Interrupt Control Word */
1345 DECLARE("BTTD_INTCONTROLWORD", offsetof(BTTD_t *, InterruptControlWord));
1346
1347 /* New state when exiting the pseudokernel */
1348 DECLARE("BTTD_NEWEXITSTATE", offsetof(BTTD_t *, NewExitState));
1349
1350 /* PseudoKernel Test/Post Interrupt */
1351 DECLARE("BTTD_TESTINTMASK", offsetof(BTTD_t *, testIntMask));
1352 DECLARE("BTTD_POSTINTMASK", offsetof(BTTD_t *, postIntMask));
1353
1354 /* PseudoKernel Vectors */
1355 DECLARE("BTTD_TRAP_VECTOR", offsetof(BTTD_t *, TrapVector));
1356 DECLARE("BTTD_SYSCALL_VECTOR", offsetof(BTTD_t *, SysCallVector));
1357 DECLARE("BTTD_INTERRUPT_VECTOR", offsetof(BTTD_t *, InterruptVector));
1358 DECLARE("BTTD_PENDINGINT_VECTOR", offsetof(BTTD_t *, PendingIntVector));
1359
1360 /* PseudoKernel Bits, Masks and misc */
1361 DECLARE("SYSCONTEXTSTATE", kInSystemContext);
1362 DECLARE("PSEUDOKERNELSTATE", kInPseudoKernel);
1363 DECLARE("INTSTATEMASK_B", 12);
1364 DECLARE("INTSTATEMASK_E", 15);
1365 DECLARE("INTCR2MASK_B", 8);
1366 DECLARE("INTCR2MASK_E", 11);
1367 DECLARE("INTBACKUPCR2MASK_B", 28);
1368 DECLARE("INTBACKUPCR2MASK_E", 31);
1369 DECLARE("INTCR2TOBACKUPSHIFT", kCR2ToBackupShift);
1370 DECLARE("BB_MAX_TRAP", bbMaxTrap);
1371 DECLARE("BB_RFI_TRAP", bbRFITrap);
1372
1373 /* Various hackery */
1374 DECLARE("procState", offsetof(struct processor *, state));
1375
1376 DECLARE("CPU_SUBTYPE_POWERPC_ALL", CPU_SUBTYPE_POWERPC_ALL);
1377 DECLARE("CPU_SUBTYPE_POWERPC_750", CPU_SUBTYPE_POWERPC_750);
1378 DECLARE("CPU_SUBTYPE_POWERPC_7400", CPU_SUBTYPE_POWERPC_7400);
1379 DECLARE("CPU_SUBTYPE_POWERPC_7450", CPU_SUBTYPE_POWERPC_7450);
1380 DECLARE("CPU_SUBTYPE_POWERPC_970", CPU_SUBTYPE_POWERPC_970);
1381
1382 DECLARE("shdIBAT", offsetof(struct shadowBAT *, IBATs));
1383 DECLARE("shdDBAT", offsetof(struct shadowBAT *, DBATs));
1384
1385 /* Low Memory Globals */
1386
1387 DECLARE("lgVerCode", offsetof(struct lowglo *, lgVerCode));
1388 DECLARE("lgPPStart", offsetof(struct lowglo *, lgPPStart));
1389 DECLARE("maxDec", offsetof(struct lowglo *, lgMaxDec));
1390 DECLARE("mckFlags", offsetof(struct lowglo *, lgMckFlags));
1391 DECLARE("lgPMWvaddr", offsetof(struct lowglo *, lgPMWvaddr));
1392 DECLARE("lgUMWvaddr", offsetof(struct lowglo *, lgUMWvaddr));
1393 DECLARE("trcWork", offsetof(struct lowglo *, lgTrcWork));
1394 DECLARE("traceMask", offsetof(struct lowglo *, lgTrcWork.traceMask));
1395 DECLARE("traceCurr", offsetof(struct lowglo *, lgTrcWork.traceCurr));
1396 DECLARE("traceStart", offsetof(struct lowglo *, lgTrcWork.traceStart));
1397 DECLARE("traceEnd", offsetof(struct lowglo *, lgTrcWork.traceEnd));
1398 DECLARE("traceMsnd", offsetof(struct lowglo *, lgTrcWork.traceMsnd));
1399
1400 DECLARE("Zero", offsetof(struct lowglo *, lgZero));
1401 DECLARE("saveanchor", offsetof(struct lowglo *, lgSaveanchor));
1402
1403 DECLARE("SVlock", offsetof(struct lowglo *, lgSaveanchor.savelock));
1404 DECLARE("SVpoolfwd", offsetof(struct lowglo *, lgSaveanchor.savepoolfwd));
1405 DECLARE("SVpoolbwd", offsetof(struct lowglo *, lgSaveanchor.savepoolbwd));
1406 DECLARE("SVfree", offsetof(struct lowglo *, lgSaveanchor.savefree));
1407 DECLARE("SVfreecnt", offsetof(struct lowglo *, lgSaveanchor.savefreecnt));
1408 DECLARE("SVadjust", offsetof(struct lowglo *, lgSaveanchor.saveadjust));
1409 DECLARE("SVinuse", offsetof(struct lowglo *, lgSaveanchor.saveinuse));
1410 DECLARE("SVtarget", offsetof(struct lowglo *, lgSaveanchor.savetarget));
1411 DECLARE("SVsaveinusesnapshot", offsetof(struct lowglo *, lgSaveanchor.saveinusesnapshot));
1412 DECLARE("SVsavefreesnapshot", offsetof(struct lowglo *, lgSaveanchor.savefreesnapshot));
1413 DECLARE("SVsize", sizeof(struct Saveanchor));
1414
1415 DECLARE("tlbieLock", offsetof(struct lowglo *, lgTlbieLck));
1416
1417 DECLARE("dgFlags", offsetof(struct lowglo *, lgdgWork.dgFlags));
1418 DECLARE("dgLock", offsetof(struct lowglo *, lgdgWork.dgLock));
1419 DECLARE("dgMisc0", offsetof(struct lowglo *, lgdgWork.dgMisc0));
1420
1421 DECLARE("lglcksWork", offsetof(struct lowglo *, lglcksWork));
1422 DECLARE("lgKillResv", offsetof(struct lowglo *, lgKillResv));
1423 DECLARE("lgpPcfg", offsetof(struct lowglo *, lgpPcfg));
1424
1425
1426 DECLARE("scomcpu", offsetof(struct scomcomm *, scomcpu));
1427 DECLARE("scomfunc", offsetof(struct scomcomm *, scomfunc));
1428 DECLARE("scomreg", offsetof(struct scomcomm *, scomreg));
1429 DECLARE("scomstat", offsetof(struct scomcomm *, scomstat));
1430 DECLARE("scomdata", offsetof(struct scomcomm *, scomdata));
1431
1432 #if CONFIG_DTRACE
1433 DECLARE("LS_LCK_MTX_UNLOCK_RELEASE", LS_LCK_MTX_UNLOCK_RELEASE);
1434 DECLARE("LS_LCK_MTX_LOCK_ACQUIRE", LS_LCK_MTX_LOCK_ACQUIRE);
1435 #endif
1436
1437 return(0); /* For ANSI C :-) */
1438 }