Root/
Source at commit 2055 created 11 years 10 months ago. By cosmo1t, http://forge.voodooprojects.org/p/chameleon/issues/287/#ic2184 | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_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. Please obtain a copy of the License at␊ |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
11 | * file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
18 | * Please see the License for the specific language governing rights and␊ |
19 | * limitations under the License.␊ |
20 | * ␊ |
21 | * @APPLE_LICENSE_HEADER_END@␊ |
22 | */␊ |
23 | /* Copyright (c) 1996 NeXT Software, Inc. All rights reserved.␊ |
24 | *␊ |
25 | *␉File:␉architecture/ppc/asm_help.h␊ |
26 | *␉Author:␉Mike DeMoney, NeXT Software, Inc.␊ |
27 | *␊ |
28 | *␉This header file defines macros useful when writing assembly code␊ |
29 | *␉for the PowerPC processors.␊ |
30 | *␉r12 is used as the tmp register / PICIFY base.␊ |
31 | *␊ |
32 | * HISTORY␊ |
33 | * 20-May-97 Umesh Vaishampayan (umeshv@apple.com)␊ |
34 | *␉Implemented Dynamic / PIC macros.␊ |
35 | *␊ |
36 | * 28-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com)␊ |
37 | *␉added ".align" directive to various macros to avoid alignment ␊ |
38 | * ␉faults. Moved Register Usage #defines to reg_help.h as that's␊ |
39 | *␉where they should have been in the first place.␊ |
40 | *␉Added Dynamic / PIC macroes for routines which refernce external␊ |
41 | *␉symbols. Not implemented fully as yet.␊ |
42 | *␊ |
43 | * 05-Nov-92 Mike DeMoney (mike@next.com)␊ |
44 | *␉Created.␊ |
45 | */␊ |
46 | ␊ |
47 | #ifndef␉_ARCH_PPC_ASM_HELP_H_␊ |
48 | #define␉_ARCH_PPC_ASM_HELP_H_␊ |
49 | ␊ |
50 | #include␉<architecture/ppc/reg_help.h>␊ |
51 | ␊ |
52 | #ifdef␉__ASSEMBLER__␊ |
53 | /*␊ |
54 | * ppc stack frames look like this after procedure prolog has␊ |
55 | * been executed:␊ |
56 | *␊ |
57 | * Higher address:␊ |
58 | *␉␉␉.........␊ |
59 | *␉␉+-------------------------------+␊ |
60 | * ␉␉| caller's LR␉␉␉|␊ |
61 | *␉␉+-------------------------------+␊ |
62 | * ␉␉| caller's CR␉␉␉|␊ |
63 | *␉␉+-------------------------------+␊ |
64 | * Caller's SP->| caller's caller's sp␉␉| ^^ Caller's Frame ^^␊ |
65 | *␉␉+===============================+ vv Called Rtn Frame vv␊ |
66 | *␉␉|␉Save Area for␉␉| FPF 31␊ |
67 | *␉␉␉..........␊ |
68 | *␉␉| ␉Caller's FPF's␉␉| FPF n␊ |
69 | *␉␉+-------------------------------+␊ |
70 | *␉␉|␉Save Area for␉␉| GRF 31␊ |
71 | *␉␉␉..........␊ |
72 | *␉␉| ␉Caller's GRF's␉␉| GRF n␊ |
73 | *␉␉+-------------------------------+␊ |
74 | *␉␉|␉alignment pad␉␉|␊ |
75 | *␉␉␉............␊ |
76 | *␉␉|␉(if necessary)␉␉|␊ |
77 | *␉␉+-------------------------------+␊ |
78 | *␉␉|␉Local␉␉␉|␊ |
79 | *␉␉␉........␊ |
80 | *␉␉| ␉Variables␉␉|␊ |
81 | *␉␉+-------------------------------+␊ |
82 | * SP + X ->␉| aN for FUTURE call␉␉|␊ |
83 | *␉␉+-------------------------------+␊ |
84 | *␉␉␉..........␊ |
85 | *␉␉+-------------------------------+␊ |
86 | * SP + 28 ->␉| a1 for FUTURE call␉␉|␊ |
87 | *␉␉+-------------------------------+␊ |
88 | * SP + 24 ->␉| a0 for FUTURE call␉␉|␊ |
89 | *␉␉+-------------------------------+␊ |
90 | * SP + 20 ->␉| caller's TOC␉␉␉|␊ |
91 | *␉␉+-------------------------------+␊ |
92 | * SP + 16 ->␉| reserved␉␉␉|␊ |
93 | *␉␉+-------------------------------+␊ |
94 | * SP + 12 ->␉| reserved␉␉␉|␊ |
95 | *␉␉+-------------------------------+␊ |
96 | * SP + 8 ->␉| LR callee-save for FUTURE call|␊ |
97 | *␉␉+-------------------------------+␊ |
98 | * SP + 4 ->␉| CR callee-save for FUTURE call|␊ |
99 | *␉␉+-------------------------------+␊ |
100 | * SP ->␉| caller's sp␉␉␉|␊ |
101 | *␉␉+===============================+␊ |
102 | * Lower address:␊ |
103 | *␊ |
104 | * NOTE: All state with the exception of LR and CR are saved in the␊ |
105 | * called routines frame. LR and CR are saved in the CALLER'S FRAME.␊ |
106 | *␊ |
107 | * ALSO NOTE: Args to the called routine are found in the caller's frame.␊ |
108 | */␊ |
109 | ␊ |
110 | /*␊ |
111 | * ARG(n) -- stack offset to n'th argument␊ |
112 | *␊ |
113 | * NOTE CAREFULLY! These macros start numbering arguments at 1 (NOT 0)␊ |
114 | * The first argument is ARG(1).␊ |
115 | *␊ |
116 | * ALSO NOTE: This stack offset is only valid if using routine␊ |
117 | * DOES NOT alter SP.␊ |
118 | *␊ |
119 | */␊ |
120 | #define␉ARG(n)␉␉((((n) - 1) * 4) + 24)␊ |
121 | ␊ |
122 | /*␊ |
123 | * Macros for building stack frame according to C calling conventions.␊ |
124 | * lr, cr, and sp are saved.␊ |
125 | *␊ |
126 | * NOTE WELL: localvarsize is in bytes, maxargsout is a count of words,␊ |
127 | * grfsaved and fpfsaved is a count of registers. BE SURE TO COUNT␊ |
128 | * BOTH FP (r31) AND sN REGISTERS IN THE COUNT OF GRF REGISTERS SAVED!␊ |
129 | * This will be TWO more than the N of the highest sN register you␊ |
130 | * save: s2 implies you are saving s2, s1, s0, and fp => grfsaved␊ |
131 | * should be 4!␊ |
132 | *␊ |
133 | * FURTHER NOTE: These macros do NOT SAVE GRF or FPF registers. User␊ |
134 | * must do that. GRF sN regs should be saved via␊ |
135 | *␉stmw␉sN,SAVED_GRF_S(N)(sp)␊ |
136 | * where N is the highest numbered s* register to be saved. E.g. if␊ |
137 | * s0, s1, and s2 are to be saved use:␊ |
138 | *␉stmw␉s2,SAVED_GRF_S(2)(sp)␊ |
139 | * Note that this also saves fp.␊ |
140 | * An individual saved grf can be loaded via:␊ |
141 | *␉lwz␉s2,SAVED_GRF_S(2)(sp)␊ |
142 | * Analogous stuff works for fpf's.␊ |
143 | *␊ |
144 | * NOTE: these simple routines will be replaced with more complicated␊ |
145 | * ones once we know what the linker and gdb will require as for as ␊ |
146 | * register use masks and frame declarations.␊ |
147 | *␊ |
148 | * Warning: ROUND_TO_STACK is only to be used in assembly language;␊ |
149 | * for C usage, use ROUND_FRAME() in reg_help.h.␊ |
150 | */␊ |
151 | #define␉ROUND_TO_STACK(len)␉␉␉␉\␊ |
152 | ␉(((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR)␊ |
153 | ␊ |
154 | #define␉BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved)␉\␊ |
155 | ␉.set␉__argoutsize, ROUND_TO_STACK((maxargsout) * 4)␉␉@\␊ |
156 | ␉.if␉__argoutsize < 32␉␉␉␉␉@\␊ |
157 | ␉ .set␉__argoutsize,32␉␉␉␉␉␉@\␊ |
158 | ␉.endif␉␉␉␉␉␉␉␉@\␊ |
159 | ␉.set␉__framesize, ROUND_TO_STACK(␉␉␉␉\␊ |
160 | ␉␉␉24 + __argoutsize + (localvarsize)␉␉\␊ |
161 | ␉␉␉+ 4*(grfsaved) + 8*(fpfsaved))␉␉␉@\␊ |
162 | ␉.set␉__grfbase,(__framesize - 4*(grfsaved) - 8*(fpfsaved))␉@\␊ |
163 | ␉.set␉__fpfbase,(__framesize - 8*(fpfsaved))␉␉␉@\␊ |
164 | ␉mflr␉r0␉␉␉␉␉␉␉@\␊ |
165 | ␉mfcr␉r12␉␉␉␉␉␉␉@\␊ |
166 | ␉stw␉r0,8(sp)␉␉␉␉␉␉@\␊ |
167 | ␉stw␉r12,4(sp)␉␉␉␉␉␉@\␊ |
168 | ␉stwu␉r1,-__framesize(r1)␊ |
169 | ␊ |
170 | /*␊ |
171 | * Macros for referencing data in stack frame.␊ |
172 | *␊ |
173 | * NOTE WELL: ARG's and VAR's start at 1, NOT 0. Why ??? (FIXME)␊ |
174 | */␊ |
175 | #define␉LOCAL_VAR(n)␉(((n)-1)*4 + __argoutsize + 24)␊ |
176 | #define␉SAVED_GRF_S(n)␉(__grfbase + ((grfsaved) - (n) - 2) * 4)␊ |
177 | #define␉SAVED_FRF_FS(n)␉(__fpfbase + ((fpfsaved) - (n) - 1) * 4)␊ |
178 | #define␉ARG_IN(n)␉(ARG(n) + __framesize)␊ |
179 | #define␉ARG_OUT(n)␉(ARG(n) + 0)␊ |
180 | #define␉SAVED_FP␉(__grfbase + ((grfsaved) - 1) * 4)␊ |
181 | #define␉SAVED_LR␉(__framesize + 8)␊ |
182 | #define␉SAVED_CR␉(__framesize + 4)␊ |
183 | ␊ |
184 | /*␊ |
185 | * Macros for unwinding stack frame.␊ |
186 | * NOTE: GRF's and FPF's are NOT RESTORED. User must do this before␊ |
187 | * using this macro.␊ |
188 | */␊ |
189 | #define␉RETURN␉␉␉␉␉␉\␊ |
190 | ␉.if␉__framesize␉␉␉␉@\␊ |
191 | ␉ lwz32␉r0,r1,SAVED_LR␉␉␉␉@\␊ |
192 | ␉ lwz32␉r12,r1,SAVED_CR␉␉␉␉@\␊ |
193 | ␉ addic␉sp,r1,__framesize␉␉␉@\␊ |
194 | ␉ mtlr␉r0␉␉␉␉␉@\␊ |
195 | ␉ mtcrf␉0xff,r12␉␉␉␉@\␊ |
196 | ␉ blr␉␉␉␉␉␉@\␊ |
197 | ␉.else␉␉␉␉␉␉@\␊ |
198 | ␉ blr␉␉␉␉␉␉@\␊ |
199 | ␉.endif␊ |
200 | ␊ |
201 | ␊ |
202 | /*␊ |
203 | * Macros for declaring procedures␊ |
204 | *␊ |
205 | * Use of these macros allows ctags to have a predictable way␊ |
206 | * to find various types of declarations. They also simplify␊ |
207 | * inserting appropriate symbol table information.␊ |
208 | *␊ |
209 | * NOTE: these simple stubs will be replaced with more␊ |
210 | * complicated versions once we know what the linker and gdb␊ |
211 | * will require as far as register use masks and frame declarations.␊ |
212 | * These macros may also be ifdef'ed in the future to contain profiling␊ |
213 | * code.␊ |
214 | *␊ |
215 | * FIXME: Document what makes a leaf a LEAF and a handler a HANDLER.␊ |
216 | * (E.g. leaf's have return pc in lr, NESTED's have rpc in offset off␊ |
217 | * sp, handlers have rpc in exception frame which is found via exception␊ |
218 | * link, etc etc.)␊ |
219 | */␊ |
220 | ␊ |
221 | /*␊ |
222 | * TEXT -- declare start of text segment␊ |
223 | */␊ |
224 | #define␉TEXT␉␉␉␉␉␉\␊ |
225 | ␉.text␉␉␉␉␉␉@\␊ |
226 | ␉.align 2␊ |
227 | ␊ |
228 | /*␊ |
229 | * LEAF -- declare global leaf procedure␊ |
230 | * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only␊ |
231 | * be jumped to. (A leaf may do an align.) Use a LABEL() if you␊ |
232 | * need control to flow into the label.␊ |
233 | */␊ |
234 | #define␉LEAF(name)␉␉␉␉␉\␊ |
235 | ␉.align 2␉␉␉␉␉@\␊ |
236 | ␉.globl␉name␉␉␉␉␉@\␊ |
237 | name:␉␉␉␉␉␉␉@\␊ |
238 | ␉.set␉__framesize,0␊ |
239 | ␊ |
240 | /*␊ |
241 | * X_LEAF -- declare alternate global label for leaf␊ |
242 | */␊ |
243 | #define␉X_LEAF(name, value)␉␉␉␉\␊ |
244 | ␉.globl␉name␉␉␉␉␉@\␊ |
245 | ␉.set␉name,value␊ |
246 | ␊ |
247 | /*␊ |
248 | * P_LEAF -- declare private leaf procedure␊ |
249 | */␊ |
250 | #define␉P_LEAF(name)␉␉␉␉␉\␊ |
251 | ␉.align 2␉␉␉␉␉@\␊ |
252 | name:␉␉␉␉␉␉␉@\␊ |
253 | ␉.set␉__framesize,0␊ |
254 | ␊ |
255 | /*␊ |
256 | * LABEL -- declare a global code label␊ |
257 | * MUST be used (rather than LEAF, NESTED, etc) if control␊ |
258 | * "flows into" the label.␊ |
259 | */␊ |
260 | #define␉LABEL(name)␉␉␉␉␉\␊ |
261 | ␉.align 2␉␉␉␉␉@\␊ |
262 | ␉.globl␉name␉␉␉␉␉@\␊ |
263 | name:␊ |
264 | ␊ |
265 | /*␊ |
266 | * NESTED -- declare procedure that invokes other procedures␊ |
267 | */␊ |
268 | #define␉NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\␊ |
269 | ␉.align 2␉␉␉␉@\␊ |
270 | ␉.globl␉name␉␉␉␉@\␊ |
271 | name:␉␉␉␉␉␉@\␊ |
272 | ␉BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved)␊ |
273 | ␊ |
274 | /*␊ |
275 | * X_NESTED -- declare alternate global label for nested proc␊ |
276 | */␊ |
277 | #define␉X_NESTED(name, value)␉␉␉\␊ |
278 | ␉.globl␉name␉␉␉␉@\␊ |
279 | ␉.set␉name,value␊ |
280 | ␊ |
281 | /*␊ |
282 | * P_NESTED -- declare private nested procedure␊ |
283 | */␊ |
284 | #define␉P_NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\␊ |
285 | ␉.align 2␉␉␉␉␉@\␊ |
286 | name:␉␉␉␉␉␉␉@\␊ |
287 | ␉BUILD_FRAME(locavarsize, maxargsout, grfsaved, fpfsaved)␊ |
288 | ␊ |
289 | /*␊ |
290 | * HANDLER -- declare procedure with exception frame rather than␊ |
291 | * standard C frame␊ |
292 | */␊ |
293 | #define␉HANDLER(name)␉␉␉␉␉\␊ |
294 | ␉.align 2␉␉␉␉␉@\␊ |
295 | ␉.globl␉name␉␉␉␉␉@\␊ |
296 | name:␊ |
297 | ␊ |
298 | /*␊ |
299 | * X_HANDLER -- declare alternate name for exception handler␊ |
300 | * (Should appear immediately before a HANDLER declaration or␊ |
301 | * another X_HANDLER declaration)␊ |
302 | */␊ |
303 | #define␉X_HANDLER(name)␉␉␉␉␉\␊ |
304 | ␉.align 2␉␉␉␉␉@\␊ |
305 | ␉.globl␉name␉␉␉␉␉@\␊ |
306 | name:␊ |
307 | ␊ |
308 | /*␊ |
309 | * P_HANDLER -- declare private handler␊ |
310 | */␊ |
311 | #define␉P_HANDLER(name)␉␉␉␉␉\␊ |
312 | ␉.align 2␉␉␉␉@\␊ |
313 | name:␊ |
314 | ␊ |
315 | /*␊ |
316 | * END -- mark end of procedure␊ |
317 | * FIXME: Unimplemented for now.␊ |
318 | */␊ |
319 | #define␉END(name)␊ |
320 | ␊ |
321 | /*␊ |
322 | * BL -- call procedure (relative)␊ |
323 | */␊ |
324 | #define␉BL(name)␉␉␉␉␉\␊ |
325 | ␉bl␉name␊ |
326 | ␊ |
327 | /*␊ |
328 | * Storage definition macros␊ |
329 | * The main purpose of these is to allow an easy handle for ctags␊ |
330 | */␊ |
331 | ␊ |
332 | /*␊ |
333 | * IMPORT -- import symbol␊ |
334 | */␊ |
335 | #define␉IMPORT(name)␉␉␉␉␉\␊ |
336 | ␉.reference␉name␊ |
337 | ␊ |
338 | /*␊ |
339 | * ABS -- declare global absolute symbol␊ |
340 | */␊ |
341 | #define␉ABS(name, value)␉␉␉␉\␊ |
342 | ␉.globl␉name␉␉␉␉␉@\␊ |
343 | ␉.set␉name,value␊ |
344 | ␊ |
345 | /*␊ |
346 | * P_ABS -- declare private absolute symbol␊ |
347 | */␊ |
348 | #define␉P_ABS(name, value)␉␉␉␉\␊ |
349 | ␉.set␉name,value␊ |
350 | ␊ |
351 | /*␊ |
352 | * EXPORT -- declare global label for data␊ |
353 | */␊ |
354 | #define␉EXPORT(name)␉␉␉␉␉\␊ |
355 | ␉.align 2␉␉␉␉␉@\␊ |
356 | ␉.globl␉name␉␉␉␉␉@\␊ |
357 | name:␊ |
358 | ␊ |
359 | /*␊ |
360 | * BSS -- declare global zero'ed storage␊ |
361 | */␊ |
362 | #define␉BSS(name,size)␉␉␉␉␉\␊ |
363 | ␉.comm␉name,size␊ |
364 | ␊ |
365 | ␊ |
366 | /*␊ |
367 | * P_BSS -- declare private zero'ed storage␊ |
368 | */␊ |
369 | #define␉P_BSS(name,size)␉␉␉␉\␊ |
370 | ␉.lcomm␉name,size␊ |
371 | ␊ |
372 | /*␊ |
373 | * dynamic/PIC macros for routines which reference external symbols␊ |
374 | */␊ |
375 | #if defined(__DYNAMIC__)␊ |
376 | #define PICIFY_REG r12␊ |
377 | ␊ |
378 | /* Assume that the lr is saved before calling any of these macros */␊ |
379 | /* using PICIFY() */␊ |
380 | ␊ |
381 | #define PICIFY(var)␉␉␉␉\␊ |
382 | ␉mflr␉r0␉␉␉␉@\␊ |
383 | ␉bcl␉20,31,1f␉␉␉@\␊ |
384 | 1:␉mflr␉PICIFY_REG␉␉␉@\␊ |
385 | ␉mtlr␉r0␉␉␉␉@\␊ |
386 | ␉addis␉PICIFY_REG, PICIFY_REG, ha16(L ## var ## __non_lazy_ptr - 1b) @\␊ |
387 | ␉lwz␉PICIFY_REG, lo16(L ## var ## __non_lazy_ptr - 1b)(PICIFY_REG)␊ |
388 | ␊ |
389 | #define CALL_EXTERN_AGAIN(var)␉␉␉\␊ |
390 | ␉PICIFY(var)␉␉␉␉@\␊ |
391 | ␉mtctr␉PICIFY_REG␉␉␉@\␊ |
392 | ␉mflr␉r0␉␉␉␉@\␊ |
393 | ␉stw␉r0,8(r1)␉␉␉@\␊ |
394 | ␉stwu␉r1,-64(r1)␉␉␉@\␊ |
395 | ␉bctrl␉␉␉␉␉@\␊ |
396 | ␉addic␉r1,r1,64 ␉␉␉@\␊ |
397 | ␉lwz␉r0,8(r1)␉␉␉@\␊ |
398 | ␉mtlr␉r0␊ |
399 | ␊ |
400 | #define NON_LAZY_STUB(var)␉␉␉\␊ |
401 | ␉.non_lazy_symbol_pointer␉␉@\␊ |
402 | ␉.align 2␉␉␉␉@\␊ |
403 | L ## var ## __non_lazy_ptr:␉␉␉@\␊ |
404 | ␉.indirect_symbol var␉␉␉@\␊ |
405 | ␉.long 0␉␉␉␉␉@\␊ |
406 | ␉.text␉␉␉␉␉@\␊ |
407 | ␉.align 2␊ |
408 | ␊ |
409 | #define␉BRANCH_EXTERN(var)␉␉␉\␊ |
410 | ␉PICIFY(var)␉␉␉␉@\␊ |
411 | ␉mtctr␉PICIFY_REG␉␉␉@\␊ |
412 | ␉bctr␉␉␉␉␉@\␊ |
413 | ␉NON_LAZY_STUB(var)␊ |
414 | ␊ |
415 | #define CALL_EXTERN(var)␉␉␉\␊ |
416 | ␉CALL_EXTERN_AGAIN(var)␉␉␉@\␊ |
417 | ␉NON_LAZY_STUB(var)␊ |
418 | ␊ |
419 | #define REG_TO_EXTERN(reg, var)␉␉␉\␊ |
420 | ␉PICIFY(var)␉␉␉␉@\␊ |
421 | ␉stw reg, 0(PICIFY_REG)␉␉␉@\␊ |
422 | ␉NON_LAZY_STUB(var)␊ |
423 | ␊ |
424 | #define EXTERN_TO_REG(reg, var)␉␉␉\␊ |
425 | ␉PICIFY(var)␉␉␉␉@\␊ |
426 | ␉lwz␉reg, 0(PICIFY_REG)␉␉@\␊ |
427 | ␉NON_LAZY_STUB(var)␊ |
428 | ␊ |
429 | #else /* ! __DYNAMIC__ */␊ |
430 | #define TMP_REG r12␊ |
431 | #define BRANCH_EXTERN(var)␉␉␉\␊ |
432 | ␉b␉var␊ |
433 | ␊ |
434 | #define CALL_EXTERN(var)␉␉␉\␊ |
435 | ␉bl␉var␊ |
436 | ␊ |
437 | #define CALL_EXTERN_AGAIN(var)␉␉␉\␊ |
438 | ␉CALL_EXTERN(var)␊ |
439 | ␊ |
440 | #define REG_TO_EXTERN(reg, var)␉␉␉\␊ |
441 | ␉lis␉TMP_REG, ha16(var)␉␉@\␊ |
442 | ␉stw␉reg, lo16(var)(TMP_REG)␊ |
443 | ␊ |
444 | #define EXTERN_TO_REG(reg, var)␉␉␉\␊ |
445 | ␉lis␉reg, ha16(var)␉␉␉@\␊ |
446 | ␉lwz␉reg, lo16(var)(reg)␊ |
447 | ␊ |
448 | #endif␉/* __DYNAMIC__ */␊ |
449 | ␊ |
450 | #endif␉/* __ASSEMBLER__ */␊ |
451 | #endif␉/* _ARCH_PPC_ASM_HELP_H_ */␊ |
452 |