michael@0: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: .global SharedStub michael@0: michael@0: /* michael@0: in the frame for the function that called SharedStub are the michael@0: rest of the parameters we need michael@0: michael@0: */ michael@0: michael@0: SharedStub: michael@0: ! we don't create a new frame yet, but work within the frame of the calling michael@0: ! function to give ourselves the other parameters we want michael@0: michael@0: mov %o0, %o1 ! shuffle the index up to 2nd place michael@0: mov %i0, %o0 ! the original 'this' michael@0: add %fp, 72, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this') michael@0: ! save off the original incoming parameters that arrived in michael@0: ! registers, the ABI guarantees the space for us to do this michael@0: st %i1, [%fp + 72] michael@0: st %i2, [%fp + 76] michael@0: st %i3, [%fp + 80] michael@0: st %i4, [%fp + 84] michael@0: st %i5, [%fp + 88] michael@0: ! now we can build our own stack frame michael@0: save %sp,-(64 + 32),%sp ! room for the register window and michael@0: ! struct pointer, rounded up to 0 % 32 michael@0: ! our function now appears to have been called michael@0: ! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args) michael@0: ! so we can just copy these through michael@0: michael@0: mov %i0, %o0 michael@0: mov %i1, %o1 michael@0: mov %i2, %o2 michael@0: call PrepareAndDispatch michael@0: nop michael@0: mov %o0,%i0 ! propagate return value michael@0: b .LL1 michael@0: nop michael@0: .LL1: michael@0: ret michael@0: restore michael@0: michael@0: .size SharedStub, .-SharedStub michael@0: .type SharedStub, #function