1 $NetBSD: patch-xc,v 1.1.1.1 2009/08/05 02:59:48 tnn Exp $
3 NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
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
8 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
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/
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.
20 + * The Original Code is mozilla.org code.
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
33 + in the frame for the function that called SharedStub are the
34 + rest of the parameters we need
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
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')
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
63 + call PrepareAndDispatch
65 + mov %o0,%i0 ! propagate return value
72 + .size SharedStub, .-SharedStub
73 + .type SharedStub, #function