1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * The contents of this file are subject to the Netscape Public
4 * License Version 1.1 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of
6 * the License at http://www.mozilla.org/NPL/
8 * Software distributed under the License is distributed on an "AS
9 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 * implied. See the License for the specific language governing
11 * rights and limitations under the License.
13 * The Original Code is mozilla.org code.
15 * The Initial Developer of the Original Code is Netscape
16 * Communications Corporation. Portions created by Netscape are
17 * Copyright (C) 1999 Netscape Communications Corporation. All
26 in the frame for the function that called SharedStub are the
27 rest of the parameters we need
32 ! we don't create a new frame yet, but work within the frame of the calling
33 ! function to give ourselves the other parameters we want
35 mov %o0, %o1 ! shuffle the index up to 2nd place
36 mov %i0, %o0 ! the original 'this'
37 add %fp, 0x7ff + 136, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this')
39 ! save off the original incoming parameters that arrived in
40 ! registers, the ABI guarantees the space for us to do this
41 stx %i1, [%fp + 0x7ff + 136]
42 stx %i2, [%fp + 0x7ff + 144]
43 stx %i3, [%fp + 0x7ff + 152]
44 stx %i4, [%fp + 0x7ff + 160]
45 stx %i5, [%fp + 0x7ff + 168]
46 ! now we can build our own stack frame
47 save %sp,-(128 + 64),%sp ! room for the register window and
48 ! struct pointer, rounded up to 0 % 64
49 ! our function now appears to have been called
50 ! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args)
51 ! so we can just copy these through
56 call PrepareAndDispatch
58 mov %o0,%i0 ! propagate return value
65 .size SharedStub, .-SharedStub
66 .type SharedStub, #function