xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_aix.s.m4

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_ppc_aix.s.m4	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,119 @@
     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 sp,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 +# Define the correct name of the stub function based on the object model
    1.24 +
    1.25 +define(STUB_NAME, 
    1.26 +       ifelse(AIX_OBJMODEL, ibm,
    1.27 +              `Stub'$1`__EI14nsXPTCStubBaseFv',
    1.28 +              `Stub'$1`__14nsXPTCStubBaseFv'))
    1.29 +
    1.30 +define(STUB_ENTRY, `
    1.31 +    .rename H.10.NO_SYMBOL{PR},""
    1.32 +    .rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`"
    1.33 +    .csect  H.10.NO_SYMBOL{PR}
    1.34 +    .globl  .'STUB_NAME($1)`
    1.35 +    .globl  'STUB_NAME($1)`{DS}
    1.36 +
    1.37 +.'STUB_NAME($1)`:
    1.38 +    li      r12, '$1`
    1.39 +    b       .SharedStub
    1.40 +    nop
    1.41 +        
    1.42 +
    1.43 +    .toc
    1.44 +T.18.'STUB_NAME($1)`:
    1.45 +    .tc     H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS}
    1.46 +    .csect  'STUB_NAME($1)`{DS}
    1.47 +    .long   .'STUB_NAME($1)`
    1.48 +    .long   TOC{TC0}
    1.49 +    .long   0x00000000
    1.50 +')
    1.51 +
    1.52 +define(SENTINEL_ENTRY, `')
    1.53 +
    1.54 +include(xptcstubsdef.inc)
    1.55 +
    1.56 +    .rename H.10.NO_SYMBOL{PR},""
    1.57 +    .rename H.18.SharedStub{TC},"SharedStub"
    1.58 +
    1.59 +# .text section
    1.60 +    .csect  H.10.NO_SYMBOL{PR}
    1.61 +    .globl  .SharedStub
    1.62 +    .globl  SharedStub{DS}
    1.63 +    .extern .PrepareAndDispatch
    1.64 +
    1.65 +.SharedStub:
    1.66 +    mflr    r0
    1.67 +    stw     r0,8(sp)
    1.68 +
    1.69 +    stwu    sp,-176(sp)     # room for linkage (24), fprData (104), gprData(28)
    1.70 +                            # outgoing params to PrepareAndDispatch (20)
    1.71 +
    1.72 +    stw     r4,44(sp)       # link area (24) + PrepareAndDispatch params (20)
    1.73 +    stw     r5,48(sp)
    1.74 +    stw     r6,52(sp)
    1.75 +    stw     r7,56(sp)
    1.76 +    stw     r8,60(sp)
    1.77 +    stw     r9,64(sp)
    1.78 +    stw     r10,68(sp)
    1.79 +    stfd    f1,72(sp)
    1.80 +    stfd    f2,80(sp)
    1.81 +    stfd    f3,88(sp)
    1.82 +    stfd    f4,96(sp)
    1.83 +    stfd    f5,104(sp)
    1.84 +    stfd    f6,112(sp)
    1.85 +    stfd    f7,120(sp)
    1.86 +    stfd    f8,128(sp)
    1.87 +    stfd    f9,136(sp)
    1.88 +    stfd    f10,144(sp)
    1.89 +    stfd    f11,152(sp)
    1.90 +    stfd    f12,156(sp)
    1.91 +    stfd    f13,164(sp)
    1.92 +
    1.93 +    addi    r6,sp,44        # gprData
    1.94 +
    1.95 +    addi    r7,sp,72        # fprData
    1.96 +                            # r3 has the 'self' pointer already
    1.97 +    mr      r4,r12          # methodIndex selector (it is now LATER)
    1.98 +    addi    r5,sp,232       # pointer to callers args area, beyond r3-r10
    1.99 +                            # mapped range
   1.100 +
   1.101 +    bl      .PrepareAndDispatch
   1.102 +    nop
   1.103 +
   1.104 +    
   1.105 +    lwz     r0,184(sp)
   1.106 +    addi    sp,sp,176
   1.107 +    mtlr    r0
   1.108 +    blr
   1.109 +
   1.110 +# .data section
   1.111 +
   1.112 +    .toc                            # 0x00000038
   1.113 +T.18.SharedStub:
   1.114 +    .tc     H.18.SharedStub{TC},SharedStub{DS}
   1.115 +
   1.116 +    .csect  SharedStub{DS}
   1.117 +    .long   .SharedStub             # "\0\0\0\0"
   1.118 +    .long   TOC{TC0}                # "\0\0\0008"
   1.119 +    .long   0x00000000              # "\0\0\0\0"
   1.120 +# End   csect   SharedStub{DS}
   1.121 +
   1.122 +# .bss section

mercurial