* src/vm/vm.c (vm_array_store_flt): Handle __POWERPC__ correctly.
[cacao.git] / src / vm / jit / powerpc / asmpart.S
1 /* src/vm/jit/powerpc/asmpart.S - Java-C interface functions for PowerPC
2                 
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software.text;  you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation;  either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY ;  without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program;  if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: asmpart.S 8270 2007-08-08 13:57:12Z twisti $
26
27 */
28
29
30 #include "config.h"
31
32 #include "md-abi.h"
33 #include "md-asm.h"
34
35 #include "vm/jit/abi-asm.h"
36 #include "vm/jit/methodheader.h"
37 #include "vm/jit/powerpc/offsets.h"
38
39
40         .text
41
42         .align 2
43
44
45 /* export functions ***********************************************************/
46
47         .globl asm_vm_call_method
48         .globl asm_vm_call_method_int
49         .globl asm_vm_call_method_long
50         .globl asm_vm_call_method_float
51         .globl asm_vm_call_method_double
52
53         .globl asm_vm_call_method_exception_handler
54         .globl asm_vm_call_method_end
55
56         .globl asm_call_jit_compiler
57
58         .globl asm_handle_nat_exception
59         .globl asm_handle_exception
60
61         .globl asm_abstractmethoderror
62
63 #if defined(ENABLE_REPLACEMENT)
64         .globl asm_replacement_out
65         .globl asm_replacement_in
66 #endif
67
68         .globl asm_cacheflush
69
70         .globl asm_compare_and_swap
71         .globl asm_memory_barrier
72
73         .globl asm_criticalsections
74         .globl asm_getclassvalues_atomic
75
76
77 /* asm_vm_call_method **********************************************************
78 *                                                                              *
79 *   This function calls a Java-method (which possibly needs compilation)       *
80 *   with up to 4 address parameters.                                           *
81 *                                                                              *
82 *   This functions calls the JIT-compiler which eventually translates the      *
83 *   method into machine code.                                                  *
84 *                                                                              *
85 *   C-prototype:                                                               *
86 *    javaobject_header *asm_calljavamethod (methodinfo *m,                     *
87 *         void *arg1, void *arg2, void *arg3, void *arg4);                     *
88 *                                                                              *
89 *******************************************************************************/
90
91         .align 2
92
93         .long   0                         /* catch type all                       */
94         .long   0                         /* exception handler pc                 */
95         .long   0                         /* end pc                               */
96         .long   0                         /* start pc                             */
97         .long   1                         /* extable size                         */
98         .long   0                         /* line number table start              */
99         .long   0                         /* line number table size               */
100         .long   0                         /* fltsave                              */
101         .long   0                         /* intsave                              */
102         .long   0                         /* IsLeaf                               */
103         .long   0                         /* IsSync                               */
104         .long   0                         /* frame size                           */
105         .long   0                         /* codeinfo pointer                     */
106
107 asm_vm_call_method:
108 asm_vm_call_method_int:
109 asm_vm_call_method_long:
110 asm_vm_call_method_float:
111 asm_vm_call_method_double:
112         mflr    r0
113         stw     r0,LA_LR_OFFSET(sp)
114         stwu    sp,-40*4(sp)              /* keep stack 16-byte aligned           */
115
116         stw     s0,8*4(sp)                /* save used callee saved registers     */
117         stw     a0,9*4(sp)                /* save method PV                       */
118
119 #if defined(__DARWIN__)
120         stw     itmp1,10*4(sp)            /* register r11 is callee saved         */
121 #endif
122         stw     pv,11*4(sp)               /* save PV register                     */
123
124         stw     itmp3,12*4(sp)            /* registers r14-r31 are callee saved   */
125         stfd    ftmp1,14*4(sp)            /* registers f14-f31 are callee saved   */
126         stfd    ftmp2,16*4(sp)
127
128 #if defined(__DARWIN__)
129         stw     t1,18*4(sp)
130         stw     t2,19*4(sp)
131         stw     t3,20*4(sp)
132         stw     t4,21*4(sp)
133         stw     t5,22*4(sp)
134         stw     t6,23*4(sp)
135         stw     t7,24*4(sp)
136
137         stfd    ft0,26*4(sp)
138         stfd    ft1,28*4(sp)
139         stfd    ft2,30*4(sp)
140         stfd    ft3,32*4(sp)
141         stfd    ft4,34*4(sp)
142         stfd    ft5,36*4(sp)
143 #else
144         SAVE_TEMPORARY_REGISTERS(18)        /* the offset has to be even          */
145 #endif
146
147         mr      t0,a1                       /* address of data structure          */
148         mr      t1,a2                       /* stack argument count               */
149
150         mr      s0,sp                       /* save SP                            */
151
152         lwz     a0,0*8+4(t0)                /* we are on big-endian               */
153         lwz     a1,1*8+4(t0)
154         lwz     a2,2*8+4(t0)
155         lwz     a3,3*8+4(t0)
156         lwz     a4,4*8+4(t0)
157         lwz     a5,5*8+4(t0)
158         lwz     a6,6*8+4(t0)
159         lwz     a7,7*8+4(t0)
160
161         lfd     fa0,8*8(t0)
162         lfd     fa1,9*8(t0)
163         lfd     fa2,10*8(t0)
164         lfd     fa3,11*8(t0)
165         lfd     fa4,12*8(t0)
166         lfd     fa5,13*8(t0)
167         lfd     fa6,14*8(t0)
168         lfd     fa7,15*8(t0)
169
170 #if defined(__DARWIN__)
171         lfd     fa8,16*8(t0)
172         lfd     fa9,17*8(t0)
173         lfd     fa10,18*8(t0)
174         lfd     fa11,19*8(t0)
175         lfd     fa12,20*8(t0)
176 #endif
177
178         mr.     t1,t1
179         beq     L_asm_vm_call_method_stack_copy_done
180
181         slwi    t2,t1,3                     /* calculate stackframe size (* 8)    */
182
183         sub     sp,sp,t2                    /* create stackframe                  */
184         mr      t2,sp                       /* temporary stack pointer            */
185
186 L_asm_vm_call_method_stack_copy_loop:
187 #if defined(__DARWIN__)
188         lwz     t3,21*8+0(t0)               /* load argument                      */
189         lwz     t4,21*8+4(t0)
190 #else
191         lwz     t3,16*8+0(t0)               /* load argument                      */
192         lwz     t4,16*8+4(t0)
193 #endif
194         stw     t3,0(t2)                    /* store argument on stack            */
195         stw     t4,4(t2)
196
197         addi    t0,t0,8                     /* load address of next argument      */
198         addi    t2,t2,8                     /* increase stack pointer             */
199         addi    t1,t1,-1                    /* subtract 1 argument                */
200         mr.     t1,t1
201         bgt     L_asm_vm_call_method_stack_copy_loop
202
203 L_asm_vm_call_method_stack_copy_done:
204         addi    mptr,s0,9*4                 /* get address of PV                  */
205         lwz     pv,0*4(mptr)                /* load PV                            */
206         mtctr   pv
207         bctrl
208 1:
209         mflr    itmp1
210 #if defined(__DARWIN__)
211         addi    pv,itmp1,lo16(asm_vm_call_method - 1b)
212 #else
213         addi    pv,itmp1,(asm_vm_call_method - 1b)@l
214 #endif
215
216 L_asm_vm_call_method_return:
217         mr      sp,s0                       /* restore the SP                     */
218
219         lwz     s0,8*4(sp)                  /* restore used callee saved registers*/
220
221 #if defined(__DARWIN__)
222         lwz     itmp1,10*4(sp)              /* register r11 is callee saved       */
223 #endif
224         lwz     pv,11*4(sp)                 /* save PV register                   */
225
226         lwz     itmp3,12*4(sp)
227         lfd     ftmp1,14*4(sp)              /* registers f14-f31 are callee saved */
228         lfd     ftmp2,16*4(sp)
229
230 #if defined(__DARWIN__)
231         lwz     t1,18*4(sp)
232         lwz     t2,19*4(sp)
233         lwz     t3,20*4(sp)
234         lwz     t4,21*4(sp)
235         lwz     t5,22*4(sp)
236         lwz     t6,23*4(sp)
237         lwz     t7,24*4(sp)
238
239         lfd     ft0,26*4(sp)
240         lfd     ft1,28*4(sp)
241         lfd     ft2,30*4(sp)
242         lfd     ft3,32*4(sp)
243         lfd     ft4,34*4(sp)
244         lfd     ft5,36*4(sp)
245 #else
246         RESTORE_TEMPORARY_REGISTERS(18)   /* the offset has to be even            */
247 #endif
248
249         lwz     r0,40*4+LA_LR_OFFSET(sp)
250         mtlr    r0
251         addi    sp,sp,40*4
252         blr
253
254 asm_vm_call_method_exception_handler:
255         mr      a0,itmp1
256         bl      builtin_throw_exception
257         b       L_asm_vm_call_method_return
258
259 asm_vm_call_method_end:
260         nop
261
262
263 /* asm_call_jit_compiler *******************************************************
264
265    Invokes the compiler for untranslated JavaVM methods.
266
267 *******************************************************************************/
268
269 asm_call_jit_compiler:
270 L_asm_call_jit_compiler:                /* required for PIC code              */
271         mflr    r0
272         stw     r0,LA_LR_OFFSET(sp)         /* save return address                */
273         stwu    sp,-(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)(sp)
274
275 #if defined(__DARWIN__)
276         stw     a0,LA_SIZE+(4+0)*4(sp)
277         stw     a1,LA_SIZE+(4+1)*4(sp)
278         stw     a2,LA_SIZE+(4+2)*4(sp)
279         stw     a3,LA_SIZE+(4+3)*4(sp)
280         stw     a4,LA_SIZE+(4+4)*4(sp)
281         stw     a5,LA_SIZE+(4+5)*4(sp)
282         stw     a6,LA_SIZE+(4+6)*4(sp)
283         stw     a7,LA_SIZE+(4+7)*4(sp)
284
285         stfd    fa0,LA_SIZE+(4+8)*4(sp)
286         stfd    fa1,LA_SIZE+(4+10)*4(sp)
287         stfd    fa2,LA_SIZE+(4+12)*4(sp)
288         stfd    fa3,LA_SIZE+(4+14)*4(sp)
289         stfd    fa4,LA_SIZE+(4+16)*4(sp)
290         stfd    fa5,LA_SIZE+(4+18)*4(sp)
291         stfd    fa6,LA_SIZE+(4+20)*4(sp)
292         stfd    fa7,LA_SIZE+(4+22)*4(sp)
293         stfd    fa8,LA_SIZE+(4+24)*4(sp)
294         stfd    fa9,LA_SIZE+(4+26)*4(sp)
295         stfd    fa10,LA_SIZE+(4+28)*4(sp)
296         stfd    fa11,LA_SIZE+(4+30)*4(sp)
297         stfd    fa12,LA_SIZE+(4+32)*4(sp)
298 #else
299         SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
300 #endif
301
302         mr      a0,itmp1
303         mr      a1,mptr
304         addi    a2,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
305         lwz     a3,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
306         bl      jit_asm_compile
307         mr      pv,v0                       /* move address to pv register        */
308
309 #if defined(__DARWIN__)
310         lwz     a0,LA_SIZE+(4+0)*4(sp)
311         lwz     a1,LA_SIZE+(4+1)*4(sp)
312         lwz     a2,LA_SIZE+(4+2)*4(sp)
313         lwz     a3,LA_SIZE+(4+3)*4(sp)
314         lwz     a4,LA_SIZE+(4+4)*4(sp)
315         lwz     a5,LA_SIZE+(4+5)*4(sp)
316         lwz     a6,LA_SIZE+(4+6)*4(sp)
317         lwz     a7,LA_SIZE+(4+7)*4(sp)
318
319         lfd     fa0,LA_SIZE+(4+8)*4(sp)
320         lfd     fa1,LA_SIZE+(4+10)*4(sp)
321         lfd     fa2,LA_SIZE+(4+12)*4(sp)
322         lfd     fa3,LA_SIZE+(4+14)*4(sp)
323         lfd     fa4,LA_SIZE+(4+16)*4(sp)
324         lfd     fa5,LA_SIZE+(4+18)*4(sp)
325         lfd     fa6,LA_SIZE+(4+20)*4(sp)
326         lfd     fa7,LA_SIZE+(4+22)*4(sp)
327         lfd     fa8,LA_SIZE+(4+24)*4(sp)
328         lfd     fa9,LA_SIZE+(4+26)*4(sp)
329         lfd     fa10,LA_SIZE+(4+28)*4(sp)
330         lfd     fa11,LA_SIZE+(4+30)*4(sp)
331         lfd     fa12,LA_SIZE+(4+32)*4(sp)
332 #else
333         RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
334 #endif
335
336         lwz     itmp1,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
337         mtlr    itmp1
338
339         addi    sp,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
340
341         mr.     pv,pv                       /* test for exception                 */
342         beq     L_asm_call_jit_compiler_exception
343
344         mtctr   pv                          /* move method address to control reg */
345         bctr                                /* and call the Java method           */
346
347 L_asm_call_jit_compiler_exception:
348         mflr    r0
349         stw     r0,LA_LR_OFFSET(sp)
350         stwu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
351         bl      exceptions_get_and_clear_exception
352         lwz     xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
353         mtlr    xpc     
354         addi    sp,sp,LA_SIZE_ALIGNED
355
356         mr      xptr,v0                     /* get exception                      */
357         addi    xpc,xpc,-4                  /* exception address is ra - 4        */
358         b       L_asm_handle_nat_exception
359
360
361 /********************* function asm_handle_exception ***************************
362 *                                                                              *
363 *   This function handles an exception. It does not use the usual calling      *
364 *   conventions. The exception pointer is passed in REG_ITMP1 and the          *
365 *   pc from the exception raising position is passed in REG_ITMP2. It searches *
366 *   the local exception table for a handler. If no one is found, it unwinds    *
367 *   stacks and continues searching the callers.                                *
368 *                                                                              *
369 *   void asm_handle_exception (exceptionptr, exceptionpc);                     *
370 *                                                                              *
371 *******************************************************************************/
372                 
373 asm_handle_nat_exception:
374 L_asm_handle_nat_exception:             /* required for PIC code              */
375 L_asm_handle_exception_stack_loop:
376         mflr    r0
377         addi    sp,sp,-(LA_SIZE+((4+6)*4))  /* allocate stack (+4 for darwin)     */
378         stw     xptr,LA_SIZE+(4+0)*4(sp)    /* save exception pointer             */
379         stw     xpc,LA_SIZE+(4+1)*4(sp)     /* save exception pc                  */
380         stw     r0,LA_SIZE+(4+3)*4(sp)      /* save return address                */
381         li      itmp3,0
382         stw     itmp3,LA_SIZE+(4+4)*4(sp)   /* save maybe-leaf flag (cleared)     */
383
384         mr      a0,r0                       /* pass return address                */
385         bl      md_codegen_get_pv_from_pc   /* get PV from RA                     */
386         stw     v0,LA_SIZE+(4+2)*4(sp)      /* save data segment pointer          */
387
388         lwz     a0,LA_SIZE+(4+0)*4(sp)      /* pass xptr                          */
389         lwz     a1,LA_SIZE+(4+1)*4(sp)      /* pass xpc                           */
390         lwz     a2,LA_SIZE+(4+2)*4(sp)      /* pass PV (v0 == a0)                 */
391         addi    a3,sp,LA_SIZE+((4+6)*4)     /* pass Java SP                       */
392
393         b       L_asm_handle_exception_continue
394
395 asm_handle_exception:
396 L_asm_handle_exception:                 /* required for PIC code              */
397         addi    sp,sp,-(ARG_CNT+TMP_CNT)*8  /* create maybe-leaf stackframe       */
398
399 #if defined(__DARWIN__)
400 #else
401         SAVE_ARGUMENT_REGISTERS(0)          /* we save arg and temp registers in  */
402         SAVE_TEMPORARY_REGISTERS(ARG_CNT)   /* case this is a leaf method         */
403 #endif
404
405         addi    sp,sp,-(LA_SIZE+(4+6)*4)    /* allocate stack                     */
406         stw     xptr,LA_SIZE+(4+0)*4(sp)    /* save xptr                          */
407         stw     pv,LA_SIZE+(4+2)*4(sp)      /* save PV                            */
408         mflr    r0                          /* save RA                            */
409         stw     r0,LA_SIZE+(4+3)*4(sp)
410         li      t0,1                        /* set maybe-leaf flag                */
411         stw     t0,LA_SIZE+(4+4)*4(sp)      /* save maybe-leaf flag               */
412
413         mr      a0,xptr                     /* pass exception pointer             */
414         mr      a1,xpc                      /* pass exception pc                  */
415         mr      a2,pv                       /* pass data segment pointer          */
416         addi    a3,sp,LA_SIZE+(ARG_CNT+TMP_CNT)*8+(4+6)*4
417
418 L_asm_handle_exception_continue:
419         bl      exceptions_handle_exception
420
421         mr.     v0,v0
422         beq     L_asm_handle_exception_not_catched
423
424         mr      xpc,v0                      /* move handlerpc into xpc            */
425         lwz     xptr,LA_SIZE+(4+0)*4(sp)    /* restore xptr                       */
426         lwz     pv,LA_SIZE+(4+2)*4(sp)      /* restore PV                         */
427         lwz     r0,LA_SIZE+(4+3)*4(sp)      /* restore RA                         */
428         mtlr    r0
429         lwz     t0,LA_SIZE+(4+4)*4(sp)      /* get maybe-leaf flag                */
430         addi    sp,sp,LA_SIZE+(4+6)*4       /* free stack frame                   */
431
432         mr.     t0,t0
433         beq     L_asm_handle_exception_no_leaf
434
435 #if defined(__DARWIN__)
436 #else
437         RESTORE_ARGUMENT_REGISTERS(0)       /* if this is a leaf method, we have  */
438         RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers  */
439 #endif
440
441         addi    sp,sp,(ARG_CNT+TMP_CNT)*8   /* remove maybe-leaf stackframe       */
442
443 L_asm_handle_exception_no_leaf:
444         mtctr   xpc                         /* jump to the handler                */
445         bctr
446
447 L_asm_handle_exception_not_catched:
448         lwz     xptr,LA_SIZE+(4+0)*4(sp)    /* restore xptr                       */
449         lwz     pv,LA_SIZE+(4+2)*4(sp)      /* restore PV                         */
450         lwz     r0,LA_SIZE+(4+3)*4(sp)      /* restore RA                         */
451         mtlr    r0
452         lwz     t0,LA_SIZE+(4+4)*4(sp)      /* get maybe-leaf flag                */
453         addi    sp,sp,LA_SIZE+(4+6)*4       /* free stack frame                   */
454
455         mr.     t0,t0
456         beq     L_asm_handle_exception_no_leaf_stack
457
458         addi    sp,sp,(ARG_CNT+TMP_CNT)*8   /* remove maybe-leaf stackframe       */
459         li      t0,0                        /* clear the maybe-leaf flag          */
460
461 L_asm_handle_exception_no_leaf_stack:
462         lwz     t1,FrameSize(pv)            /* get frame size                     */
463         add     t1,sp,t1                    /* pointer to save area               */
464
465         lwz     t2,IsLeaf(pv)               /* is leaf procedure                  */
466         mr.     t2,t2
467         bne     L_asm_handle_exception_no_ra_restore
468
469         lwz     r0,LA_LR_OFFSET(t1)         /* restore ra                         */
470         mtlr    r0
471
472 L_asm_handle_exception_no_ra_restore:
473         mflr    xpc                         /* the new xpc is ra                  */
474         mr      t4,xpc                      /* save RA                            */
475         lwz     t2,IntSave(pv)              /* t2 = saved int register count      */
476         bl      ex_int1
477 ex_int1:
478         mflr    t3                          /* t3 = current pc                    */
479 #if defined(__DARWIN__)
480         addi    t3,t3,lo16(ex_int2-ex_int1)
481 #else
482         addi    t3,t3,(ex_int2-ex_int1)@l
483 #endif
484         slwi    t2,t2,2                     /* t2 = register count * 4            */
485         subf    t3,t2,t3                    /* t3 = IntSave - t2                  */
486         mtctr   t3
487         bctr
488
489         lwz     s0,-10*8(t1)
490         lwz     s1,-9*8(t1)
491         lwz     s2,-8*8(t1)
492         lwz     s3,-7*8(t1)
493         lwz     s4,-6*8(t1)
494         lwz     s5,-5*8(t1)
495         lwz     s6,-4*8(t1)
496         lwz     s7,-3*8(t1)
497         lwz     s8,-2*8(t1)
498         lwz     s9,-1*8(t1)
499
500 ex_int2:
501         subf    t1,t2,t1                    /* t1 = t1 - register count * 4       */
502
503         lwz     t2,FltSave(pv)
504         bl      ex_flt1
505 ex_flt1:
506         mflr    t3
507 #if defined(__DARWIN__)
508         addi    t3,t3,lo16(ex_flt2-ex_flt1)
509 #else
510         addi    t3,t3,(ex_flt2-ex_flt1)@l
511 #endif
512         slwi    t2,t2,2                     /* t2 = register count * 4            */
513         subf    t3,t2,t3                    /* t3 = FltSave - t2                  */
514         mtctr   t3
515         bctr
516
517         lfd     fs0,-10*8(t1)
518         lfd     fs1,-9*8(t1)
519         lfd     fs2,-8*8(t1)
520         lfd     fs3,-7*8(t1)
521         lfd     fs4,-6*8(t1)
522         lfd     fs5,-5*8(t1)
523         lfd     fs6,-4*8(t1)
524         lfd     fs7,-3*8(t1)
525         lfd     fs8,-2*8(t1)
526         lfd     fs9,-1*8(t1)
527
528 ex_flt2:
529         mtlr    t4                          /* restore RA                         */
530         lwz     t1,FrameSize(pv)            /* get frame size                     */
531         add     sp,sp,t1                    /* unwind stack                       */
532         b       L_asm_handle_exception_stack_loop
533
534
535 /* asm_abstractmethoderror *****************************************************
536
537    Creates and throws an AbstractMethodError.
538
539 *******************************************************************************/
540
541 asm_abstractmethoderror:
542         mflr    r0
543         stw     r0,LA_LR_OFFSET(sp)
544         stwu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
545         addi    a0,sp,LA_SIZE_ALIGNED       /* pass java sp                       */
546         mr      a1,r0                       /* pass exception address             */
547         bl      exceptions_asm_new_abstractmethoderror
548         lwz     r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
549         mtlr    r0                          /* restore return address             */
550         addi    sp,sp,LA_SIZE_ALIGNED
551
552         mr      xptr,v0                     /* get exception pointer              */
553         mr      xpc,r0                      /* we can't use r0 directly in addi   */
554         addi    xpc,xpc,-4                  /* exception address is ra - 4        */
555         b       L_asm_handle_nat_exception
556
557
558 #if defined(ENABLE_REPLACEMENT)
559
560 /* asm_replacement_out *********************************************************
561
562    This code is jumped to from the replacement-out stubs that are executed
563    when a thread reaches an activated replacement point.
564
565    The purpose of asm_replacement_out is to read out the parts of the
566    execution state that cannot be accessed from C code, store this state,
567    and then call the C function replace_me.
568
569    Stack layout:
570       16                start of stack inside method to replace
571       0   rplpoint *    info on the replacement point that was reached
572
573    NOTE: itmp3 has been clobbered by the replacement-out stub!
574
575 *******************************************************************************/
576
577 /* some room to accomodate changes of the stack frame size during replacement */
578         /* XXX we should find a cleaner solution here */
579 #define REPLACEMENT_ROOM  512
580
581 #define sizeexecutionstate_ALIGNED  ((sizeexecutionstate + 15) & ~15)
582
583 asm_replacement_out:
584     /* create stack frame */
585         addi    sp,sp,-(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM)
586
587         /* save link register */
588         mflr    itmp3
589
590         /* save registers in execution state */
591         stw     r0 ,( 0*4+offes_intregs)(sp)
592         stw     r1 ,( 1*4+offes_intregs)(sp)
593         stw     r2 ,( 2*4+offes_intregs)(sp)
594         stw     r3 ,( 3*4+offes_intregs)(sp)
595         stw     r4 ,( 4*4+offes_intregs)(sp)
596         stw     r5 ,( 5*4+offes_intregs)(sp)
597         stw     r6 ,( 6*4+offes_intregs)(sp)
598         stw     r7 ,( 7*4+offes_intregs)(sp)
599         stw     r8 ,( 8*4+offes_intregs)(sp)
600         stw     r9 ,( 9*4+offes_intregs)(sp)
601         stw     r10,(10*4+offes_intregs)(sp)
602         stw     r11,(11*4+offes_intregs)(sp)
603         stw     r12,(12*4+offes_intregs)(sp)
604         stw     r13,(13*4+offes_intregs)(sp)
605         stw     r14,(14*4+offes_intregs)(sp)
606         stw     r15,(15*4+offes_intregs)(sp)
607         stw     r16,(16*4+offes_intregs)(sp) /* link register stored as itmp3 */
608         stw     r17,(17*4+offes_intregs)(sp)
609         stw     r18,(18*4+offes_intregs)(sp)
610         stw     r19,(19*4+offes_intregs)(sp)
611         stw     r20,(20*4+offes_intregs)(sp)
612         stw     r21,(21*4+offes_intregs)(sp)
613         stw     r22,(22*4+offes_intregs)(sp)
614         stw     r23,(23*4+offes_intregs)(sp)
615         stw     r24,(24*4+offes_intregs)(sp)
616         stw     r25,(25*4+offes_intregs)(sp)
617         stw     r26,(26*4+offes_intregs)(sp)
618         stw     r27,(27*4+offes_intregs)(sp)
619         stw     r28,(28*4+offes_intregs)(sp)
620         stw     r29,(29*4+offes_intregs)(sp)
621         stw     r30,(30*4+offes_intregs)(sp)
622         stw     r31,(31*4+offes_intregs)(sp)
623         
624         stfd    fr0 ,( 0*8+offes_fltregs)(sp)
625         stfd    fr1 ,( 1*8+offes_fltregs)(sp)
626         stfd    fr2 ,( 2*8+offes_fltregs)(sp)
627         stfd    fr3 ,( 3*8+offes_fltregs)(sp)
628         stfd    fr4 ,( 4*8+offes_fltregs)(sp)
629         stfd    fr5 ,( 5*8+offes_fltregs)(sp)
630         stfd    fr6 ,( 6*8+offes_fltregs)(sp)
631         stfd    fr7 ,( 7*8+offes_fltregs)(sp)
632         stfd    fr8 ,( 8*8+offes_fltregs)(sp)
633         stfd    fr9 ,( 9*8+offes_fltregs)(sp)
634         stfd    fr10,(10*8+offes_fltregs)(sp)
635         stfd    fr11,(11*8+offes_fltregs)(sp)
636         stfd    fr12,(12*8+offes_fltregs)(sp)
637         stfd    fr13,(13*8+offes_fltregs)(sp)
638         stfd    fr14,(14*8+offes_fltregs)(sp)
639         stfd    fr15,(15*8+offes_fltregs)(sp)
640         stfd    fr16,(16*8+offes_fltregs)(sp)
641         stfd    fr17,(17*8+offes_fltregs)(sp)
642         stfd    fr18,(18*8+offes_fltregs)(sp)
643         stfd    fr19,(19*8+offes_fltregs)(sp)
644         stfd    fr20,(20*8+offes_fltregs)(sp)
645         stfd    fr21,(21*8+offes_fltregs)(sp)
646         stfd    fr22,(22*8+offes_fltregs)(sp)
647         stfd    fr23,(23*8+offes_fltregs)(sp)
648         stfd    fr24,(24*8+offes_fltregs)(sp)
649         stfd    fr25,(25*8+offes_fltregs)(sp)
650         stfd    fr26,(26*8+offes_fltregs)(sp)
651         stfd    fr27,(27*8+offes_fltregs)(sp)
652         stfd    fr28,(28*8+offes_fltregs)(sp)
653         stfd    fr29,(29*8+offes_fltregs)(sp)
654         stfd    fr30,(30*8+offes_fltregs)(sp)
655         stfd    fr31,(31*8+offes_fltregs)(sp)
656         
657         /* calculate sp of method */
658         addi    itmp1,sp,(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM + 4*4)
659         stw     itmp1,(offes_sp)(sp)
660
661         /* store pv */
662         stw     pv,(offes_pv)(sp)
663
664         /* call replace_me */
665         lwz     a0,-(4*4)(itmp1)            /* arg0: rplpoint *                   */
666         mr      a1,sp                       /* arg1: execution state              */
667         addi    sp,sp,-(LA_SIZE_ALIGNED)
668         b       replace_me                  /* call C function replace_me         */
669
670 /* asm_replacement_in **********************************************************
671
672    This code writes the given execution state and jumps to the replacement
673    code.
674
675    This function never returns!
676
677    NOTE: itmp3 is not restored!
678
679    C prototype:
680       void asm_replacement_in(executionstate *es, replace_safestack_t *st);
681
682 *******************************************************************************/
683
684 asm_replacement_in:
685         /* a0 == executionstate *es      */
686         /* a1 == replace_safestack_t *st */
687
688         /* get arguments */
689         mr              s1,a1                       /* replace_safestack_t *st            */
690         mr              s2,a0                       /* executionstate *es == safe stack   */
691
692         /* switch to the safe stack */
693         mr              sp,s2
694
695         /* reserve linkage area */
696         addi    sp,sp,-(LA_SIZE_ALIGNED)
697
698         /* call replace_build_execution_state(st) */
699         mr              a0,s1
700         bl              replace_build_execution_state
701
702         /* set new sp */
703         lwz             sp,(offes_sp)(s2)
704
705         /* build stack frame */
706         addi    sp,sp,-(sizeexecutionstate_ALIGNED)
707
708         /* call replace_free_safestack(st,& of allocated executionstate_t) */
709         mr              a1,sp /* tmpes */
710         mr              a0,s1 /* st    */
711         addi    sp,sp,-(LA_SIZE_ALIGNED)  /* reserve linkage area */
712         bl              replace_free_safestack
713         addi    sp,sp,+(LA_SIZE_ALIGNED)  /* tear down linkage area */
714
715         /* set new pv */
716         lwz     pv,(offes_pv)(sp)
717         
718         /* copy registers from execution state */
719         lwz     r0 ,( 0*4+offes_intregs)(sp)
720         /* r1 is sp                       */
721         /* r2 is reserved                 */
722         lwz     a0 ,( 3*4+offes_intregs)(sp)
723         lwz     r4 ,( 4*4+offes_intregs)(sp)
724         lwz     r5 ,( 5*4+offes_intregs)(sp)
725         lwz     r6 ,( 6*4+offes_intregs)(sp)
726         lwz     r7 ,( 7*4+offes_intregs)(sp)
727         lwz     r8 ,( 8*4+offes_intregs)(sp)
728         lwz     r9 ,( 9*4+offes_intregs)(sp)
729         lwz     r10,(10*4+offes_intregs)(sp)
730         lwz     r11,(11*4+offes_intregs)(sp)
731         lwz     r12,(12*4+offes_intregs)(sp)
732         /* r13 is pv                      */
733         lwz     r14,(14*4+offes_intregs)(sp)
734         lwz     r15,(15*4+offes_intregs)(sp)
735         lwz     r16,(16*4+offes_intregs)(sp) /* itmp3, later to link register */
736         lwz     r17,(17*4+offes_intregs)(sp)
737         lwz     r18,(18*4+offes_intregs)(sp)
738         lwz     r19,(19*4+offes_intregs)(sp)
739         lwz     r20,(20*4+offes_intregs)(sp)
740         lwz     r21,(21*4+offes_intregs)(sp)
741         lwz     r22,(22*4+offes_intregs)(sp)
742         lwz     r23,(23*4+offes_intregs)(sp)
743         lwz     r24,(24*4+offes_intregs)(sp)
744         lwz     r25,(25*4+offes_intregs)(sp)
745         lwz     r26,(26*4+offes_intregs)(sp)
746         lwz     r27,(27*4+offes_intregs)(sp)
747         lwz     r28,(28*4+offes_intregs)(sp)
748         lwz     r29,(29*4+offes_intregs)(sp)
749         lwz     r30,(30*4+offes_intregs)(sp)
750         lwz     r31,(31*4+offes_intregs)(sp)
751         
752         lfd     fr0 ,( 0*8+offes_fltregs)(sp)
753         lfd     fr1 ,( 1*8+offes_fltregs)(sp)
754         lfd     fr2 ,( 2*8+offes_fltregs)(sp)
755         lfd     fr3 ,( 3*8+offes_fltregs)(sp)
756         lfd     fr4 ,( 4*8+offes_fltregs)(sp)
757         lfd     fr5 ,( 5*8+offes_fltregs)(sp)
758         lfd     fr6 ,( 6*8+offes_fltregs)(sp)
759         lfd     fr7 ,( 7*8+offes_fltregs)(sp)
760         lfd     fr8 ,( 8*8+offes_fltregs)(sp)
761         lfd     fr9 ,( 9*8+offes_fltregs)(sp)
762         lfd     fr10,(10*8+offes_fltregs)(sp)
763         lfd     fr11,(11*8+offes_fltregs)(sp)
764         lfd     fr12,(12*8+offes_fltregs)(sp)
765         lfd     fr13,(13*8+offes_fltregs)(sp)
766         lfd     fr14,(14*8+offes_fltregs)(sp)
767         lfd     fr15,(15*8+offes_fltregs)(sp)
768         lfd     fr16,(16*8+offes_fltregs)(sp)
769         lfd     fr17,(17*8+offes_fltregs)(sp)
770         lfd     fr18,(18*8+offes_fltregs)(sp)
771         lfd     fr19,(19*8+offes_fltregs)(sp)
772         lfd     fr20,(20*8+offes_fltregs)(sp)
773         lfd     fr21,(21*8+offes_fltregs)(sp)
774         lfd     fr22,(22*8+offes_fltregs)(sp)
775         lfd     fr23,(23*8+offes_fltregs)(sp)
776         lfd     fr24,(24*8+offes_fltregs)(sp)
777         lfd     fr25,(25*8+offes_fltregs)(sp)
778         lfd     fr26,(26*8+offes_fltregs)(sp)
779         lfd     fr27,(27*8+offes_fltregs)(sp)
780         lfd     fr28,(28*8+offes_fltregs)(sp)
781         lfd     fr29,(29*8+offes_fltregs)(sp)
782         lfd     fr30,(30*8+offes_fltregs)(sp)
783         lfd     fr31,(31*8+offes_fltregs)(sp)
784
785         /* restore link register */
786
787         mtlr    itmp3
788         
789         /* load new pc */
790
791         lwz     itmp3,offes_pc(sp)
792
793         /* remove stack frame */
794
795         addi    sp,sp,+(sizeexecutionstate_ALIGNED)
796
797         /* jump to new code */
798
799         mtctr   itmp3
800         bctr
801
802 #endif /* defined(ENABLE_REPLACEMENT) */
803
804 /*********************************************************************/
805
806 asm_cacheflush:
807         add     a1,a0,a1
808         rlwinm  a0,a0,0,0,26
809         addi    a1,a1,31
810         rlwinm  a1,a1,0,0,26
811         mr      a2,a0
812 1:
813         cmplw   a0,a1
814         bge     0f
815         dcbst   0,a0
816         addi    a0,a0,32
817         b       1b
818 0:
819         sync
820 1:
821         cmplw   a2,a1
822         bge     0f
823         icbi    0,a2
824         addi    a2,a2,32
825         b       1b
826 0:
827         sync
828         isync
829         blr
830
831
832 /* asm_compare_and_swap ********************************************************
833
834    XXX
835
836 *******************************************************************************/
837
838 asm_compare_and_swap:
839 1:
840         lwarx   a6,0,a0 
841         subf.   r0,a6,a1 
842         bne-    2f 
843         or      r0,a2,a2 
844         stwcx.  r0,0,a0 
845         bne-    1b 
846 2: 
847         mr      a0,a6
848         blr
849
850
851 /* asm_memory_barrier **********************************************************
852
853    XXX
854
855 *******************************************************************************/
856
857 asm_memory_barrier:
858         sync
859         blr
860
861
862 asm_getclassvalues_atomic:
863 _crit_restart:
864 _crit_begin:
865         lwz     a3,offbaseval(a0)
866         lwz     a4,offdiffval(a0)
867         lwz     a5,offbaseval(a1)
868 _crit_end:
869         stw     a3,offcast_super_baseval(a2)
870         stw     a4,offcast_super_diffval(a2)
871         stw     a5,offcast_sub_baseval(a2)
872         blr
873
874         .data
875
876 asm_criticalsections:
877 #if defined(ENABLE_THREADS)
878         .long   _crit_begin
879         .long   _crit_end
880         .long   _crit_restart
881 #endif
882         .long 0
883
884
885 #if defined(__DARWIN__)
886
887 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
888         .align 2
889 L_builtin_throw_exception$stub:
890         .indirect_symbol _builtin_throw_exception
891         mflr r0
892         bcl 20,31,L00$_builtin_throw_exception
893 L00$_builtin_throw_exception:
894         mflr r11
895         addis r11,r11,ha16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)
896         mtlr r0
897         lwzu r12,lo16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)(r11)
898         mtctr r12
899         bctr
900 .data
901 .lazy_symbol_pointer
902 L_builtin_throw_exception$lazy_ptr:
903         .indirect_symbol _builtin_throw_exception
904         .long dyld_stub_binding_helper
905
906
907 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
908         .align 2
909 L_md_codegen_get_pv_from_pc$stub:
910         .indirect_symbol _md_codegen_get_pv_from_pc
911         mflr r0
912         bcl 20,31,L00$_md_codegen_get_pv_from_pc
913 L00$_md_codegen_get_pv_from_pc:
914         mflr r11
915         addis r11,r11,ha16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)
916         mtlr r0
917         lwzu r12,lo16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)(r11)
918         mtctr r12
919         bctr
920 .data
921 .lazy_symbol_pointer
922 L_md_codegen_get_pv_from_pc$lazy_ptr:
923         .indirect_symbol _md_codegen_get_pv_from_pc
924         .long dyld_stub_binding_helper
925
926
927 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
928         .align 2
929 L_exceptions_handle_exception$stub:
930         .indirect_symbol _exceptions_handle_exception
931         mflr r0
932         bcl 20,31,L00$_exceptions_handle_exception
933 L00$_exceptions_handle_exception:
934         mflr r11
935         addis r11,r11,ha16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)
936         mtlr r0
937         lwzu r12,lo16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)(r11)
938         mtctr r12
939         bctr
940 .data
941 .lazy_symbol_pointer
942 L_exceptions_handle_exception$lazy_ptr:
943         .indirect_symbol _exceptions_handle_exception
944         .long dyld_stub_binding_helper
945
946
947 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
948         .align 2
949 L_stacktrace_create_extern_stackframeinfo$stub:
950         .indirect_symbol _stacktrace_create_extern_stackframeinfo
951         mflr r0
952         bcl 20,31,L00$_stacktrace_create_extern_stackframeinfo
953 L00$_stacktrace_create_extern_stackframeinfo:
954         mflr r11
955         addis r11,r11,ha16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)
956         mtlr r0
957         lwzu r12,lo16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)(r11)
958         mtctr r12
959         bctr
960 .data
961 .lazy_symbol_pointer
962 L_stacktrace_create_extern_stackframeinfo$lazy_ptr:
963         .indirect_symbol _stacktrace_create_extern_stackframeinfo
964         .long dyld_stub_binding_helper
965
966
967 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
968         .align 2
969 L_jit_asm_compile$stub:
970         .indirect_symbol _jit_asm_compile
971         mflr r0
972         bcl 20,31,L00$_jit_asm_compile
973 L00$_jit_asm_compile:
974         mflr r11
975         addis r11,r11,ha16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)
976         mtlr r0
977         lwzu r12,lo16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)(r11)
978         mtctr r12
979         bctr
980 .data
981 .lazy_symbol_pointer
982 L_jit_asm_compile$lazy_ptr:
983         .indirect_symbol _jit_asm_compile
984         .long dyld_stub_binding_helper
985
986
987 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
988         .align 2
989 L_stacktrace_remove_stackframeinfo$stub:
990         .indirect_symbol _stacktrace_remove_stackframeinfo
991         mflr r0
992         bcl 20,31,L00$_stacktrace_remove_stackframeinfo
993 L00$_stacktrace_remove_stackframeinfo:
994         mflr r11
995         addis r11,r11,ha16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)
996         mtlr r0
997         lwzu r12,lo16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)(r11)
998         mtctr r12
999         bctr
1000 .data
1001 .lazy_symbol_pointer
1002 L_stacktrace_remove_stackframeinfo$lazy_ptr:
1003         .indirect_symbol _stacktrace_remove_stackframeinfo
1004         .long dyld_stub_binding_helper
1005
1006
1007 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1008         .align 2
1009 L_exceptions_get_and_clear_exception$stub:
1010         .indirect_symbol _exceptions_get_and_clear_exception
1011         mflr r0
1012         bcl 20,31,L00$_exceptions_get_and_clear_exception
1013 L00$_exceptions_get_and_clear_exception:
1014         mflr r11
1015         addis r11,r11,ha16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)
1016         mtlr r0
1017         lwzu r12,lo16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)(r11)
1018         mtctr r12
1019         bctr
1020 .data
1021 .lazy_symbol_pointer
1022 L_exceptions_get_and_clear_exception$lazy_ptr:
1023         .indirect_symbol _exceptions_get_and_clear_exception
1024         .long dyld_stub_binding_helper
1025
1026
1027 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1028         .align 2
1029 L_exceptions_asm_new_abstractmethoderror$stub:
1030         .indirect_symbol _exceptions_asm_new_abstractmethoderror
1031         mflr r0
1032         bcl 20,31,L00$_exceptions_asm_new_abstractmethoderror
1033 L00$_exceptions_asm_new_abstractmethoderror:
1034         mflr r11
1035         addis r11,r11,ha16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)
1036         mtlr r0
1037         lwzu r12,lo16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)(r11)
1038         mtctr r12
1039         bctr
1040 .data
1041 .lazy_symbol_pointer
1042 L_exceptions_asm_new_abstractmethoderror$lazy_ptr:
1043         .indirect_symbol _exceptions_asm_new_abstractmethoderror
1044         .long dyld_stub_binding_helper
1045
1046
1047 # if defined(ENABLE_REPLACEMENT)
1048
1049 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1050         .align 2
1051 L_replace_me$stub:
1052         .indirect_symbol _replace_me
1053         mflr r0
1054         bcl 20,31,L00$_replace_me
1055 L00$_replace_me:
1056         mflr r11
1057         addis r11,r11,ha16(L_replace_me$lazy_ptr - L00$_replace_me)
1058         mtlr r0
1059         lwzu r12,lo16(L_replace_me$lazy_ptr - L00$_replace_me)(r11)
1060         mtctr r12
1061         bctr
1062 .data
1063 .lazy_symbol_pointer
1064 L_replace_me$lazy_ptr:
1065         .indirect_symbol _replace_me
1066         .long dyld_stub_binding_helper
1067
1068
1069 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1070         .align 2
1071 L_replace_build_execution_state$stub:
1072         .indirect_symbol _replace_build_execution_state
1073         mflr r0
1074         bcl 20,31,L00$_replace_build_execution_state
1075 L00$_replace_build_execution_state:
1076         mflr r11
1077         addis r11,r11,ha16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)
1078         mtlr r0
1079         lwzu r12,lo16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)(r11)
1080         mtctr r12
1081         bctr
1082 .data
1083 .lazy_symbol_pointer
1084 L_replace_build_execution_state$lazy_ptr:
1085         .indirect_symbol _replace_build_execution_state
1086         .long dyld_stub_binding_helper
1087
1088
1089 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1090         .align 2
1091 L_replace_free_safestack$stub:
1092         .indirect_symbol _replace_free_safestack
1093         mflr r0
1094         bcl 20,31,L00$_replace_free_safestack
1095 L00$_replace_free_safestack:
1096         mflr r11
1097         addis r11,r11,ha16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)
1098         mtlr r0
1099         lwzu r12,lo16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)(r11)
1100         mtctr r12
1101         bctr
1102 .data
1103 .lazy_symbol_pointer
1104 L_replace_free_safestack$lazy_ptr:
1105         .indirect_symbol _replace_free_safestack
1106         .long dyld_stub_binding_helper
1107
1108 # endif /* ENABLE_REPLACEMENT */
1109
1110 #endif /* defined(__DARWIN__) */
1111
1112
1113 /* disable exec-stacks ********************************************************/
1114
1115 #if defined(__linux__) && defined(__ELF__)
1116         .section .note.GNU-stack,"",%progbits
1117 #endif
1118
1119
1120 /*
1121  * These are local overrides for various environment variables in Emacs.
1122  * Please do not remove this and leave it at the end of the file, where
1123  * Emacs will automagically detect them.
1124  * ---------------------------------------------------------------------
1125  * Local variables:
1126  * mode: asm
1127  * indent-tabs-mode: t
1128  * c-basic-offset: 4
1129  * tab-width: 4
1130  * End:
1131  * vim:noexpandtab:sw=4:ts=4:
1132  */