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