xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_openbsd.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_ppc_openbsd.S	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +// -*- Mode: Asm -*-
     1.5 +//
     1.6 +// This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +// License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +// file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
    1.11 +.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
    1.12 +.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
    1.13 +.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
    1.14 +.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
    1.15 +.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
    1.16 +.set r30,30; .set r31,31
    1.17 +.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
    1.18 +.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
    1.19 +.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
    1.20 +.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
    1.21 +.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
    1.22 +.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
    1.23 +.set f30,30; .set f31,31
    1.24 +
    1.25 +	.section ".text"
    1.26 +	.align 2
    1.27 +	.globl SharedStub
    1.28 +	.type  SharedStub,@function
    1.29 +
    1.30 +SharedStub:
    1.31 +	stwu	sp,-112(sp)			// room for
    1.32 +						// linkage (8),
    1.33 +						// gprData (32),
    1.34 +						// fprData (64),
    1.35 +						// stack alignment(8)
    1.36 +	mflr	r0
    1.37 +	stw	r0,116(sp)			// save LR backchain
    1.38 +
    1.39 +	stw	r4,12(sp)			// save GP registers
    1.40 +	stw	r5,16(sp)			// (n.b. that we don't save r3
    1.41 +	stw	r6,20(sp)			// because PrepareAndDispatch() is savvy)
    1.42 +	stw	r7,24(sp)
    1.43 +	stw	r8,28(sp)
    1.44 +	stw	r9,32(sp)
    1.45 +	stw	r10,36(sp)
    1.46 +
    1.47 +	stfd	f1,40(sp)			// save FP registers
    1.48 +	stfd	f2,48(sp)
    1.49 +	stfd	f3,56(sp)
    1.50 +	stfd	f4,64(sp)
    1.51 +	stfd	f5,72(sp)
    1.52 +	stfd	f6,80(sp)
    1.53 +	stfd	f7,88(sp)
    1.54 +	stfd	f8,96(sp)
    1.55 +
    1.56 +						// r3 has the 'self' pointer already
    1.57 +
    1.58 +	mr	r4,r11				// r4 <= methodIndex selector, passed
    1.59 +						// via r11 in the nsXPTCStubBase::StubXX() call
    1.60 +
    1.61 +	addi	r5,sp,120			// r5 <= pointer to callers args area,
    1.62 +						// beyond r3-r10/f1-f8 mapped range
    1.63 +
    1.64 +	addi	r6,sp,8				// r6 <= gprData
    1.65 +	addi	r7,sp,40			// r7 <= fprData
    1.66 +
    1.67 +	bl	PrepareAndDispatch@local	// Go!
    1.68 +
    1.69 +	lwz	r0,116(sp)			// restore LR
    1.70 +	mtlr	r0
    1.71 +	la	sp,112(sp)			// clean up the stack
    1.72 +	blr
    1.73 +
    1.74 +// Magic indicating no need for an executable stack
    1.75 +.section .note.GNU-stack, "", @progbits ; .previous

mercurial