1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_aix64.s.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 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 +# Define the correct name of the stub function based on the object model 1.23 +define(STUB_NAME, 1.24 + ifelse(AIX_OBJMODEL, ibm, 1.25 + `Stub'$1`__EI14nsXPTCStubBaseFv', 1.26 + `Stub'$1`__14nsXPTCStubBaseFv')) 1.27 +define(STUB_ENTRY, ` 1.28 + .rename H.10.NO_SYMBOL{PR},"" 1.29 + .rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`" 1.30 + .csect H.10.NO_SYMBOL{PR} 1.31 + .globl .'STUB_NAME($1)` 1.32 + .globl 'STUB_NAME($1)`{DS} 1.33 +.'STUB_NAME($1)`: 1.34 + li r12, '$1` 1.35 + b .SharedStub 1.36 + nop 1.37 + .toc 1.38 +T.18.'STUB_NAME($1)`: 1.39 + .tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS} 1.40 + .csect 'STUB_NAME($1)`{DS} 1.41 + .llong .'STUB_NAME($1)` 1.42 + .llong TOC{TC0} 1.43 + .llong 0x00000000 1.44 +') 1.45 +define(SENTINEL_ENTRY, `') 1.46 +include(xptcstubsdef.inc) 1.47 + .rename H.10.NO_SYMBOL{PR},"" 1.48 + .rename H.18.SharedStub{TC},"SharedStub" 1.49 +# .text section 1.50 + .csect H.10.NO_SYMBOL{PR} 1.51 + .globl .SharedStub 1.52 + .globl SharedStub{DS} 1.53 + .extern .PrepareAndDispatch 1.54 +.SharedStub: 1.55 + mflr r0 1.56 + std r0,16(sp) 1.57 + stdu sp,-248(sp) # room for linkage (24*2), fprData (104), gprData(28*2) 1.58 + # outgoing params to PrepareAndDispatch (40) 1.59 + std r4,88(sp) # link area (48) + PrepareAndDispatch params (20) 1.60 + std r5,96(sp) 1.61 + std r6,104(sp) 1.62 + std r7,112(sp) 1.63 + std r8,120(sp) 1.64 + std r9,128(sp) 1.65 + std r10,136(sp) 1.66 + stfd f1,144(sp) 1.67 + stfd f2,152(sp) 1.68 + stfd f3,160(sp) 1.69 + stfd f4,168(sp) 1.70 + stfd f5,176(sp) 1.71 + stfd f6,184(sp) 1.72 + stfd f7,192(sp) 1.73 + stfd f8,200(sp) 1.74 + stfd f9,208(sp) 1.75 + stfd f10,216(sp) 1.76 + stfd f11,224(sp) 1.77 + stfd f12,232(sp) 1.78 + stfd f13,240(sp) 1.79 + addi r6,sp,88 # gprData 1.80 + addi r7,sp,144 # fprData 1.81 + # r3 has the 'self' pointer already 1.82 + mr r4,r12 # methodIndex selector (it is now LATER) 1.83 + addi r5,sp,360 # pointer to callers args area, beyond r3-r10 1.84 + # mapped range 1.85 + bl .PrepareAndDispatch 1.86 + nop 1.87 + ld r0,264(sp) 1.88 + addi sp,sp,248 1.89 + mtlr r0 1.90 + blr 1.91 +# .data section 1.92 + .toc # 0x00000038 1.93 +T.18.SharedStub: 1.94 + .tc H.18.SharedStub{TC},SharedStub{DS} 1.95 + .csect SharedStub{DS} 1.96 + .llong .SharedStub # "\0\0\0\0" 1.97 + .llong TOC{TC0} # "\0\0\0008" 1.98 + .llong 0x00000000 # "\0\0\0\0" 1.99 +# End csect SharedStub{DS} 1.100 +# .bss section