xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.S

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.S	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,112 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +.set r0,0; .set r1,1; .set RTOC,2; .set r3,3; .set r4,4
     1.9 +.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
    1.10 +.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
    1.11 +.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
    1.12 +.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
    1.13 +.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
    1.14 +.set r30,30; .set r31,31
    1.15 +.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
    1.16 +.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
    1.17 +.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
    1.18 +.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
    1.19 +.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
    1.20 +.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
    1.21 +.set f30,30; .set f31,31
    1.22 +
    1.23 +#if _CALL_ELF == 2
    1.24 +#define STACK_PARAMS   96
    1.25 +#else
    1.26 +#define STACK_PARAMS   112
    1.27 +#endif
    1.28 +
    1.29 +#if _CALL_ELF == 2
    1.30 +        .section ".text"
    1.31 +        .type   SharedStub,@function
    1.32 +        .globl  SharedStub
    1.33 +        # Make the symbol hidden so that the branch from the stub does
    1.34 +        # not go via a PLT.  This is not only better for performance,
    1.35 +        # but may be necessary to avoid linker errors since there is
    1.36 +        # no place to restore the TOC register in a sibling call.
    1.37 +        .hidden SharedStub
    1.38 +        .align 2
    1.39 +SharedStub:
    1.40 +0:      addis 2,12,(.TOC.-0b)@ha
    1.41 +        addi 2,2,(.TOC.-0b)@l
    1.42 +        .localentry SharedStub,.-SharedStub
    1.43 +#else
    1.44 +        .section ".text"
    1.45 +        .align 2
    1.46 +        .globl SharedStub
    1.47 +        # Make the symbol hidden so that the branch from the stub does
    1.48 +        # not go via a PLT.  This is not only better for performance,
    1.49 +        # but may be necessary to avoid linker errors since there is
    1.50 +        # no place to restore the TOC register in a sibling call.
    1.51 +        .hidden SharedStub
    1.52 +        .section ".opd","aw"
    1.53 +        .align 3
    1.54 +
    1.55 +SharedStub:
    1.56 +        .quad   .SharedStub,.TOC.@tocbase
    1.57 +        .previous
    1.58 +        .type   SharedStub,@function
    1.59 +
    1.60 +.SharedStub:
    1.61 +#endif
    1.62 +        mflr    r0
    1.63 +
    1.64 +        std     r4, -56(r1)                     # Save all GPRS
    1.65 +        std     r5, -48(r1)
    1.66 +        std     r6, -40(r1)
    1.67 +        std     r7, -32(r1)
    1.68 +        std     r8, -24(r1)
    1.69 +        std     r9, -16(r1)
    1.70 +        std     r10, -8(r1)
    1.71 +
    1.72 +        stfd    f13, -64(r1)                    # ... and FPRS
    1.73 +        stfd    f12, -72(r1)
    1.74 +        stfd    f11, -80(r1)
    1.75 +        stfd    f10, -88(r1)
    1.76 +        stfd    f9, -96(r1)
    1.77 +        stfd    f8, -104(r1)
    1.78 +        stfd    f7, -112(r1)
    1.79 +        stfd    f6, -120(r1)
    1.80 +        stfd    f5, -128(r1)
    1.81 +        stfd    f4, -136(r1)
    1.82 +        stfd    f3, -144(r1)
    1.83 +        stfd    f2, -152(r1)
    1.84 +        stfd    f1, -160(r1)
    1.85 +
    1.86 +        subi    r6,r1,56                        # r6 --> gprData
    1.87 +        subi    r7,r1,160                       # r7 --> fprData
    1.88 +        addi    r5,r1,STACK_PARAMS              # r5 --> extra stack args
    1.89 +
    1.90 +        std     r0, 16(r1)
    1.91 +	
    1.92 +        stdu    r1,-288(r1)
    1.93 +                                                # r3 has the 'self' pointer
    1.94 +                                                # already
    1.95 +
    1.96 +        mr      r4,r11                          # r4 is methodIndex selector,
    1.97 +                                                # passed via r11 in the
    1.98 +                                                # nsNSStubBase::StubXX() call
    1.99 +
   1.100 +        bl      PrepareAndDispatch
   1.101 +        nop
   1.102 +
   1.103 +        ld      1,0(r1)                         # restore stack
   1.104 +        ld      r0,16(r1)                       # restore LR
   1.105 +        mtlr    r0
   1.106 +        blr
   1.107 +
   1.108 +#if _CALL_ELF == 2
   1.109 +        .size   SharedStub,.-SharedStub
   1.110 +#else
   1.111 +        .size   SharedStub,.-.SharedStub
   1.112 +#endif
   1.113 +
   1.114 +        # Magic indicating no need for an executable stack
   1.115 +        .section .note.GNU-stack, "", @progbits ; .previous

mercurial