1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_openbsd.s Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +/* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 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 + .global SharedStub 1.11 + 1.12 +/* 1.13 + in the frame for the function that called SharedStub are the 1.14 + rest of the parameters we need 1.15 + 1.16 +*/ 1.17 + 1.18 +SharedStub: 1.19 +! we don't create a new frame yet, but work within the frame of the calling 1.20 +! function to give ourselves the other parameters we want 1.21 + 1.22 + mov %o0, %o1 ! shuffle the index up to 2nd place 1.23 + mov %i0, %o0 ! the original 'this' 1.24 + add %fp, 0x7ff + 136, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this') 1.25 + 1.26 +! save off the original incoming parameters that arrived in 1.27 +! registers, the ABI guarantees the space for us to do this 1.28 + stx %i1, [%fp + 0x7ff + 136] 1.29 + stx %i2, [%fp + 0x7ff + 144] 1.30 + stx %i3, [%fp + 0x7ff + 152] 1.31 + stx %i4, [%fp + 0x7ff + 160] 1.32 + stx %i5, [%fp + 0x7ff + 168] 1.33 +! now we can build our own stack frame 1.34 + save %sp,-(128 + 64),%sp ! room for the register window and 1.35 + ! struct pointer, rounded up to 0 % 64 1.36 +! our function now appears to have been called 1.37 +! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args) 1.38 +! so we can just copy these through 1.39 + 1.40 + mov %i0, %o0 1.41 + mov %i1, %o1 1.42 + mov %i2, %o2 1.43 + call PrepareAndDispatch 1.44 + nop 1.45 + mov %o0,%i0 ! propagate return value 1.46 + b .LL1 1.47 + nop 1.48 +.LL1: 1.49 + ret 1.50 + restore 1.51 + 1.52 + .size SharedStub, .-SharedStub 1.53 + .type SharedStub, #function