Fixup fromcvs/togit conversion
[pkgsrcv2.git] / www / seamonkey / patches / patch-xc
1 $NetBSD: patch-xc,v 1.1.1.1 2009/08/05 02:59:48 tnn Exp $
2
3 NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
4
5 --- mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_netbsd.s.orig       2009-07-09 10:12:51.000000000 +0200
6 +++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_netbsd.s
7 @@ -0,0 +1,66 @@
8 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
9 + *
10 + * The contents of this file are subject to the Netscape Public
11 + * License Version 1.1 (the "License"); you may not use this file
12 + * except in compliance with the License. You may obtain a copy of
13 + * the License at http://www.mozilla.org/NPL/
14 + *
15 + * Software distributed under the License is distributed on an "AS
16 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 + * implied. See the License for the specific language governing
18 + * rights and limitations under the License.
19 + *
20 + * The Original Code is mozilla.org code.
21 + *
22 + * The Initial Developer of the Original Code is Netscape
23 + * Communications Corporation.  Portions created by Netscape are
24 + * Copyright (C) 1999 Netscape Communications Corporation. All
25 + * Rights Reserved.
26 + *
27 + * Contributor(s): 
28 + */
29 +
30 +        .global SharedStub
31 +
32 +/*
33 +    in the frame for the function that called SharedStub are the
34 +    rest of the parameters we need
35 +
36 +*/
37 +
38 +SharedStub:
39 +! we don't create a new frame yet, but work within the frame of the calling
40 +! function to give ourselves the other parameters we want
41 +
42 +       mov     %o0, %o1               ! shuffle the index up to 2nd place
43 +       mov     %i0, %o0               ! the original 'this'
44 +       add     %fp, 0x7ff + 136, %o2  ! previous stack top adjusted to the first argument slot (beyond 'this')
45 +
46 +! save off the original incoming parameters that arrived in 
47 +! registers, the ABI guarantees the space for us to do this
48 +       stx     %i1, [%fp + 0x7ff + 136]
49 +       stx     %i2, [%fp + 0x7ff + 144]
50 +       stx     %i3, [%fp + 0x7ff + 152]
51 +       stx     %i4, [%fp + 0x7ff + 160]
52 +       stx     %i5, [%fp + 0x7ff + 168]
53 +! now we can build our own stack frame
54 +       save    %sp,-(128 + 64),%sp    ! room for the register window and
55 +                                      ! struct pointer, rounded up to 0 % 64
56 +! our function now appears to have been called
57 +! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args)
58 +! so we can just copy these through
59 +
60 +       mov     %i0, %o0
61 +       mov     %i1, %o1
62 +       mov     %i2, %o2
63 +       call    PrepareAndDispatch
64 +        nop
65 +       mov     %o0,%i0             ! propagate return value
66 +       b .LL1
67 +        nop
68 +.LL1:
69 +       ret
70 +        restore
71 +
72 +       .size   SharedStub, .-SharedStub
73 +       .type   SharedStub, #function