1 /* src/vm/jit/powerpc64/asmpart.S - Java-C interface functions for PowerPC64
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
8 This file is part of CACAO.
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.
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.
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
35 #include "vm/jit/abi-asm.h"
36 #include "vm/jit/methodheader.h"
39 /* export functions ***********************************************************/
41 .globl asm_vm_call_method_exception_handler
42 .globl asm_vm_call_method_end
44 .globl asm_call_jit_compiler
46 .globl asm_handle_nat_exception
47 .globl asm_handle_exception
49 .globl asm_abstractmethoderror
51 .globl asm_patcher_wrapper
53 #if defined(ENABLE_REPLACEMENT)
54 .globl asm_replacement_out
55 .globl .asm_replacement_in
61 /* asm_vm_call_method **********************************************************
63 * This function calls a Java-method (which possibly needs compilation) *
64 * with up to 4 address parameters. *
66 * This functions calls the JIT-compiler which eventually translates the *
67 * method into machine code. *
70 * javaobject_header *asm_calljavamethod (methodinfo *m, *
71 * void *arg1, void *arg2, void *arg3, void *arg4); *
73 *******************************************************************************/
74 /* this is the method header see src/vm/jit/methodheader.h */
78 .quad 0 /* catch type all */
79 .quad 0 /* handler pc */
81 .quad 0 /* start pc */
82 .long 1 /* extable size */
83 .long 0 /* ALIGNMENT PADDING */
84 .quad 0 /* line number table start */
85 .quad 0 /* line number table size */
86 .long 0 /* ALIGNMENT PADDING */
91 .long 0 /* frame size */
92 .quad 0 /* codeinfo pointer */
96 .globl asm_vm_call_method
97 .globl asm_vm_call_method_int
98 .globl asm_vm_call_method_long
99 .globl asm_vm_call_method_float
100 .globl asm_vm_call_method_double
105 asm_vm_call_method_int:
106 asm_vm_call_method_long:
107 asm_vm_call_method_float:
108 asm_vm_call_method_double:
109 .quad .asm_vm_call_method,.TOC.@tocbase,0
111 .size asm_vm_call_method, 24
112 .type .asm_vm_call_method,@function
113 .globl .asm_vm_call_method
116 .globl asm_vm_call_method
117 asm_vm_call_method_int:
118 .globl asm_vm_call_method_int
119 asm_vm_call_method_long:
120 .globl asm_vm_call_method_long
121 asm_vm_call_method_float:
122 .globl asm_vm_call_method_float
123 asm_vm_call_method_double:
124 .globl asm_vm_call_method_double
128 .asm_vm_call_method_int:
129 .asm_vm_call_method_long:
130 .asm_vm_call_method_float:
131 .asm_vm_call_method_double:
133 std r0,LA_LR_OFFSET(sp)
136 std s0,8*8(sp) /* save used callee saved registers */
137 std a0,9*8(sp) /* save method pointer for compiler */
139 std pv,11*8(sp) /* save PV register */
141 std itmp3,12*8(sp) /* registers r14-r31 are callee saved */
142 stfd ftmp1,13*8(sp) /* registers f14-f31 are callee saved */
146 SAVE_TEMPORARY_REGISTERS(15)
147 mr s0, r1 /* save stack pointer */
149 /* a1 contains a pointer to a unit64_t structure filled with all INT_ARG_REG,
150 followed by ADR_ARG_CNT and FLT_ARG_CNT, afterwards what else needs to be copied onto
152 a2 contains the number of additional stack slots to be copied
183 beq L_stack_copy_done
186 addi t1,t1,20*8 /* before first possible stack slot arg */
187 mr t3,t2 /* argument counter */
188 sldi t2,t2,8 /* calculate size of stack */
189 sub sp,sp,t2 /* increase the stack */
190 mr t2,sp /* t2 points to bottom of stack now */
193 addi t1,t1,8 /* next possible stack slot to copy */
194 mr. t3,t3 /* more stack slots to copy ? */
195 beq L_stack_copy_done
203 mr itmp1, s0 /* fake invokevirtual invocation */
204 addi itmp1, itmp1, 9*8 /* address of methods pv */
210 addi pv,itmp1,(.asm_vm_call_method - 1b)@l
212 L_asm_vm_call_method_return:
213 mr sp,s0 /* restore the function's sp */
215 ld s0,8*8(sp) /* restore used callee saved registers */
217 ld pv,11*8(sp) /* save PV register */
220 lfd ftmp1,13*8(sp) /* registers f14-f31 are callee saved */
223 RESTORE_TEMPORARY_REGISTERS(15)
225 ld r0,40*8+LA_LR_OFFSET(r1)
230 asm_vm_call_method_exception_handler:
232 bl builtin_throw_exception
233 b L_asm_vm_call_method_return
235 asm_vm_call_method_end:
238 /* asm_call_jit_compiler *******************************************************
240 Invokes the compiler for untranslated JavaVM methods.
242 *******************************************************************************/
244 asm_call_jit_compiler:
245 L_asm_call_jit_compiler: /* required for PIC code */
247 std r0,LA_LR_OFFSET(sp) /* save return address */
248 stdu r1,-(LA_SIZE+PA_SIZE+ARG_CNT*8)(sp)
250 SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS)
254 addi a2,sp,(LA_SIZE + PA_SIZE+ ARG_CNT*8)
255 ld a3,(LA_SIZE + PA_SIZE + ARG_CNT*8)+LA_LR_OFFSET(sp)
257 ori r0,r0,0 /* nop needed after jump to function desc. */
258 mr pv,v0 /* move address to pv register */
260 RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS)
262 ld itmp1,(LA_SIZE + PA_SIZE + ARG_CNT*8)+LA_LR_OFFSET(sp)
265 addi sp,sp,(LA_SIZE + PA_SIZE + ARG_CNT*8)
267 mr. pv,pv /* test for exception */
268 beq L_asm_call_jit_compiler_exception
270 mtctr pv /* move method address to control reg */
271 bctr /* and call the Java method */
273 L_asm_call_jit_compiler_exception:
275 std r0,LA_LR_OFFSET(sp)
276 stdu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
277 bl exceptions_get_and_clear_exception
278 ld xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
280 addi sp,sp,LA_SIZE_ALIGNED
282 mr xptr,v0 /* get exception */
283 addi xpc,xpc,-4 /* exception address is ra - 4 */
284 b L_asm_handle_nat_exception
287 /********************* function asm_handle_exception ***************************
289 * This function handles an exception. It does not use the usual calling *
290 * conventions. The exception pointer is passed in REG_ITMP1 and the *
291 * pc from the exception raising position is passed in REG_ITMP2. It searches *
292 * the local exception table for a handler. If no one is found, it unwinds *
293 * stacks and continues searching the callers. *
295 * void asm_handle_exception (exceptionptr, exceptionpc); *
297 *******************************************************************************/
299 asm_handle_nat_exception:
300 L_asm_handle_nat_exception: /* required for PIC code */
301 L_asm_handle_exception_stack_loop:
303 addi sp,sp,-(LA_SIZE+PA_SIZE+((4+6)*8)) /* allocate stack (+4 for darwin) */
304 std xptr,LA_SIZE+PA_SIZE+(4+0)*8(sp) /* save exception pointer */
305 std xpc,LA_SIZE+PA_SIZE+(4+1)*8(sp) /* save exception pc */
306 std r0,LA_SIZE+PA_SIZE+(4+3)*8(sp) /* save return address */
308 std itmp3,LA_SIZE+PA_SIZE+(4+4)*8(sp) /* save maybe-leaf flag (cleared) */
310 mr a0,r0 /* pass return address */
311 bl md_codegen_get_pv_from_pc /* get PV from RA */
312 std v0,LA_SIZE+PA_SIZE+(4+2)*8(sp) /* save data segment pointer */
314 ld a0,LA_SIZE+PA_SIZE+(4+0)*8(sp) /* pass xptr */
315 ld a1,LA_SIZE+PA_SIZE+(4+1)*8(sp) /* pass xpc */
316 ld a2,LA_SIZE+PA_SIZE+(4+2)*8(sp) /* pass PV (v0 == a0) */
317 addi a3,sp,LA_SIZE+PA_SIZE+((4+6)*8) /* pass Java SP */
319 b L_asm_handle_exception_continue
322 asm_handle_exception:
323 L_asm_handle_exception: /* required for PIC code */
324 addi sp,sp,-(ARG_CNT+TMP_CNT)*8 /* create maybe-leaf stackframe */
326 SAVE_ARGUMENT_REGISTERS(0) /* we save arg and temp registers in */
327 SAVE_TEMPORARY_REGISTERS(ARG_CNT) /* case this is a leaf method */
329 addi sp,sp,-(LA_SIZE+PA_SIZE+(4+6)*8) /* allocate stack */
330 std xptr,LA_SIZE+PA_SIZE+(4+0)*8(sp) /* save exception pointer */
331 std pv,LA_SIZE+PA_SIZE+(4+2)*8(sp) /* save data segment pointer */
332 mflr r0 /* save return address */
333 std r0,LA_SIZE+PA_SIZE+(4+3)*8(sp)
335 std t0, LA_SIZE+PA_SIZE+(4+4)*8(sp) /* maybe-leaf flag */
337 mr a0,xptr /* pass exception pointer */
338 mr a1,xpc /* pass exception pc */
339 mr a2,pv /* pass data segment pointer */
340 addi a3,sp,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+(4+6)*8
343 L_asm_handle_exception_continue:
344 bl exceptions_handle_exception
347 beq L_asm_handle_exception_not_catched
349 mr xpc,v0 /* move handlerpc into xpc */
350 ld xptr,LA_SIZE+PA_SIZE+(4+0)*8(sp) /* restore exception pointer */
351 ld pv,LA_SIZE+PA_SIZE+(4+2)*8(sp) /* restore data segment pointer */
352 ld r0,LA_SIZE+PA_SIZE+(4+3)*8(sp) /* restore return address */
354 ld t0,LA_SIZE+PA_SIZE+(4+4)*8(sp) /* get maybe-leaf flag */
355 addi sp,sp,LA_SIZE+PA_SIZE+(4+6)*8 /* free stack frame */
358 beq L_asm_handle_exception_no_leaf
360 RESTORE_ARGUMENT_REGISTERS(0) /* if this is a leaf method, we have */
361 RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers */
363 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
365 L_asm_handle_exception_no_leaf:
366 mtctr xpc /* jump to the handler */
369 L_asm_handle_exception_not_catched:
370 ld xptr,LA_SIZE+PA_SIZE+(4+0)*8(sp) /* restore exception pointer */
371 ld pv,LA_SIZE+PA_SIZE+(4+2)*8(sp) /* restore data segment pointer */
372 ld r0,LA_SIZE+PA_SIZE+(4+3)*8(sp) /* restore return address */
374 ld t0,LA_SIZE+PA_SIZE+(4+4)*8(sp) /* get maybe-leaf flag */
375 addi sp,sp,LA_SIZE+PA_SIZE+(4+6)*8 /* free stack frame */
378 beq L_asm_handle_exception_no_leaf_stack
380 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
381 li t0,0 /* clear the maybe-leaf flag */
383 L_asm_handle_exception_no_leaf_stack:
384 lwz t1,FrameSize(pv) /* get frame size */
385 add t1,sp,t1 /* pointer to save area */
387 lwz t2,IsLeaf(pv) /* is leaf procedure */
389 bne L_asm_handle_exception_no_ra_restore
391 ld r0,LA_LR_OFFSET(t1) /* restore ra */
394 L_asm_handle_exception_no_ra_restore:
395 mflr xpc /* the new xpc is ra */
396 mr t4,xpc /* save RA */
397 lwz t2,IntSave(pv) /* t1 = saved int register count */
400 mflr t3 /* t3 = current pc */
401 addi t3,t3,(ex_int2-ex_int1)@l
402 slwi t2,t2,2 /* t2 = register count * 4 */
403 subf t3,t2,t3 /* t3 = IntSave - t2 */
418 subf t1,t2,t1 /* t1 = t1 - register count * 4 */
423 addi t3,t3,(ex_flt2-ex_flt1)@l
424 slwi t2,t2,2 /* t2 = register count * 4 */
425 subf t3,t2,t3 /* t3 = FltSave - t2 */
441 mtlr t4 /* restore RA */
443 add sp,sp,t1 /* unwind stack */
444 b L_asm_handle_exception_stack_loop
447 /* asm_abstractmethoderror *****************************************************
449 Creates and throws an AbstractMethodError.
451 *******************************************************************************/
453 asm_abstractmethoderror:
455 std r0,LA_LR_OFFSET(sp)
456 stdu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
457 addi a0,sp,LA_SIZE_ALIGNED /* pass java sp */
458 mr a1,r0 /* pass exception address */
459 bl exceptions_asm_new_abstractmethoderror
460 ld r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
461 mtlr r0 /* restore return address */
462 addi sp,sp,LA_SIZE_ALIGNED
464 mr xptr,v0 /* get exception pointer */
465 mr xpc,r0 /* we can't use r0 directly in addi */
466 addi xpc,xpc,-4 /* exception address is ra - 4 */
467 b L_asm_handle_nat_exception
470 /* asm_patcher_wrapper *********************************************************
475 40 return address into JIT code (patch position)
476 32 pointer to virtual java_objectheader
477 24 machine code (which is patched back later)
478 16 unresolved class/method/field reference
479 8 data segment displacement from load instructions
480 0 patcher function pointer to call (pv is saved here afterwards)
482 *******************************************************************************/
485 mflr r0 /* get Java return address (leaf) */
486 std r0,6*8(sp) /* store it in the stub stackframe */
487 /* keep stack 16-bytes aligned: 6+1+37 = 44 */
488 stdu sp,-(LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8)(sp)
490 SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS) /* save 8 int/8 float arguments */
491 SAVE_TEMPORARY_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS+ARG_CNT)
493 std itmp1,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+1*8(sp)
494 std itmp2,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+2*8(sp)
495 std pv,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+3*8(sp)
497 addi a0,sp,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8 /* pass SP of patcher stub */
498 mr a1,pv /* pass PV */
499 mr a2,r0 /* pass RA (correct for leafs) */
501 std v0,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+4*8(sp) /* save return value */
504 RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS) /* restore 8 int/8 float args */
505 RESTORE_TEMPORARY_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS+ARG_CNT)
507 ld itmp1,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+1*8(sp)
508 ld itmp2,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+2*8(sp)
509 ld pv,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+3*8(sp)
510 ld itmp3,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+4*8(sp)
512 ld r0,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+6*8(sp) /* restore RA */
515 mr. itmp3,itmp3 /* check for an exception */
516 bne L_asm_patcher_wrapper_exception
518 /* get return address (into JIT code) */
519 ld itmp3,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+5*8(sp)
521 /* remove stack frame + patcher stub stack */
522 addi sp,sp,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+8*8
525 bctr /* jump to new patched code */
527 L_asm_patcher_wrapper_exception:
528 mr xptr,itmp3 /* get exception */
529 ld xpc,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+5*8(sp)
530 addi sp,sp,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+8*8
531 b L_asm_handle_exception
533 #if defined(ENABLE_REPLACEMENT)
535 /* asm_replacement_out *********************************************************
537 This code is jumped to from the replacement-out stubs that are executed
538 when a thread reaches an activated replacement point.
540 The purpose of asm_replacement_out is to read out the parts of the
541 execution state that cannot be accessed from C code, store this state,
542 and then call the C function replace_me.
545 16 start of stack inside method to replace
546 0 rplpoint * info on the replacement point that was reached
548 NOTE: itmp3 has been clobbered by the replacement-out stub!
550 *******************************************************************************/
552 /* some room to accomodate changes of the stack frame size during replacement */
553 /* XXX we should find a cleaner solution here */
554 #define REPLACEMENT_ROOM 512
557 /* create stack frame */
558 addi sp,sp,-(sizeexecutionstate + REPLACEMENT_ROOM) /* XXX align */
560 /* save link register */
563 /* save registers in execution state */
564 std r0 ,( 0*8+offes_intregs)(sp)
565 std r1 ,( 1*8+offes_intregs)(sp)
566 std r2 ,( 2*8+offes_intregs)(sp)
567 std r3 ,( 3*8+offes_intregs)(sp)
568 std r4 ,( 4*8+offes_intregs)(sp)
569 std r5 ,( 5*8+offes_intregs)(sp)
570 std r6 ,( 6*8+offes_intregs)(sp)
571 std r7 ,( 7*8+offes_intregs)(sp)
572 std r8 ,( 8*8+offes_intregs)(sp)
573 std r9 ,( 9*8+offes_intregs)(sp)
574 std r10,(10*8+offes_intregs)(sp)
575 std r11,(11*8+offes_intregs)(sp)
576 std r12,(12*8+offes_intregs)(sp)
577 std r13,(13*8+offes_intregs)(sp)
578 std r14,(14*8+offes_intregs)(sp)
579 std r15,(15*8+offes_intregs)(sp)
580 std r16,(16*8+offes_intregs)(sp) /* link register */
581 std r17,(17*8+offes_intregs)(sp)
582 std r18,(18*8+offes_intregs)(sp)
583 std r19,(19*8+offes_intregs)(sp)
584 std r20,(20*8+offes_intregs)(sp)
585 std r21,(21*8+offes_intregs)(sp)
586 std r22,(22*8+offes_intregs)(sp)
587 std r23,(23*8+offes_intregs)(sp)
588 std r24,(24*8+offes_intregs)(sp)
589 std r25,(25*8+offes_intregs)(sp)
590 std r26,(26*8+offes_intregs)(sp)
591 std r27,(27*8+offes_intregs)(sp)
592 std r28,(28*8+offes_intregs)(sp)
593 std r29,(29*8+offes_intregs)(sp)
594 std r30,(30*8+offes_intregs)(sp)
595 std r31,(31*8+offes_intregs)(sp)
597 stfd fr0 ,( 0*8+offes_fltregs)(sp)
598 stfd fr1 ,( 1*8+offes_fltregs)(sp)
599 stfd fr2 ,( 2*8+offes_fltregs)(sp)
600 stfd fr3 ,( 3*8+offes_fltregs)(sp)
601 stfd fr4 ,( 4*8+offes_fltregs)(sp)
602 stfd fr5 ,( 5*8+offes_fltregs)(sp)
603 stfd fr6 ,( 6*8+offes_fltregs)(sp)
604 stfd fr7 ,( 7*8+offes_fltregs)(sp)
605 stfd fr8 ,( 8*8+offes_fltregs)(sp)
606 stfd fr9 ,( 9*8+offes_fltregs)(sp)
607 stfd fr10,(10*8+offes_fltregs)(sp)
608 stfd fr11,(11*8+offes_fltregs)(sp)
609 stfd fr12,(12*8+offes_fltregs)(sp)
610 stfd fr13,(13*8+offes_fltregs)(sp)
611 stfd fr14,(14*8+offes_fltregs)(sp)
612 stfd fr15,(15*8+offes_fltregs)(sp)
613 stfd fr16,(16*8+offes_fltregs)(sp)
614 stfd fr17,(17*8+offes_fltregs)(sp)
615 stfd fr18,(18*8+offes_fltregs)(sp)
616 stfd fr19,(19*8+offes_fltregs)(sp)
617 stfd fr20,(20*8+offes_fltregs)(sp)
618 stfd fr21,(21*8+offes_fltregs)(sp)
619 stfd fr22,(22*8+offes_fltregs)(sp)
620 stfd fr23,(23*8+offes_fltregs)(sp)
621 stfd fr24,(24*8+offes_fltregs)(sp)
622 stfd fr25,(25*8+offes_fltregs)(sp)
623 stfd fr26,(26*8+offes_fltregs)(sp)
624 stfd fr27,(27*8+offes_fltregs)(sp)
625 stfd fr28,(28*8+offes_fltregs)(sp)
626 stfd fr29,(29*8+offes_fltregs)(sp)
627 stfd fr30,(30*8+offes_fltregs)(sp)
628 stfd fr31,(31*8+offes_fltregs)(sp)
630 /* calculate sp of method */
631 addi itmp1,sp,(sizeexecutionstate + REPLACEMENT_ROOM + 4*4)
632 stw itmp1,(offes_sp)(sp)
635 stw pv,(offes_pv)(sp)
637 /* call replace_me */
638 lwz a0,-(4*4)(itmp1) /* arg0: rplpoint * */
639 mr a1,sp /* arg1: execution state */
640 addi sp,sp,-(LA_SIZE_ALIGNED)
641 b replace_me /* call C function replace_me */
643 /* asm_replacement_in **********************************************************
645 This code writes the given execution state and jumps to the replacement
648 This function never returns!
650 NOTE: itmp3 is not restored!
653 void asm_replacement_in(executionstate *es);
655 *******************************************************************************/
658 /* a0 == executionstate *es */
660 /* set new sp and pv */
664 /* copy registers from execution state */
665 ld r0 ,( 0*8+offes_intregs)(a0)
668 /* a0 is loaded below */
669 ld r4 ,( 4*8+offes_intregs)(a0)
670 ld r5 ,( 5*8+offes_intregs)(a0)
671 ld r6 ,( 6*8+offes_intregs)(a0)
672 ld r7 ,( 7*8+offes_intregs)(a0)
673 ld r8 ,( 8*8+offes_intregs)(a0)
674 ld r9 ,( 9*8+offes_intregs)(a0)
675 ld r10,(10*8+offes_intregs)(a0)
676 ld r11,(11*8+offes_intregs)(a0)
677 ld r12,(12*8+offes_intregs)(a0)
679 ld r14,(14*8+offes_intregs)(a0)
680 ld r15,(15*8+offes_intregs)(a0)
681 ld r16,(16*8+offes_intregs)(a0) /* link register */
682 ld r17,(17*8+offes_intregs)(a0)
683 ld r18,(18*8+offes_intregs)(a0)
684 ld r19,(19*8+offes_intregs)(a0)
685 ld r20,(20*8+offes_intregs)(a0)
686 ld r21,(21*8+offes_intregs)(a0)
687 ld r22,(22*8+offes_intregs)(a0)
688 ld r23,(23*8+offes_intregs)(a0)
689 ld r24,(24*8+offes_intregs)(a0)
690 ld r25,(25*8+offes_intregs)(a0)
691 ld r26,(26*8+offes_intregs)(a0)
692 ld r27,(27*8+offes_intregs)(a0)
693 ld r28,(28*8+offes_intregs)(a0)
694 ld r29,(29*8+offes_intregs)(a0)
695 ld r30,(30*8+offes_intregs)(a0)
696 ld r31,(31*8+offes_intregs)(a0)
698 lfd fr0 ,( 0*8+offes_fltregs)(a0)
699 lfd fr1 ,( 1*8+offes_fltregs)(a0)
700 lfd fr2 ,( 2*8+offes_fltregs)(a0)
701 lfd fr3 ,( 3*8+offes_fltregs)(a0)
702 lfd fr4 ,( 4*8+offes_fltregs)(a0)
703 lfd fr5 ,( 5*8+offes_fltregs)(a0)
704 lfd fr6 ,( 6*8+offes_fltregs)(a0)
705 lfd fr7 ,( 7*8+offes_fltregs)(a0)
706 lfd fr8 ,( 8*8+offes_fltregs)(a0)
707 lfd fr9 ,( 9*8+offes_fltregs)(a0)
708 lfd fr10,(10*8+offes_fltregs)(a0)
709 lfd fr11,(11*8+offes_fltregs)(a0)
710 lfd fr12,(12*8+offes_fltregs)(a0)
711 lfd fr13,(13*8+offes_fltregs)(a0)
712 lfd fr14,(14*8+offes_fltregs)(a0)
713 lfd fr15,(15*8+offes_fltregs)(a0)
714 lfd fr16,(16*8+offes_fltregs)(a0)
715 lfd fr17,(17*8+offes_fltregs)(a0)
716 lfd fr18,(18*8+offes_fltregs)(a0)
717 lfd fr19,(19*8+offes_fltregs)(a0)
718 lfd fr20,(20*8+offes_fltregs)(a0)
719 lfd fr21,(21*8+offes_fltregs)(a0)
720 lfd fr22,(22*8+offes_fltregs)(a0)
721 lfd fr23,(23*8+offes_fltregs)(a0)
722 lfd fr24,(24*8+offes_fltregs)(a0)
723 lfd fr25,(25*8+offes_fltregs)(a0)
724 lfd fr26,(26*8+offes_fltregs)(a0)
725 lfd fr27,(27*8+offes_fltregs)(a0)
726 lfd fr28,(28*8+offes_fltregs)(a0)
727 lfd fr29,(29*8+offes_fltregs)(a0)
728 lfd fr30,(30*8+offes_fltregs)(a0)
729 lfd fr31,(31*8+offes_fltregs)(a0)
731 /* restore link register */
737 ld itmp3,offes_pc(a0)
741 ld a0,(3*8+offes_intregs)(a0)
743 /* jump to new code */
748 #endif /* defined(ENABLE_REPLACEMENT) */
750 /* asm_cacheflush **************************************************************
751 copied from linux/arch/ppc64/kernel/vdso64/cacheflush.S
752 assumes 128 byte cache line size.
753 All registers used may be trashed for fun and profit.
754 *******************************************************************************/
759 .quad .asm_cacheflush,.TOC.@tocbase,0
761 .size asm_cacheflush, 24
762 .type .asm_cacheflush,@function
763 .globl .asm_cacheflush
765 /* construct the AND mask */
766 li r6, 0xffffffffffff8000
767 ori r6,r6,0x000000000000ff80
794 /* disable exec-stacks ********************************************************/
796 #if defined(__linux__) && defined(__ELF__)
797 .section .note.GNU-stack,"",%progbits
802 * These are local overrides for various environment variables in Emacs.
803 * Please do not remove this and leave it at the end of the file, where
804 * Emacs will automagically detect them.
805 * ---------------------------------------------------------------------
808 * indent-tabs-mode: t
812 * vim:noexpandtab:sw=4:ts=4: