~ubuntu-branches/ubuntu/gutsy/virtualbox-ose/gutsy

« back to all changes in this revision

Viewing changes to src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc_netbsd.s

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-09-08 16:44:58 UTC
  • Revision ID: james.westby@ubuntu.com-20070908164458-wao29470vqtr8ksy
Tags: upstream-1.5.0-dfsg2
ImportĀ upstreamĀ versionĀ 1.5.0-dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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, 72, %o2        ! previous stack top adjusted to the first argument slot (beyond 'this')
 
38
! save off the original incoming parameters that arrived in 
 
39
! registers, the ABI guarantees the space for us to do this
 
40
        st      %i1, [%fp + 72]
 
41
        st      %i2, [%fp + 76]
 
42
        st      %i3, [%fp + 80]
 
43
        st      %i4, [%fp + 84]
 
44
        st      %i5, [%fp + 88]
 
45
! now we can build our own stack frame
 
46
        save    %sp,-(64 + 32),%sp   ! room for the register window and
 
47
                                    ! struct pointer, rounded up to 0 % 32
 
48
! our function now appears to have been called
 
49
! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args)
 
50
! so we can just copy these through
 
51
        
 
52
        mov     %i0, %o0
 
53
        mov     %i1, %o1
 
54
        mov     %i2, %o2
 
55
        call    PrepareAndDispatch
 
56
        nop
 
57
        mov     %o0,%i0             ! propagate return value
 
58
        b .LL1
 
59
        nop
 
60
.LL1:
 
61
        ret
 
62
        restore
 
63
 
 
64
       .size    SharedStub, .-SharedStub
 
65
       .type    SharedStub, #function