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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 // -*- Mode: Asm -*-
michael@0 2 //
michael@0 3 // This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 // License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6
michael@0 7 .set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
michael@0 8 .set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
michael@0 9 .set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
michael@0 10 .set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
michael@0 11 .set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
michael@0 12 .set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
michael@0 13 .set r30,30; .set r31,31
michael@0 14 .set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
michael@0 15 .set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
michael@0 16 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
michael@0 17 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
michael@0 18 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
michael@0 19 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
michael@0 20 .set f30,30; .set f31,31
michael@0 21
michael@0 22 .section ".text"
michael@0 23 .align 2
michael@0 24 .globl SharedStub
michael@0 25 .type SharedStub,@function
michael@0 26
michael@0 27 SharedStub:
michael@0 28 stwu sp,-112(sp) // room for
michael@0 29 // linkage (8),
michael@0 30 // gprData (32),
michael@0 31 // fprData (64),
michael@0 32 // stack alignment(8)
michael@0 33 mflr r0
michael@0 34 stw r0,116(sp) // save LR backchain
michael@0 35
michael@0 36 stw r4,12(sp) // save GP registers
michael@0 37 stw r5,16(sp) // (n.b. that we don't save r3
michael@0 38 stw r6,20(sp) // because PrepareAndDispatch() is savvy)
michael@0 39 stw r7,24(sp)
michael@0 40 stw r8,28(sp)
michael@0 41 stw r9,32(sp)
michael@0 42 stw r10,36(sp)
michael@0 43
michael@0 44 stfd f1,40(sp) // save FP registers
michael@0 45 stfd f2,48(sp)
michael@0 46 stfd f3,56(sp)
michael@0 47 stfd f4,64(sp)
michael@0 48 stfd f5,72(sp)
michael@0 49 stfd f6,80(sp)
michael@0 50 stfd f7,88(sp)
michael@0 51 stfd f8,96(sp)
michael@0 52
michael@0 53 // r3 has the 'self' pointer already
michael@0 54
michael@0 55 mr r4,r11 // r4 <= methodIndex selector, passed
michael@0 56 // via r11 in the nsXPTCStubBase::StubXX() call
michael@0 57
michael@0 58 addi r5,sp,120 // r5 <= pointer to callers args area,
michael@0 59 // beyond r3-r10/f1-f8 mapped range
michael@0 60
michael@0 61 addi r6,sp,8 // r6 <= gprData
michael@0 62 addi r7,sp,40 // r7 <= fprData
michael@0 63
michael@0 64 bl PrepareAndDispatch@local // Go!
michael@0 65
michael@0 66 lwz r0,116(sp) // restore LR
michael@0 67 mtlr r0
michael@0 68 la sp,112(sp) // clean up the stack
michael@0 69 blr
michael@0 70
michael@0 71 // Magic indicating no need for an executable stack
michael@0 72 .section .note.GNU-stack, "", @progbits ; .previous

mercurial