]> gitweb @ CieloNegro.org - pkgsrc-firefox3.git/blob - files/xptcstubs_asm_sparc64_netbsd.s
Initial revision of the upstream www/firefox3
[pkgsrc-firefox3.git] / files / xptcstubs_asm_sparc64_netbsd.s
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
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/
7  *
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.
12  *
13  * The Original Code is mozilla.org code.
14  *
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
18  * Rights Reserved.
19  *
20  * Contributor(s): 
21  */
22
23         .global SharedStub
24
25 /*
26     in the frame for the function that called SharedStub are the
27     rest of the parameters we need
28
29 */
30
31 SharedStub:
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
34
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')
38
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
52
53         mov     %i0, %o0
54         mov     %i1, %o1
55         mov     %i2, %o2
56         call    PrepareAndDispatch
57          nop
58         mov     %o0,%i0             ! propagate return value
59         b .LL1
60          nop
61 .LL1:
62         ret
63          restore
64
65        .size    SharedStub, .-SharedStub
66        .type    SharedStub, #function