Revision 881

Date:
2010/06/15 07:24:18
Author:
decke
Revision Log:
libxul:
- Move to correct category
Files:

Legend:

 
Added
 
Removed
 
Modified
  • www/libxul/distinfo

     
    1 MD5 (xulrunner-1.9.2.source.tar.bz2) = 458051557ff49e6a352c1d56eee5782a
    2 SHA256 (xulrunner-1.9.2.source.tar.bz2) = 8d4f12fff7bc361d83e6b486f9ec4264c60114ed86c805e1221b3d30efec0a4b
    3 SIZE (xulrunner-1.9.2.source.tar.bz2) = 48206915
  • www/libxul/files/libsydney_oss

     
    1 --- media/libsydneyaudio/src/Makefile.in.orig 2009-08-17 14:21:06.000000000 +0200
    2 +++ media/libsydneyaudio/src/Makefile.in 2009-08-17 14:21:53.000000000 +0200
    3 @@ -45,6 +45,12 @@
    4 LIBRARY_NAME = sydneyaudio
    5 FORCE_STATIC_LIB= 1
    6
    7 +ifeq ($(OS_ARCH),FreeBSD)
    8 +CSRCS = \
    9 + sydney_audio_oss.c \
    10 + $(NULL)
    11 +endif
    12 +
    13 ifeq ($(OS_ARCH),Linux)
    14 CSRCS = \
    15 sydney_audio_alsa.c \
  • www/libxul/files/patch-config-mkdepend-imakemdep.h

     
    1 --- config/mkdepend/imakemdep.h Fri Sep 4 21:22:25 1998
    2 +++ config/mkdepend/imakemdep.h Thu Oct 16 22:43:25 2003
    3 @@ -278,4 +278,7 @@
    4 "-D__i386__",
    5 # endif
    6 +# if defined(__amd64__) || defined(__x86_64__)
    7 + "-D__amd64__ -D__x86_64__",
    8 +# endif
    9 # ifdef __GNUC__
    10 "-traditional",
  • www/libxul/files/patch-config_autoconf.mk.in

     
    1 --- config/autoconf.mk.in.orig 2007-08-28 12:02:43.000000000 -0400
    2 +++ config/autoconf.mk.in 2007-09-26 14:21:51.000000000 -0400
    3 @@ -58,14 +58,14 @@
    4 prefix = @prefix@
    5 exec_prefix = @exec_prefix@
    6 bindir = @bindir@
    7 -includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
    8 +includedir = @includedir@/%%MOZILLA%%
    9 libdir = @libdir@
    10 datadir = @datadir@
    11 mandir = @mandir@
    12 -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
    13 +idldir = $(datadir)/idl/%%MOZILLA%%
    14
    15 -installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
    16 -sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
    17 +installdir = $(libdir)/%%MOZILLA%%
    18 +sdkdir = $(libdir)/%%MOZILLA%%
    19
    20 DIST = $(DEPTH)/dist
    21 LIBXUL_SDK = @LIBXUL_SDK@
  • www/libxul/files/patch-config_mkdepend_Makefile.in

     
    1 --- config/mkdepend/Makefile.in.orig Sun Apr 18 14:17:26 2004
    2 +++ config/mkdepend/Makefile.in Sun Dec 12 09:42:11 2004
    3 @@ -73,6 +73,7 @@
    4 include $(topsrcdir)/config/rules.mk
    5
    6 HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\"
    7 +HOST_CFLAGS += $(XCFLAGS)
    8
    9 ifdef GNU_CC
    10 _GCCDIR = $(shell $(CC) -print-file-name=include)
  • www/libxul/files/patch-config_rules.mk

     
    1 --- config/rules.mk.orig Thu Sep 14 14:07:03 2006
    2 +++ config/rules.mk Wed Oct 18 11:00:09 2006
    3 @@ -442,9 +442,7 @@
    4 endif
    5
    6 ifeq ($(OS_ARCH),FreeBSD)
    7 -ifdef IS_COMPONENT
    8 -EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
    9 -endif
    10 +EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic -lc
    11 endif
    12
    13 ifeq ($(OS_ARCH),NetBSD)
  • www/libxul/files/patch-configure.in

     
    1 --- configure.in.orig 2009-10-29 23:11:31.000000000 +0100
    2 +++ configure.in 2009-11-16 19:51:19.000000000 +0100
    3 @@ -1352,7 +1352,7 @@
    4 CPU_ARCH=sparc
    5 ;;
    6
    7 -x86_64 | ia64)
    8 +amd64 | x86_64 | ia64)
    9 CPU_ARCH="$OS_TEST"
    10 ;;
    11
    12 @@ -3582,8 +3582,8 @@
    13 *)
    14
    15 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
    16 - AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
    17 - AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
    18 + AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv"],
    19 + AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv"])))
    20 _SAVE_LIBS=$LIBS
    21 LIBS="$LIBS $_ICONV_LIBS"
    22 AC_CACHE_CHECK(
  • www/libxul/files/patch-content-xslt-public-txDouble.h

     
    1 --- content/xslt/public/txDouble.h.orig 2009-08-16 21:46:27.000000000 +0200
    2 +++ content/xslt/public/txDouble.h 2009-08-16 21:49:53.000000000 +0200
    3 @@ -43,7 +43,7 @@
    4 //A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
    5 #ifdef __FreeBSD__
    6 #include <ieeefp.h>
    7 -#ifdef __alpha__
    8 +#if !defined(__amd64__) && !defined(__i386__)
    9 static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP;
    10 #else
    11 static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
  • www/libxul/files/patch-db_sqlite3_src_Makefile.in

     
    1 --- db/sqlite3/src/Makefile.in.orig 2008-06-19 11:03:17.000000000 -0500
    2 +++ db/sqlite3/src/Makefile.in 2008-06-19 11:04:15.000000000 -0500
    3 @@ -45,6 +45,8 @@
    4
    5 include $(DEPTH)/config/autoconf.mk
    6
    7 +OS_CFLAGS = -I../../../dist/include/sqlite3
    8 +OS_LIBS = %%PTHREAD_LIBS%%
    9 MODULE = sqlite3
    10 LIBRARY_NAME = sqlite3
    11 FORCE_SHARED_LIB = 1
  • www/libxul/files/patch-embedding_base_nsEmbedAPI.cpp

     
    1 --- embedding/base/nsEmbedAPI.cpp.orig 2007-10-09 20:00:30.000000000 -0400
    2 +++ embedding/base/nsEmbedAPI.cpp 2007-10-09 20:01:45.000000000 -0400
    3 @@ -53,7 +53,12 @@ static PRBool sRegistryIniti
    4 static PRUint32 sInitCounter = 0;
    5
    6 #define HACK_AROUND_THREADING_ISSUES
    7 -//#define HACK_AROUND_NONREENTRANT_INITXPCOM
    8 +#ifdef __FreeBSD__
    9 +#include <sys/param.h>
    10 +#if __FreeBSD_version < 700042
    11 +#define HACK_AROUND_NONREENTRANT_INITXPCOM
    12 +#endif
    13 +#endif
    14
    15 #ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
    16 // XXX hack class to clean up XPCOM when this module is unloaded
  • www/libxul/files/patch-js-src-config-mkdepend-Makefile.in

     
    1 --- js/src/config/mkdepend/Makefile.in.orig 2009-08-15 17:45:39.000000000 +0200
    2 +++ js/src/config/mkdepend/Makefile.in 2009-08-15 17:46:08.000000000 +0200
    3 @@ -72,7 +72,7 @@
    4
    5 include $(topsrcdir)/config/rules.mk
    6
    7 -HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\"
    8 +HOST_CFLAGS += -DINCLUDEDIR=\"%%LOCALBASE%%/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" -I/usr/local/include
    9
    10 ifdef GNU_CC
    11 _GCCDIR = $(shell $(CC) -print-file-name=include)
  • www/libxul/files/patch-js-src-configure.in

     
    1 --- js/src/configure.in.orig 2009-09-30 21:50:26.000000000 +0200
    2 +++ js/src/configure.in 2009-09-30 21:50:44.000000000 +0200
    3 @@ -2467,10 +2467,6 @@
    4 ENABLE_JIT=1
    5 NANOJIT_ARCH=ARM
    6 ;;
    7 -sparc*-*)
    8 - ENABLE_JIT=1
    9 - NANOJIT_ARCH=Sparc
    10 - ;;
    11 esac
    12
    13 MOZ_ARG_DISABLE_BOOL(jit,
  • www/libxul/files/patch-js-src-jslock.cpp

     
    1 --- js/src/jslock.cpp.orig 2009-10-07 20:15:38.000000000 +0200
    2 +++ js/src/jslock.cpp 2009-10-07 21:36:14.000000000 +0200
    3 @@ -160,8 +160,13 @@
    4 unsigned int res;
    5
    6 __asm__ __volatile__ (
    7 - "stbar\n"
    8 - "cas [%1],%2,%3\n"
    9 + "membar #StoreLoad | #LoadLoad\n"
    10 +# if defined (__sparc64__)
    11 + "casx [%1],%2,%3\n"
    12 +# else
    13 + "cas [%1],%2,%3\n" /* 32-bit version */
    14 +# endif
    15 + "membar #StoreLoad | #LoadLoad\n"
    16 "cmp %2,%3\n"
    17 "be,a 1f\n"
    18 "mov 1,%0\n"
  • www/libxul/files/patch-js-src-Makefile.in

     
    1 --- js/src/Makefile.in.orig 2009-05-11 15:21:19.000000000 +0200
    2 +++ js/src/Makefile.in 2009-05-11 15:21:34.000000000 +0200
    3 @@ -427,7 +427,7 @@
    4 endif # WINNT
    5
    6 ifeq ($(OS_ARCH),FreeBSD)
    7 -EXTRA_LIBS += -pthread
    8 +EXTRA_LIBS += -pthread -lc
    9 endif
    10 ifeq ($(OS_ARCH),IRIX)
    11 ifdef USE_N32
  • www/libxul/files/patch-js_src_jsnum.cpp

     
    1 --- js/src/jsnum.cpp.orig 2009-10-14 18:03:30.000000000 +0200
    2 +++ js/src/jsnum.cpp 2009-10-15 21:49:44.000000000 +0200
    3 @@ -43,6 +43,9 @@
    4 /*
    5 * JS number type and wrapper class.
    6 */
    7 +#if defined(__FreeBSD__)
    8 +#include <sys/param.h>
    9 +#endif
    10 #ifdef XP_OS2
    11 #define _PC_53 PC_53
    12 #define _MCW_EM MCW_EM
    13 @@ -691,8 +694,16 @@
    14
    15 #else
    16
    17 +#if defined(__FreeBSD__) && __FreeBSD_version >= 601000
    18 +#include <fenv.h>
    19 +#define FIX_FPU() (fedisableexcept(FE_ALL_EXCEPT))
    20 +
    21 +#else
    22 +
    23 #define FIX_FPU() ((void)0)
    24
    25 +#endif /* defined(__FreeBSD__) && __FreeBSD_version >= 503000 */
    26 +
    27 #endif
    28
    29 JSBool
  • www/libxul/files/patch-layout_generic_Makefile.in

     
    1 --- layout/generic/Makefile.in.orig 2009-08-07 00:49:41.000000000 +0200
    2 +++ layout/generic/Makefile.in 2009-08-09 20:54:53.000000000 +0200
    3 @@ -187,9 +187,10 @@
    4 -I$(srcdir)/../../content/base/src \
    5 -I$(srcdir)/../../content/html/content/src \
    6 -I$(srcdir)/../../dom/base \
    7 - $(MOZ_CAIRO_CFLAGS) \
    8 $(NULL)
    9
    10 +CXXFLAGS += $(MOZ_CAIRO_CFLAGS)
    11 +
    12 ifdef MOZ_ENABLE_GTK2
    13 CXXFLAGS += $(MOZ_GTK2_CFLAGS)
    14 endif
  • www/libxul/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h

     
    1 --- media/liboggz/include/oggz/oggz_off_t_generated.h.orig 2009-08-24 17:52:50.000000000 +0200
    2 +++ media/liboggz/include/oggz/oggz_off_t_generated.h 2009-09-10 19:13:22.000000000 +0200
    3 @@ -59,7 +59,7 @@
    4
    5 #include <sys/types.h>
    6
    7 -#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2)
    8 +#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2) || defined(__FreeBSD__)
    9 typedef off_t oggz_off_t;
    10 #else
    11 typedef loff_t oggz_off_t;
  • www/libxul/files/patch-security_coreconf_FreeBSD.mk

     
    1 --- security/coreconf/FreeBSD.mk.orig 2009-11-09 01:34:19.000000000 +0100
    2 +++ security/coreconf/FreeBSD.mk 2009-11-11 18:15:55.000000000 +0100
    3 @@ -45,8 +45,24 @@
    4 ifeq ($(OS_TEST),alpha)
    5 CPU_ARCH = alpha
    6 else
    7 +ifeq ($(OS_TEST),amd64)
    8 +CPU_ARCH = amd64
    9 +else
    10 +ifeq ($(OS_TEST),ia64)
    11 +CPU_ARCH = ia64
    12 +else
    13 +ifeq ($(OS_TEST),powerpc)
    14 +CPU_ARCH = powerpc
    15 +else
    16 +ifeq ($(OS_TEST),sparc64)
    17 +CPU_ARCH = sparc64
    18 +else
    19 CPU_ARCH = x86
    20 endif
    21 +endif
    22 +endif
    23 +endif
    24 +endif
    25
    26 OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
    27
    28 @@ -73,7 +89,7 @@
    29 DLL_SUFFIX = so.1.0
    30 endif
    31
    32 -MKSHLIB = $(CC) $(DSO_LDOPTS)
    33 +MKSHLIB = $(CC) -Wl,-Bsymbolic -lc $(DSO_LDOPTS) -o $@
    34 ifdef MAPFILE
    35 MKSHLIB += -Wl,--version-script,$(MAPFILE)
    36 endif
    37 @@ -82,4 +98,4 @@
    38
    39 G++INCLUDES = -I/usr/include/g++
    40
    41 -INCLUDES += -I/usr/X11R6/include
    42 +#INCLUDES += -I/usr/local/include
  • www/libxul/files/patch-security_manager_ssl_src_nsNSSComponent.cpp

     
    1 --- security/manager/ssl/src/nsNSSComponent.cpp.orig Mon May 29 23:10:54 2006
    2 +++ security/manager/ssl/src/nsNSSComponent.cpp Mon May 29 23:12:22 2006
    3 @@ -110,6 +110,7 @@
    4 #include "nss.h"
    5 #include "pk11func.h"
    6 #include "ssl.h"
    7 +#define NSS_ENABLE_ECC 1
    8 #include "sslproto.h"
    9 #include "secmod.h"
    10 #include "sechash.h"
  • www/libxul/files/patch-storage_build_Makefile.in

     
    1 --- storage/build/Makefile.in.orig Tue Feb 21 11:18:56 2006
    2 +++ storage/build/Makefile.in Sun Nov 5 16:16:06 2006
    3 @@ -77,6 +77,7 @@
    4 $(EXTRA_DSO_LIBS) \
    5 $(MOZ_COMPONENT_LIBS) \
    6 $(MOZ_JS_LIBS) \
    7 + %%PTHREAD_LIBS%% \
    8 $(NULL)
    9
    10 include $(topsrcdir)/config/rules.mk
  • www/libxul/files/patch-xpcom_reflect_xptcall_public_xptcstubsdecl.inc

     
    1 --- xpcom/reflect/xptcall/public/xptcstubsdecl.inc.orig Tue Mar 16 03:07:25 2004
    2 +++ xpcom/reflect/xptcall/public/xptcstubsdecl.inc Fri Mar 19 15:58:14 2004
    3 @@ -8,7 +8,7 @@
    4 * 1 is AddRef
    5 * 2 is Release
    6 */
    7 -#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))
    8 +#if !defined(__ia64)
    9 NS_IMETHOD Stub3();
    10 NS_IMETHOD Stub4();
    11 NS_IMETHOD Stub5();
  • www/libxul/files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in

     
    1 --- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2009-09-16 04:41:25.000000000 +0200
    2 +++ xpcom/reflect/xptcall/src/md/unix/Makefile.in 2009-10-03 21:30:21.000000000 +0200
    3 @@ -73,6 +73,9 @@
    4 DEFINES += -DKEEP_STACK_16_BYTE_ALIGNED
    5 CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp
    6 endif
    7 +ifeq (x86_64,$(OS_TEST))
    8 +CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp
    9 +endif
    10 endif
    11 endif
    12
    13 @@ -96,7 +99,7 @@
    14 endif
    15 endif
    16 # IA64 Linux
    17 -ifneq (,$(filter Linux,$(OS_ARCH)))
    18 +ifneq (,$(filter Linux FreeBSD,$(OS_ARCH)))
    19 ifneq (,$(findstring ia64,$(OS_TEST)))
    20 CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp
    21 ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
    22 @@ -111,8 +114,8 @@
    23 #
    24 # FreeBSD/amd64
    25 #
    26 -ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDx86_64)
    27 -CPPSRCS := xptcinvoke_amd64_linux.cpp xptcstubs_amd64_linux.cpp
    28 +ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDamd64)
    29 +CPPSRCS := xptcinvoke_amd64_openbsd.cpp xptcstubs_amd64_openbsd.cpp
    30 endif
    31 #
    32 # BeOS/Intel (uses the same unixish_x86 code)
    33 @@ -165,9 +168,15 @@
    34 ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s
    35 endif
    36 #
    37 +# FreeBSD/Alpha
    38 +#
    39 +ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha)
    40 +CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp
    41 +endif
    42 +#
    43 # Linux/Alpha
    44 #
    45 -ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
    46 +ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST)))
    47 CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp
    48 endif
    49 #
    50 @@ -322,7 +331,7 @@
    51 #
    52 # Linux/PPC
    53 #
    54 -ifeq ($(OS_ARCH)$(OS_TEST),Linuxpowerpc)
    55 +ifneq (,$(filter Linuxpowerpc FreeBSDpowerpc,$(OS_ARCH)$(OS_TEST)))
    56 CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp
    57 ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s
    58 AS := $(CC) -c -x assembler-with-cpp
    59 @@ -400,6 +409,15 @@
    60 ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s
    61 endif
    62 #
    63 +# FreeBSD/SPARC64
    64 +#
    65 +ifeq ($(OS_ARCH),FreeBSD)
    66 +ifneq (,$(findstring sparc,$(OS_TEST)))
    67 +CPPSRCS := xptcinvoke_sparc64_openbsd.cpp xptcstubs_sparc64_openbsd.cpp
    68 +ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
    69 +endif
    70 +endif
    71 +#
    72 # OpenBSD/SPARC
    73 #
    74 ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc)
  • www/libxul/files/patch-xptcall-alpha

     
    1 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp.orig Tue May 27 01:37:25 2003
    2 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp Tue May 27 01:37:00 2003
    3 @@ -0,0 +1,184 @@
    4 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    5 +/* ***** BEGIN LICENSE BLOCK *****
    6 + * Version: NPL 1.1/GPL 2.0/LGPL 2.1
    7 + *
    8 + * The contents of this file are subject to the Netscape Public License
    9 + * Version 1.1 (the "License"); you may not use this file except in
    10 + * compliance with the License. You may obtain a copy of the License at
    11 + * http://www.mozilla.org/NPL/
    12 + *
    13 + * Software distributed under the License is distributed on an "AS IS" basis,
    14 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    15 + * for the specific language governing rights and limitations under the
    16 + * License.
    17 + *
    18 + * The Original Code is mozilla.org code.
    19 + *
    20 + * The Initial Developer of the Original Code is
    21 + * Netscape Communications Corporation.
    22 + * Portions created by the Initial Developer are Copyright (C) 1998
    23 + * the Initial Developer. All Rights Reserved.
    24 + *
    25 + * Contributor(s):
    26 + *
    27 + * Alternatively, the contents of this file may be used under the terms of
    28 + * either the GNU General Public License Version 2 or later (the "GPL"), or
    29 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    30 + * in which case the provisions of the GPL or the LGPL are applicable instead
    31 + * of those above. If you wish to allow use of your version of this file only
    32 + * under the terms of either the GPL or the LGPL, and not to allow others to
    33 + * use your version of this file under the terms of the NPL, indicate your
    34 + * decision by deleting the provisions above and replace them with the notice
    35 + * and other provisions required by the GPL or the LGPL. If you do not delete
    36 + * the provisions above, a recipient may use your version of this file under
    37 + * the terms of any one of the NPL, the GPL or the LGPL.
    38 + *
    39 + * ***** END LICENSE BLOCK ***** */
    40 +
    41 +/* Platform specific code to invoke XPCOM methods on native objects */
    42 +
    43 +/* contributed by Glen Nakamura <glen.nakamura@usa.net> */
    44 +
    45 +#include "xptcprivate.h"
    46 +
    47 +/* Prototype specifies unmangled function name and disables unused warning */
    48 +static void
    49 +invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s)
    50 +__asm__("invoke_copy_to_stack") __attribute__((unused));
    51 +
    52 +static void
    53 +invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s)
    54 +{
    55 + const PRUint8 NUM_ARG_REGS = 6-1; // -1 for "this" pointer
    56 +
    57 + for(PRUint32 i = 0; i < paramCount; i++, d++, s++)
    58 + {
    59 + if(s->IsPtrData())
    60 + {
    61 + *d = (PRUint64)s->ptr;
    62 + continue;
    63 + }
    64 + switch(s->type)
    65 + {
    66 + case nsXPTType::T_I8 : *d = (PRUint64)s->val.i8; break;
    67 + case nsXPTType::T_I16 : *d = (PRUint64)s->val.i16; break;
    68 + case nsXPTType::T_I32 : *d = (PRUint64)s->val.i32; break;
    69 + case nsXPTType::T_I64 : *d = (PRUint64)s->val.i64; break;
    70 + case nsXPTType::T_U8 : *d = (PRUint64)s->val.u8; break;
    71 + case nsXPTType::T_U16 : *d = (PRUint64)s->val.u16; break;
    72 + case nsXPTType::T_U32 : *d = (PRUint64)s->val.u32; break;
    73 + case nsXPTType::T_U64 : *d = (PRUint64)s->val.u64; break;
    74 + case nsXPTType::T_FLOAT :
    75 + if(i < NUM_ARG_REGS)
    76 + {
    77 + // convert floats to doubles if they are to be passed
    78 + // via registers so we can just deal with doubles later
    79 + union { PRUint64 u64; double d; } t;
    80 + t.d = (double)s->val.f;
    81 + *d = t.u64;
    82 + }
    83 + else
    84 + // otherwise copy to stack normally
    85 + *d = (PRUint64)s->val.u32;
    86 + break;
    87 + case nsXPTType::T_DOUBLE : *d = (PRUint64)s->val.u64; break;
    88 + case nsXPTType::T_BOOL : *d = (PRUint64)s->val.b; break;
    89 + case nsXPTType::T_CHAR : *d = (PRUint64)s->val.c; break;
    90 + case nsXPTType::T_WCHAR : *d = (PRUint64)s->val.wc; break;
    91 + default:
    92 + // all the others are plain pointer types
    93 + *d = (PRUint64)s->val.p;
    94 + break;
    95 + }
    96 + }
    97 +}
    98 +
    99 +/*
    100 + * XPTC_PUBLIC_API(nsresult)
    101 + * XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
    102 + * PRUint32 paramCount, nsXPTCVariant* params, void* vt)
    103 + */
    104 +__asm__(
    105 + "#### XPTC_InvokeByIndex ####\n"
    106 +".text\n\t"
    107 + ".align 5\n\t"
    108 + ".globl XPTC_InvokeByIndex\n\t"
    109 + ".ent XPTC_InvokeByIndex\n"
    110 +"XPTC_InvokeByIndex:\n\t"
    111 + ".frame $15,32,$26,0\n\t"
    112 + ".mask 0x4008000,-32\n\t"
    113 + "ldgp $29,0($27)\n"
    114 +"$XPTC_InvokeByIndex..ng:\n\t"
    115 + "subq $30,32,$30\n\t"
    116 + "stq $26,0($30)\n\t"
    117 + "stq $15,8($30)\n\t"
    118 + "bis $30,$30,$15\n\t"
    119 + ".prologue 1\n\t"
    120 +
    121 + /*
    122 + * Allocate enough stack space to hold the greater of 6 or "paramCount"+1
    123 + * parameters. (+1 for "this" pointer) Room for at least 6 parameters
    124 + * is required for storage of those passed via registers.
    125 + */
    126 +
    127 + "bis $31,5,$2\n\t" /* count = MAX(5, "paramCount") */
    128 + "cmplt $2,$18,$1\n\t"
    129 + "cmovne $1,$18,$2\n\t"
    130 + "s8addq $2,16,$1\n\t" /* room for count+1 params (8 bytes each) */
    131 + "bic $1,15,$1\n\t" /* stack space is rounded up to 0 % 16 */
    132 + "subq $30,$1,$30\n\t"
    133 +
    134 + "stq $16,0($30)\n\t" /* save "that" (as "this" pointer) */
    135 + "stq $17,16($15)\n\t" /* save "methodIndex" */
    136 +
    137 + "addq $30,8,$16\n\t" /* pass stack pointer */
    138 + "bis $18,$18,$17\n\t" /* pass "paramCount" */
    139 + "bis $19,$19,$18\n\t" /* pass "params" */
    140 + "bsr $26,$invoke_copy_to_stack..ng\n\t" /* call invoke_copy_to_stack */
    141 +
    142 + /*
    143 + * Copy the first 6 parameters to registers and remove from stack frame.
    144 + * Both the integer and floating point registers are set for each parameter
    145 + * except the first which is the "this" pointer. (integer only)
    146 + * The floating point registers are all set as doubles since the
    147 + * invoke_copy_to_stack function should have converted the floats.
    148 + */
    149 + "ldq $16,0($30)\n\t" /* integer registers */
    150 + "ldq $17,8($30)\n\t"
    151 + "ldq $18,16($30)\n\t"
    152 + "ldq $19,24($30)\n\t"
    153 + "ldq $20,32($30)\n\t"
    154 + "ldq $21,40($30)\n\t"
    155 + "ldt $f17,8($30)\n\t" /* floating point registers */
    156 + "ldt $f18,16($30)\n\t"
    157 + "ldt $f19,24($30)\n\t"
    158 + "ldt $f20,32($30)\n\t"
    159 + "ldt $f21,40($30)\n\t"
    160 +
    161 + "addq $30,48,$30\n\t" /* remove params from stack */
    162 +
    163 + /*
    164 + * Call the virtual function with the constructed stack frame.
    165 + */
    166 + "bis $16,$16,$1\n\t" /* load "this" */
    167 + "ldq $2,16($15)\n\t" /* load "methodIndex" */
    168 + "ldq $1,0($1)\n\t" /* load vtable */
    169 +#if 0
    170 + "s8addq $2,16,$2\n\t" /* vtable index = "methodIndex" * 8 + 16 */
    171 +#else
    172 + "mulq $2, 8, $2\n\t"
    173 + "addq $2, 0, $2\n\t" /* vtable index = "methodIndex" * 16 + 24 */
    174 +#endif
    175 + "addq $1,$2,$1\n\t"
    176 + "ldq $27,0($1)\n\t" /* load address of function */
    177 + "jsr $26,($27),0\n\t" /* call virtual function */
    178 + "ldgp $29,0($26)\n\t"
    179 +
    180 + "bis $15,$15,$30\n\t"
    181 + "ldq $26,0($30)\n\t"
    182 + "ldq $15,8($30)\n\t"
    183 + "addq $30,32,$30\n\t"
    184 + "ret $31,($26),1\n\t"
    185 + ".end XPTC_InvokeByIndex"
    186 + );
    187 +
    188 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_freebsd_alpha.cpp.orig Tue May 27 01:37:30 2003
    189 +++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_freebsd_alpha.cpp Tue May 27 01:37:04 2003
    190 @@ -0,0 +1,269 @@
    191 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    192 +/* ***** BEGIN LICENSE BLOCK *****
    193 + * Version: NPL 1.1/GPL 2.0/LGPL 2.1
    194 + *
    195 + * The contents of this file are subject to the Netscape Public License
    196 + * Version 1.1 (the "License"); you may not use this file except in
    197 + * compliance with the License. You may obtain a copy of the License at
    198 + * http://www.mozilla.org/NPL/
    199 + *
    200 + * Software distributed under the License is distributed on an "AS IS" basis,
    201 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    202 + * for the specific language governing rights and limitations under the
    203 + * License.
    204 + *
    205 + * The Original Code is mozilla.org code.
    206 + *
    207 + * The Initial Developer of the Original Code is
    208 + * Netscape Communications Corporation.
    209 + * Portions created by the Initial Developer are Copyright (C) 1999
    210 + * the Initial Developer. All Rights Reserved.
    211 + *
    212 + * Contributor(s):
    213 + *
    214 + * Alternatively, the contents of this file may be used under the terms of
    215 + * either the GNU General Public License Version 2 or later (the "GPL"), or
    216 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    217 + * in which case the provisions of the GPL or the LGPL are applicable instead
    218 + * of those above. If you wish to allow use of your version of this file only
    219 + * under the terms of either the GPL or the LGPL, and not to allow others to
    220 + * use your version of this file under the terms of the NPL, indicate your
    221 + * decision by deleting the provisions above and replace them with the notice
    222 + * and other provisions required by the GPL or the LGPL. If you do not delete
    223 + * the provisions above, a recipient may use your version of this file under
    224 + * the terms of any one of the NPL, the GPL or the LGPL.
    225 + *
    226 + * ***** END LICENSE BLOCK ***** */
    227 +
    228 +/* Implement shared vtbl methods. */
    229 +
    230 +/* contributed by Glen Nakamura <glen.nakamura@usa.net> */
    231 +
    232 +#include <sys/types.h>
    233 +#include <machine/cpu.h>
    234 +#include "xptcprivate.h"
    235 +
    236 +/* Prototype specifies unmangled function name and disables unused warning */
    237 +static nsresult
    238 +PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args)
    239 +__asm__("PrepareAndDispatch") __attribute__((unused));
    240 +
    241 +static nsresult
    242 +PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args)
    243 +{
    244 + const PRUint8 PARAM_BUFFER_COUNT = 16;
    245 + const PRUint8 NUM_ARG_REGS = 6-1; // -1 for "this" pointer
    246 +
    247 + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
    248 + nsXPTCMiniVariant* dispatchParams = NULL;
    249 + nsIInterfaceInfo* iface_info = NULL;
    250 + const nsXPTMethodInfo* info;
    251 + PRUint8 paramCount;
    252 + PRUint8 i;
    253 + nsresult result = NS_ERROR_FAILURE;
    254 +
    255 + NS_ASSERTION(self,"no self");
    256 +
    257 + self->GetInterfaceInfo(&iface_info);
    258 + NS_ASSERTION(iface_info,"no interface info");
    259 +
    260 + iface_info->GetMethodInfo(PRUint16(methodIndex), &info);
    261 + NS_ASSERTION(info,"no interface info");
    262 +
    263 + paramCount = info->GetParamCount();
    264 +
    265 + // setup variant array pointer
    266 + if(paramCount > PARAM_BUFFER_COUNT)
    267 + dispatchParams = new nsXPTCMiniVariant[paramCount];
    268 + else
    269 + dispatchParams = paramBuffer;
    270 + NS_ASSERTION(dispatchParams,"no place for params");
    271 +
    272 + // args[0] to args[NUM_ARG_REGS] hold floating point register values
    273 + PRUint64* ap = args + NUM_ARG_REGS;
    274 + for(i = 0; i < paramCount; i++, ap++)
    275 + {
    276 + const nsXPTParamInfo& param = info->GetParam(i);
    277 + const nsXPTType& type = param.GetType();
    278 + nsXPTCMiniVariant* dp = &dispatchParams[i];
    279 +
    280 + if(param.IsOut() || !type.IsArithmetic())
    281 + {
    282 + dp->val.p = (void*) *ap;
    283 + continue;
    284 + }
    285 + // else
    286 + switch(type)
    287 + {
    288 + case nsXPTType::T_I8 : dp->val.i8 = (PRInt8) *ap; break;
    289 + case nsXPTType::T_I16 : dp->val.i16 = (PRInt16) *ap; break;
    290 + case nsXPTType::T_I32 : dp->val.i32 = (PRInt32) *ap; break;
    291 + case nsXPTType::T_I64 : dp->val.i64 = (PRInt64) *ap; break;
    292 + case nsXPTType::T_U8 : dp->val.u8 = (PRUint8) *ap; break;
    293 + case nsXPTType::T_U16 : dp->val.u16 = (PRUint16) *ap; break;
    294 + case nsXPTType::T_U32 : dp->val.u32 = (PRUint32) *ap; break;
    295 + case nsXPTType::T_U64 : dp->val.u64 = (PRUint64) *ap; break;
    296 + case nsXPTType::T_FLOAT :
    297 + if(i < NUM_ARG_REGS)
    298 + {
    299 + // floats passed via registers are stored as doubles
    300 + // in the first NUM_ARG_REGS entries in args
    301 + dp->val.u64 = (PRUint64) args[i];
    302 + dp->val.f = (float) dp->val.d; // convert double to float
    303 + }
    304 + else
    305 + dp->val.u32 = (PRUint32) *ap;
    306 + break;
    307 + case nsXPTType::T_DOUBLE :
    308 + // doubles passed via registers are also stored
    309 + // in the first NUM_ARG_REGS entries in args
    310 + dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap;
    311 + break;
    312 + case nsXPTType::T_BOOL : dp->val.b = (PRBool) *ap; break;
    313 + case nsXPTType::T_CHAR : dp->val.c = (char) *ap; break;
    314 + case nsXPTType::T_WCHAR : dp->val.wc = (PRUnichar) *ap; break;
    315 + default:
    316 + NS_ASSERTION(0, "bad type");
    317 + break;
    318 + }
    319 + }
    320 +
    321 + result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
    322 +
    323 + NS_RELEASE(iface_info);
    324 +
    325 + if(dispatchParams != paramBuffer)
    326 + delete [] dispatchParams;
    327 +
    328 + return result;
    329 +}
    330 +
    331 +/*
    332 + * SharedStub()
    333 + * Collects arguments and calls PrepareAndDispatch. The "methodIndex" is
    334 + * passed to this function via $1 to preserve the argument registers.
    335 + */
    336 +__asm__(
    337 + "#### SharedStub ####\n"
    338 +".text\n\t"
    339 + ".align 5\n\t"
    340 + ".ent SharedStub\n"
    341 +"SharedStub:\n\t"
    342 + ".frame $30,96,$26,0\n\t"
    343 + ".mask 0x4000000,-96\n\t"
    344 + "ldgp $29,0($27)\n"
    345 +"$SharedStub..ng:\n\t"
    346 + "subq $30,96,$30\n\t"
    347 + "stq $26,0($30)\n\t"
    348 + ".prologue 1\n\t"
    349 +
    350 + /*
    351 + * Store arguments passed via registers to the stack.
    352 + * Floating point registers are stored as doubles and converted
    353 + * to floats in PrepareAndDispatch if necessary.
    354 + */
    355 + "stt $f17,16($30)\n\t" /* floating point registers */
    356 + "stt $f18,24($30)\n\t"
    357 + "stt $f19,32($30)\n\t"
    358 + "stt $f20,40($30)\n\t"
    359 + "stt $f21,48($30)\n\t"
    360 + "stq $17,56($30)\n\t" /* integer registers */
    361 + "stq $18,64($30)\n\t"
    362 + "stq $19,72($30)\n\t"
    363 + "stq $20,80($30)\n\t"
    364 + "stq $21,88($30)\n\t"
    365 +
    366 + /*
    367 + * Call PrepareAndDispatch function.
    368 + */
    369 + "bis $1,$1,$17\n\t" /* pass "methodIndex" */
    370 + "addq $30,16,$18\n\t" /* pass "args" */
    371 + "bsr $26,$PrepareAndDispatch..ng\n\t"
    372 +
    373 + "ldq $26,0($30)\n\t"
    374 + "addq $30,96,$30\n\t"
    375 + "ret $31,($26),1\n\t"
    376 + ".end SharedStub"
    377 + );
    378 +
    379 +#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
    380 +/*
    381 + * nsresult nsXPTCStubBase::Stub##n()
    382 + * Sets register $1 to "methodIndex" and jumps to SharedStub.
    383 + */
    384 +#define STUB_ENTRY(n) \
    385 +__asm__( \
    386 + "#### Stub"#n" ####\n" \
    387 +".text\n\t" \
    388 + ".align 5\n\t" \
    389 + ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev\n\t" \
    390 + ".ent _ZN14nsXPTCStubBase5Stub"#n"Ev\n" \
    391 +"_ZN14nsXPTCStubBase5Stub"#n"Ev:\n\t" \
    392 + ".frame $30,0,$26,0\n\t" \
    393 + "ldgp $29,0($27)\n" \
    394 +"$_ZN14nsXPTCStubBase5Stub"#n"Ev..ng:\n\t" \
    395 + ".prologue 1\n\t" \
    396 + "lda $1,"#n"\n\t" \
    397 + "br $31,$SharedStub..ng\n\t" \
    398 + ".end _ZN14nsXPTCStubBase5Stub"#n"Ev" \
    399 + ); \
    400 +__asm__( \
    401 + "#### Stub"#n" ####\n" \
    402 +".text\n\t" \
    403 + ".align 5\n\t" \
    404 + ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev\n\t" \
    405 + ".ent _ZN14nsXPTCStubBase6Stub"#n"Ev\n" \
    406 +"_ZN14nsXPTCStubBase6Stub"#n"Ev:\n\t" \
    407 + ".frame $30,0,$26,0\n\t" \
    408 + "ldgp $29,0($27)\n" \
    409 +"$_ZN14nsXPTCStubBase6Stub"#n"Ev..ng:\n\t" \
    410 + ".prologue 1\n\t" \
    411 + "lda $1,"#n"\n\t" \
    412 + "br $31,$SharedStub..ng\n\t" \
    413 + ".end _ZN14nsXPTCStubBase6Stub"#n"Ev" \
    414 + ); \
    415 +__asm__( \
    416 + "#### Stub"#n" ####\n" \
    417 +".text\n\t" \
    418 + ".align 5\n\t" \
    419 + ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev\n\t" \
    420 + ".ent _ZN14nsXPTCStubBase7Stub"#n"Ev\n" \
    421 +"_ZN14nsXPTCStubBase7Stub"#n"Ev:\n\t" \
    422 + ".frame $30,0,$26,0\n\t" \
    423 + "ldgp $29,0($27)\n" \
    424 +"$_ZN14nsXPTCStubBase7Stub"#n"Ev..ng:\n\t" \
    425 + ".prologue 1\n\t" \
    426 + "lda $1,"#n"\n\t" \
    427 + "br $31,$SharedStub..ng\n\t" \
    428 + ".end _ZN14nsXPTCStubBase7Stub"#n"Ev" \
    429 + );
    430 +#else
    431 +/*
    432 + * nsresult nsXPTCStubBase::Stub##n()
    433 + * Sets register $1 to "methodIndex" and jumps to SharedStub.
    434 + */
    435 +#define STUB_ENTRY(n) \
    436 +nsresult nsXPTCStubBase::Stub##n() \
    437 +{ \
    438 + nsresult result; \
    439 +__asm__ __volatile__( \
    440 + "ldah $29,0($27)\n\t" \
    441 + "lda $29,0($29)\n\t" \
    442 + "lda $1, "#n"\n\t" \
    443 + "br $31, $SharedStub..ng\n\t" \
    444 + "mov $0, %0\n\t" \
    445 + : "=r" (result) \
    446 + ); \
    447 + return result; \
    448 +}
    449 +#endif
    450 +
    451 +#define SENTINEL_ENTRY(n) \
    452 +nsresult nsXPTCStubBase::Sentinel##n() \
    453 +{ \
    454 + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
    455 + return NS_ERROR_NOT_IMPLEMENTED; \
    456 +}
    457 +
    458 +#include "xptcstubsdef.inc"
    459 +
  • www/libxul/files/patch-xptcall-amd64

     
    1 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_freebsd.cpp.orig 2009-10-02 22:13:13.000000000 +0200
    2 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_freebsd.cpp 2009-10-02 22:41:36.000000000 +0200
    3 @@ -0,0 +1,174 @@
    4 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    5 +// Platform specific code to invoke XPCOM methods on native objects
    6 +
    7 +#include "xptcprivate.h"
    8 +
    9 +// 6 integral parameters are passed in registers
    10 +const PRUint32 GPR_COUNT = 6;
    11 +
    12 +// 8 floating point parameters are passed in SSE registers
    13 +const PRUint32 FPR_COUNT = 8;
    14 +
    15 +// Remember that these 'words' are 64-bit long
    16 +static inline void
    17 +invoke_count_words(PRUint32 paramCount, nsXPTCVariant * s,
    18 + PRUint32 & nr_gpr, PRUint32 & nr_fpr, PRUint32 & nr_stack)
    19 +{
    20 + nr_gpr = 1; // skip one GP register for 'that'
    21 + nr_fpr = 0;
    22 + nr_stack = 0;
    23 +
    24 + /* Compute number of eightbytes of class MEMORY. */
    25 + for (uint32 i = 0; i < paramCount; i++, s++) {
    26 + if (!s->IsPtrData()
    27 + && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
    28 + if (nr_fpr < FPR_COUNT)
    29 + nr_fpr++;
    30 + else
    31 + nr_stack++;
    32 + }
    33 + else {
    34 + if (nr_gpr < GPR_COUNT)
    35 + nr_gpr++;
    36 + else
    37 + nr_stack++;
    38 + }
    39 + }
    40 +}
    41 +
    42 +static void
    43 +invoke_copy_to_stack(PRUint64 * d, PRUint32 paramCount, nsXPTCVariant * s,
    44 + PRUint64 * gpregs, double * fpregs)
    45 +{
    46 + PRUint32 nr_gpr = 1; // skip one GP register for 'that'
    47 + PRUint32 nr_fpr = 0;
    48 + PRUint64 value;
    49 +
    50 + for (uint32 i = 0; i < paramCount; i++, s++) {
    51 + if (s->IsPtrData())
    52 + value = (PRUint64) s->ptr;
    53 + else {
    54 + switch (s->type) {
    55 + case nsXPTType::T_FLOAT: break;
    56 + case nsXPTType::T_DOUBLE: break;
    57 + case nsXPTType::T_I8: value = s->val.i8; break;
    58 + case nsXPTType::T_I16: value = s->val.i16; break;
    59 + case nsXPTType::T_I32: value = s->val.i32; break;
    60 + case nsXPTType::T_I64: value = s->val.i64; break;
    61 + case nsXPTType::T_U8: value = s->val.u8; break;
    62 + case nsXPTType::T_U16: value = s->val.u16; break;
    63 + case nsXPTType::T_U32: value = s->val.u32; break;
    64 + case nsXPTType::T_U64: value = s->val.u64; break;
    65 + case nsXPTType::T_BOOL: value = s->val.b; break;
    66 + case nsXPTType::T_CHAR: value = s->val.c; break;
    67 + case nsXPTType::T_WCHAR: value = s->val.wc; break;
    68 + default: value = (PRUint64) s->val.p; break;
    69 + }
    70 + }
    71 +
    72 + if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
    73 + if (nr_fpr < FPR_COUNT)
    74 + fpregs[nr_fpr++] = s->val.d;
    75 + else {
    76 + *((double *)d) = s->val.d;
    77 + d++;
    78 + }
    79 + }
    80 + else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
    81 + if (nr_fpr < FPR_COUNT)
    82 + // The value in %xmm register is already prepared to
    83 + // be retrieved as a float. Therefore, we pass the
    84 + // value verbatim, as a double without conversion.
    85 + fpregs[nr_fpr++] = s->val.d;
    86 + else {
    87 + *((float *)d) = s->val.f;
    88 + d++;
    89 + }
    90 + }
    91 + else {
    92 + if (nr_gpr < GPR_COUNT)
    93 + gpregs[nr_gpr++] = value;
    94 + else
    95 + *d++ = value;
    96 + }
    97 + }
    98 +}
    99 +
    100 +extern "C"
    101 +EXPORT_XPCOM_API(nsresult)
    102 +NS_InvokeByIndex_P(nsISupports * that, PRUint32 methodIndex,
    103 + PRUint32 paramCount, nsXPTCVariant * params)
    104 +{
    105 + PRUint32 nr_gpr, nr_fpr, nr_stack;
    106 + invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
    107 +
    108 + // Stack, if used, must be 16-bytes aligned
    109 + if (nr_stack)
    110 + nr_stack = (nr_stack + 1) & ~1;
    111 +
    112 + // Load parameters to stack, if necessary
    113 + PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8);
    114 + PRUint64 gpregs[GPR_COUNT];
    115 + double fpregs[FPR_COUNT];
    116 + invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
    117 +
    118 + // Load FPR registers from fpregs[]
    119 + register double d0 asm("xmm0");
    120 + register double d1 asm("xmm1");
    121 + register double d2 asm("xmm2");
    122 + register double d3 asm("xmm3");
    123 + register double d4 asm("xmm4");
    124 + register double d5 asm("xmm5");
    125 + register double d6 asm("xmm6");
    126 + register double d7 asm("xmm7");
    127 +
    128 + switch (nr_fpr) {
    129 +#define ARG_FPR(N) \
    130 + case N+1: d##N = fpregs[N];
    131 + ARG_FPR(7);
    132 + ARG_FPR(6);
    133 + ARG_FPR(5);
    134 + ARG_FPR(4);
    135 + ARG_FPR(3);
    136 + ARG_FPR(2);
    137 + ARG_FPR(1);
    138 + ARG_FPR(0);
    139 + case 0:;
    140 +#undef ARG_FPR
    141 + }
    142 +
    143 + // Load GPR registers from gpregs[]
    144 + register PRUint64 a0 asm("rdi");
    145 + register PRUint64 a1 asm("rsi");
    146 + register PRUint64 a2 asm("rdx");
    147 + register PRUint64 a3 asm("rcx");
    148 + register PRUint64 a4 asm("r8");
    149 + register PRUint64 a5 asm("r9");
    150 +
    151 + switch (nr_gpr) {
    152 +#define ARG_GPR(N) \
    153 + case N+1: a##N = gpregs[N];
    154 + ARG_GPR(5);
    155 + ARG_GPR(4);
    156 + ARG_GPR(3);
    157 + ARG_GPR(2);
    158 + ARG_GPR(1);
    159 + case 1: a0 = (PRUint64) that;
    160 + case 0:;
    161 +#undef ARG_GPR
    162 + }
    163 +
    164 + // Ensure that assignments to SSE registers won't be optimized away
    165 + asm("" ::
    166 + "x" (d0), "x" (d1), "x" (d2), "x" (d3),
    167 + "x" (d4), "x" (d5), "x" (d6), "x" (d7));
    168 +
    169 + // Get pointer to method
    170 + PRUint64 methodAddress = *((PRUint64 *)that);
    171 + methodAddress += 8 * methodIndex;
    172 + methodAddress = *((PRUint64 *)methodAddress);
    173 +
    174 + typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64);
    175 + PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5);
    176 + return result;
    177 +}
    178 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_freebsd.cpp.orig 2009-10-02 22:13:13.000000000 +0200
    179 +++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_freebsd.cpp 2009-10-02 22:39:37.000000000 +0200
    180 @@ -0,0 +1,200 @@
    181 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    182 +
    183 +// Implement shared vtbl methods.
    184 +
    185 +#include "xptcprivate.h"
    186 +#include "xptiprivate.h"
    187 +
    188 +// The Linux/x86-64 ABI passes the first 6 integral parameters and the
    189 +// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx,
    190 +// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the
    191 +// caller. The rest of the parameters are passed in the callers stack
    192 +// area.
    193 +
    194 +const PRUint32 PARAM_BUFFER_COUNT = 16;
    195 +const PRUint32 GPR_COUNT = 6;
    196 +const PRUint32 FPR_COUNT = 8;
    197 +
    198 +// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
    199 +//
    200 +// - 'args[]' contains the arguments passed on stack
    201 +// - 'gpregs[]' contains the arguments passed in integer registers
    202 +// - 'fpregs[]' contains the arguments passed in floating point registers
    203 +//
    204 +// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
    205 +// and then the method gets called.
    206 +
    207 +extern "C" nsresult
    208 +PrepareAndDispatch(nsXPTCStubBase * self, PRUint32 methodIndex,
    209 + PRUint64 * args, PRUint64 * gpregs, double *fpregs)
    210 +{
    211 + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
    212 + nsXPTCMiniVariant* dispatchParams = NULL;
    213 + const nsXPTMethodInfo* info;
    214 + PRUint32 paramCount;
    215 + PRUint32 i;
    216 + nsresult result = NS_ERROR_FAILURE;
    217 +
    218 + NS_ASSERTION(self,"no self");
    219 +
    220 + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
    221 + NS_ASSERTION(info,"no method info");
    222 + if (! info)
    223 + return NS_ERROR_UNEXPECTED;
    224 +
    225 + paramCount = info->GetParamCount();
    226 +
    227 + // setup variant array pointer
    228 + if(paramCount > PARAM_BUFFER_COUNT)
    229 + dispatchParams = new nsXPTCMiniVariant[paramCount];
    230 + else
    231 + dispatchParams = paramBuffer;
    232 +
    233 + NS_ASSERTION(dispatchParams,"no place for params");
    234 + if (! dispatchParams)
    235 + return NS_ERROR_OUT_OF_MEMORY;
    236 +
    237 + PRUint64* ap = args;
    238 + PRUint32 nr_gpr = 1; // skip one GPR register for 'that'
    239 + PRUint32 nr_fpr = 0;
    240 + PRUint64 value;
    241 +
    242 + for(i = 0; i < paramCount; i++) {
    243 + const nsXPTParamInfo& param = info->GetParam(i);
    244 + const nsXPTType& type = param.GetType();
    245 + nsXPTCMiniVariant* dp = &dispatchParams[i];
    246 +
    247 + if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
    248 + if (nr_fpr < FPR_COUNT)
    249 + dp->val.d = fpregs[nr_fpr++];
    250 + else
    251 + dp->val.d = *(double*) ap++;
    252 + continue;
    253 + }
    254 + else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
    255 + if (nr_fpr < FPR_COUNT)
    256 + // The value in %xmm register is already prepared to
    257 + // be retrieved as a float. Therefore, we pass the
    258 + // value verbatim, as a double without conversion.
    259 + dp->val.d = *(double*) ap++;
    260 + else
    261 + dp->val.f = *(float*) ap++;
    262 + continue;
    263 + }
    264 + else {
    265 + if (nr_gpr < GPR_COUNT)
    266 + value = gpregs[nr_gpr++];
    267 + else
    268 + value = *ap++;
    269 + }
    270 +
    271 + if (param.IsOut() || !type.IsArithmetic()) {
    272 + dp->val.p = (void*) value;
    273 + continue;
    274 + }
    275 +
    276 + switch (type) {
    277 + case nsXPTType::T_I8: dp->val.i8 = (PRInt8) value; break;
    278 + case nsXPTType::T_I16: dp->val.i16 = (PRInt16) value; break;
    279 + case nsXPTType::T_I32: dp->val.i32 = (PRInt32) value; break;
    280 + case nsXPTType::T_I64: dp->val.i64 = (PRInt64) value; break;
    281 + case nsXPTType::T_U8: dp->val.u8 = (PRUint8) value; break;
    282 + case nsXPTType::T_U16: dp->val.u16 = (PRUint16) value; break;
    283 + case nsXPTType::T_U32: dp->val.u32 = (PRUint32) value; break;
    284 + case nsXPTType::T_U64: dp->val.u64 = (PRUint64) value; break;
    285 + case nsXPTType::T_BOOL: dp->val.b = (PRBool) value; break;
    286 + case nsXPTType::T_CHAR: dp->val.c = (char) value; break;
    287 + case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) value; break;
    288 +
    289 + default:
    290 + NS_ASSERTION(0, "bad type");
    291 + break;
    292 + }
    293 + }
    294 +
    295 + result = self->mOuter->CallMethod((PRUint16)methodIndex, info,
    296 + dispatchParams);
    297 +
    298 + if (dispatchParams != paramBuffer)
    299 + delete [] dispatchParams;
    300 +
    301 + return result;
    302 +}
    303 +
    304 +#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
    305 +// Linux/x86-64 uses gcc >= 3.1
    306 +#define STUB_ENTRY(n) \
    307 +asm(".section \".text\"\n\t" \
    308 + ".align 2\n\t" \
    309 + ".if " #n " < 10\n\t" \
    310 + ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
    311 + ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
    312 + "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
    313 + ".elseif " #n " < 100\n\t" \
    314 + ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
    315 + ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
    316 + "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
    317 + ".elseif " #n " < 1000\n\t" \
    318 + ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
    319 + ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
    320 + "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
    321 + ".else\n\t" \
    322 + ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \
    323 + ".endif\n\t" \
    324 + "movl $" #n ", %eax\n\t" \
    325 + "jmp SharedStub\n\t" \
    326 + ".if " #n " < 10\n\t" \
    327 + ".size _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
    328 + ".elseif " #n " < 100\n\t" \
    329 + ".size _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
    330 + ".else\n\t" \
    331 + ".size _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
    332 + ".endif");
    333 +
    334 +// static nsresult SharedStub(PRUint32 methodIndex)
    335 +asm(".section \".text\"\n\t"
    336 + ".align 2\n\t"
    337 + ".type SharedStub,@function\n\t"
    338 + "SharedStub:\n\t"
    339 + // make room for gpregs (48), fpregs (64)
    340 + "pushq %rbp\n\t"
    341 + "movq %rsp,%rbp\n\t"
    342 + "subq $112,%rsp\n\t"
    343 + // save GP registers
    344 + "movq %rdi,-112(%rbp)\n\t"
    345 + "movq %rsi,-104(%rbp)\n\t"
    346 + "movq %rdx, -96(%rbp)\n\t"
    347 + "movq %rcx, -88(%rbp)\n\t"
    348 + "movq %r8 , -80(%rbp)\n\t"
    349 + "movq %r9 , -72(%rbp)\n\t"
    350 + "leaq -112(%rbp),%rcx\n\t"
    351 + // save FP registers
    352 + "movsd %xmm0,-64(%rbp)\n\t"
    353 + "movsd %xmm1,-56(%rbp)\n\t"
    354 + "movsd %xmm2,-48(%rbp)\n\t"
    355 + "movsd %xmm3,-40(%rbp)\n\t"
    356 + "movsd %xmm4,-32(%rbp)\n\t"
    357 + "movsd %xmm5,-24(%rbp)\n\t"
    358 + "movsd %xmm6,-16(%rbp)\n\t"
    359 + "movsd %xmm7, -8(%rbp)\n\t"
    360 + "leaq -64(%rbp),%r8\n\t"
    361 + // rdi has the 'self' pointer already
    362 + "movl %eax,%esi\n\t"
    363 + "leaq 16(%rbp),%rdx\n\t"
    364 + "call PrepareAndDispatch\n\t"
    365 + "leave\n\t"
    366 + "ret\n\t"
    367 + ".size SharedStub,.-SharedStub");
    368 +
    369 +#define SENTINEL_ENTRY(n) \
    370 +nsresult nsXPTCStubBase::Sentinel##n() \
    371 +{ \
    372 + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
    373 + return NS_ERROR_NOT_IMPLEMENTED; \
    374 +}
    375 +
    376 +#include "xptcstubsdef.inc"
    377 +
    378 +#else
    379 +#error "can't find a compiler to use"
    380 +#endif /* __GNUC__ */
  • www/libxul/files/patch-xptcall-powerpc

     
    1 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_freebsd.s.orig 2009-09-26 22:23:56.000000000 +0200
    2 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_freebsd.s 2009-09-27 10:01:48.000000000 +0200
    3 @@ -0,0 +1,110 @@
    4 +# -*- Mode: Asm -*-
    5 +#
    6 +# The contents of this file are subject to the Netscape Public
    7 +# License Version 1.1 (the "License"); you may not use this file
    8 +# except in compliance with the License. You may obtain a copy of
    9 +# the License at http://www.mozilla.org/NPL/
    10 +#
    11 +# Software distributed under the License is distributed on an "AS
    12 +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    13 +# implied. See the License for the specific language governing
    14 +# rights and limitations under the License.
    15 +#
    16 +# The Original Code is mozilla.org code.
    17 +#
    18 +# The Initial Developer of the Original Code is Netscape
    19 +# Communications Corporation. Portions created by Netscape are
    20 +# Copyright (C) 1999 Netscape Communications Corporation. All
    21 +# Rights Reserved.
    22 +#
    23 +# Contributor(s):
    24 +# Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
    25 +# beard@netscape.com (Patrick Beard)
    26 +# waterson@netscape.com (Chris Waterson)
    27 +#
    28 +.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
    29 +.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
    30 +.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
    31 +.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
    32 +.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
    33 +.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
    34 +.set r30,30; .set r31,31
    35 +.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
    36 +.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
    37 +.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
    38 +.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
    39 +.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
    40 +.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
    41 +.set f30,30; .set f31,31
    42 +
    43 + .section ".text"
    44 + .align 2
    45 + .globl NS_InvokeByIndex_P
    46 + .type NS_InvokeByIndex_P,@function
    47 +
    48 +#
    49 +# NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
    50 +# PRUint32 paramCount, nsXPTCVariant* params)
    51 +#
    52 +
    53 +NS_InvokeByIndex_P:
    54 + stwu sp,-32(sp) # setup standard stack frame
    55 + mflr r0 # save LR
    56 + stw r3,8(sp) # r3 <= that
    57 + stw r4,12(sp) # r4 <= methodIndex
    58 + stw r30,16(sp)
    59 + stw r31,20(sp)
    60 +
    61 + stw r0,36(sp) # store LR backchain
    62 + mr r31,sp
    63 +
    64 + rlwinm r10,r5,3,0,27 # r10 = (ParamCount * 2 * 4) & ~0x0f
    65 + addi r0,r10,96 # reserve stack for GPR and FPR register save area r0 = r10 + 96
    66 + lwz r9,0(sp) # r9 = backchain
    67 + neg r0,r0
    68 + stwux r9,sp,r0 # reserve stack sapce and save SP backchain
    69 +
    70 + addi r3,sp,8 # r3 <= args
    71 + mr r4,r5 # r4 <= paramCount
    72 + mr r5,r6 # r5 <= params
    73 + add r6,r3,r10 # r6 <= gpregs ( == args + r10 )
    74 + mr r30,r6 # store in r30 for use later...
    75 + addi r7,r6,32 # r7 <= fpregs ( == gpregs + 32 )
    76 +
    77 + bl invoke_copy_to_stack@local # (args, paramCount, params, gpregs, fpregs)
    78 +
    79 + lfd f1,32(r30) # load FP registers with method parameters
    80 + lfd f2,40(r30)
    81 + lfd f3,48(r30)
    82 + lfd f4,56(r30)
    83 + lfd f5,64(r30)
    84 + lfd f6,72(r30)
    85 + lfd f7,80(r30)
    86 + lfd f8,88(r30)
    87 +
    88 + lwz r3,8(r31) # r3 <= that
    89 + lwz r4,12(r31) # r4 <= methodIndex
    90 + lwz r5,0(r3) # r5 <= vtable ( == *that )
    91 +
    92 + slwi r4,r4,2 # convert to offset ( *= 4 )
    93 + lwzx r0,r5,r4 # r0 <= methodpointer ( == vtable + offset )
    94 +
    95 + lwz r4,4(r30) # load GP regs with method parameters
    96 + lwz r5,8(r30)
    97 + lwz r6,12(r30)
    98 + lwz r7,16(r30)
    99 + lwz r8,20(r30)
    100 + lwz r9,24(r30)
    101 + lwz r10,28(r30)
    102 +
    103 + mtlr r0 # copy methodpointer to LR
    104 + blrl # call method
    105 +
    106 + lwz r30,16(r31) # restore r30 & r31
    107 + lwz r31,20(r31)
    108 +
    109 + lwz r11,0(sp) # clean up the stack
    110 + lwz r0,4(r11)
    111 + mtlr r0
    112 + mr sp,r11
    113 + blr
    114 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_freebsd.cpp.orig 2009-09-26 22:23:56.000000000 +0200
    115 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_freebsd.cpp 2009-09-27 09:58:59.000000000 +0200
    116 @@ -0,0 +1,141 @@
    117 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    118 +/* ***** BEGIN LICENSE BLOCK *****
    119 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
    120 + *
    121 + * The contents of this file are subject to the Mozilla Public License Version
    122 + * 1.1 (the "License"); you may not use this file except in compliance with
    123 + * the License. You may obtain a copy of the License at
    124 + * http://www.mozilla.org/MPL/
    125 + *
    126 + * Software distributed under the License is distributed on an "AS IS" basis,
    127 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    128 + * for the specific language governing rights and limitations under the
    129 + * License.
    130 + *
    131 + * The Original Code is mozilla.org code.
    132 + *
    133 + * The Initial Developer of the Original Code is
    134 + * Netscape Communications Corporation.
    135 + * Portions created by the Initial Developer are Copyright (C) 1998
    136 + * the Initial Developer. All Rights Reserved.
    137 + *
    138 + * Contributor(s):
    139 + * Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
    140 + * beard@netscape.com (Patrick Beard)
    141 + * waterson@netscape.com (Chris Waterson)
    142 + *
    143 + * Alternatively, the contents of this file may be used under the terms of
    144 + * either of the GNU General Public License Version 2 or later (the "GPL"),
    145 + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    146 + * in which case the provisions of the GPL or the LGPL are applicable instead
    147 + * of those above. If you wish to allow use of your version of this file only
    148 + * under the terms of either the GPL or the LGPL, and not to allow others to
    149 + * use your version of this file under the terms of the MPL, indicate your
    150 + * decision by deleting the provisions above and replace them with the notice
    151 + * and other provisions required by the GPL or the LGPL. If you do not delete
    152 + * the provisions above, a recipient may use your version of this file under
    153 + * the terms of any one of the MPL, the GPL or the LGPL.
    154 + *
    155 + * ***** END LICENSE BLOCK ***** */
    156 +
    157 +// Platform specific code to invoke XPCOM methods on native objects
    158 +
    159 +// The purpose of NS_InvokeByIndex_P() is to map a platform
    160 +// indepenpent call to the platform ABI. To do that,
    161 +// NS_InvokeByIndex_P() has to determine the method to call via vtable
    162 +// access. The parameters for the method are read from the
    163 +// nsXPTCVariant* and prepared for th native ABI. For the Linux/PPC
    164 +// ABI this means that the first 8 integral and floating point
    165 +// parameters are passed in registers.
    166 +
    167 +#include "xptcprivate.h"
    168 +
    169 +// 8 integral parameters are passed in registers
    170 +#define GPR_COUNT 8
    171 +
    172 +// 8 floating point parameters are passed in registers, floats are
    173 +// promoted to doubles when passed in registers
    174 +#define FPR_COUNT 8
    175 +
    176 +extern "C" PRUint32
    177 +invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
    178 +{
    179 + return PRUint32(((paramCount * 2) + 3) & ~3);
    180 +}
    181 +
    182 +extern "C" void
    183 +invoke_copy_to_stack(PRUint32* d,
    184 + PRUint32 paramCount,
    185 + nsXPTCVariant* s,
    186 + PRUint32* gpregs,
    187 + double* fpregs)
    188 +{
    189 + PRUint32 gpr = 1; // skip one GP reg for 'that'
    190 + PRUint32 fpr = 0;
    191 + PRUint32 tempu32;
    192 + PRUint64 tempu64;
    193 +
    194 + for(uint32 i = 0; i < paramCount; i++, s++) {
    195 + if(s->IsPtrData())
    196 + tempu32 = (PRUint32) s->ptr;
    197 + else {
    198 + switch(s->type) {
    199 + case nsXPTType::T_FLOAT: break;
    200 + case nsXPTType::T_DOUBLE: break;
    201 + case nsXPTType::T_I8: tempu32 = s->val.i8; break;
    202 + case nsXPTType::T_I16: tempu32 = s->val.i16; break;
    203 + case nsXPTType::T_I32: tempu32 = s->val.i32; break;
    204 + case nsXPTType::T_I64: tempu64 = s->val.i64; break;
    205 + case nsXPTType::T_U8: tempu32 = s->val.u8; break;
    206 + case nsXPTType::T_U16: tempu32 = s->val.u16; break;
    207 + case nsXPTType::T_U32: tempu32 = s->val.u32; break;
    208 + case nsXPTType::T_U64: tempu64 = s->val.u64; break;
    209 + case nsXPTType::T_BOOL: tempu32 = s->val.b; break;
    210 + case nsXPTType::T_CHAR: tempu32 = s->val.c; break;
    211 + case nsXPTType::T_WCHAR: tempu32 = s->val.wc; break;
    212 + default: tempu32 = (PRUint32) s->val.p; break;
    213 + }
    214 + }
    215 +
    216 + if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
    217 + if (fpr < FPR_COUNT)
    218 + fpregs[fpr++] = s->val.d;
    219 + else {
    220 + if ((PRUint32) d & 4) d++; // doubles are 8-byte aligned on stack
    221 + *((double*) d) = s->val.d;
    222 + d += 2;
    223 + }
    224 + }
    225 + else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
    226 + if (fpr < FPR_COUNT)
    227 + fpregs[fpr++] = s->val.f; // if passed in registers, floats are promoted to doubles
    228 + else
    229 + *((float*) d++) = s->val.f;
    230 + }
    231 + else if (!s->IsPtrData() && (s->type == nsXPTType::T_I64
    232 + || s->type == nsXPTType::T_U64)) {
    233 + if ((gpr + 1) < GPR_COUNT) {
    234 + if (gpr & 1) gpr++; // longlongs are aligned in odd/even register pairs, eg. r5/r6
    235 + *((PRUint64*) &gpregs[gpr]) = tempu64;
    236 + gpr += 2;
    237 + }
    238 + else {
    239 + if ((PRUint32) d & 4) d++; // longlongs are 8-byte aligned on stack
    240 + *((PRUint64*) d) = tempu64;
    241 + d += 2;
    242 + }
    243 + }
    244 + else {
    245 + if (gpr < GPR_COUNT)
    246 + gpregs[gpr++] = tempu32;
    247 + else
    248 + *d++ = tempu32;
    249 + }
    250 +
    251 + }
    252 +}
    253 +
    254 +extern "C"
    255 +EXPORT_XPCOM_API(nsresult)
    256 +NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
    257 + PRUint32 paramCount, nsXPTCVariant* params);
    258 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_freebsd.s.orig 2009-09-26 22:23:56.000000000 +0200
    259 +++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_freebsd.s 2009-09-26 22:23:56.000000000 +0200
    260 @@ -0,0 +1,89 @@
    261 +# -*- Mode: Asm -*-
    262 +#
    263 +# The contents of this file are subject to the Netscape Public
    264 +# License Version 1.1 (the "License"); you may not use this file
    265 +# except in compliance with the License. You may obtain a copy of
    266 +# the License at http://www.mozilla.org/NPL/
    267 +#
    268 +# Software distributed under the License is distributed on an "AS
    269 +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    270 +# implied. See the License for the specific language governing
    271 +# rights and limitations under the License.
    272 +#
    273 +# The Original Code is mozilla.org code.
    274 +#
    275 +# The Initial Developer of the Original Code is Netscape
    276 +# Communications Corporation. Portions created by Netscape are
    277 +# Copyright (C) 1999 Netscape Communications Corporation. All
    278 +# Rights Reserved.
    279 +#
    280 +# Contributor(s):
    281 +# Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
    282 +# beard@netscape.com (Patrick Beard)
    283 +# waterson@netscape.com (Chris Waterson)
    284 +#
    285 +
    286 +.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
    287 +.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
    288 +.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
    289 +.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
    290 +.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
    291 +.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
    292 +.set r30,30; .set r31,31
    293 +.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
    294 +.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
    295 +.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
    296 +.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
    297 +.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
    298 +.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
    299 +.set f30,30; .set f31,31
    300 +
    301 + .section ".text"
    302 + .align 2
    303 + .globl SharedStub
    304 + .type SharedStub,@function
    305 +
    306 +SharedStub:
    307 + stwu sp,-112(sp) # room for
    308 + # linkage (8),
    309 + # gprData (32),
    310 + # fprData (64),
    311 + # stack alignment(8)
    312 + mflr r0
    313 + stw r0,116(sp) # save LR backchain
    314 +
    315 + stw r4,12(sp) # save GP registers
    316 + stw r5,16(sp) # (n.b. that we don't save r3
    317 + stw r6,20(sp) # because PrepareAndDispatch() is savvy)
    318 + stw r7,24(sp)
    319 + stw r8,28(sp)
    320 + stw r9,32(sp)
    321 + stw r10,36(sp)
    322 +
    323 + stfd f1,40(sp) # save FP registers
    324 + stfd f2,48(sp)
    325 + stfd f3,56(sp)
    326 + stfd f4,64(sp)
    327 + stfd f5,72(sp)
    328 + stfd f6,80(sp)
    329 + stfd f7,88(sp)
    330 + stfd f8,96(sp)
    331 +
    332 + # r3 has the 'self' pointer already
    333 +
    334 + mr r4,r11 # r4 <= methodIndex selector, passed
    335 + # via r11 in the nsXPTCStubBase::StubXX() call
    336 +
    337 + addi r5,sp,120 # r5 <= pointer to callers args area,
    338 + # beyond r3-r10/f1-f8 mapped range
    339 +
    340 + addi r6,sp,8 # r6 <= gprData
    341 + addi r7,sp,40 # r7 <= fprData
    342 +
    343 + bl PrepareAndDispatch@local # Go!
    344 +
    345 + lwz r0,116(sp) # restore LR
    346 + mtlr r0
    347 + la sp,112(sp) # clean up the stack
    348 + blr
    349 +
    350 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_freebsd.cpp.orig 2009-09-26 22:23:56.000000000 +0200
    351 +++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_freebsd.cpp 2009-09-26 22:43:57.000000000 +0200
    352 @@ -0,0 +1,228 @@
    353 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
    354 +/* ***** BEGIN LICENSE BLOCK *****
    355 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
    356 + *
    357 + * The contents of this file are subject to the Mozilla Public License Version
    358 + * 1.1 (the "License"); you may not use this file except in compliance with
    359 + * the License. You may obtain a copy of the License at
    360 + * http://www.mozilla.org/MPL/
    361 + *
    362 + * Software distributed under the License is distributed on an "AS IS" basis,
    363 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    364 + * for the specific language governing rights and limitations under the
    365 + * License.
    366 + *
    367 + * The Original Code is mozilla.org code.
    368 + *
    369 + * The Initial Developer of the Original Code is
    370 + * Netscape Communications Corporation.
    371 + * Portions created by the Initial Developer are Copyright (C) 1999
    372 + * the Initial Developer. All Rights Reserved.
    373 + *
    374 + * Contributor(s):
    375 + * Franz.Sirl-kernel@lauterbach.com (Franz Sirl)
    376 + * beard@netscape.com (Patrick Beard)
    377 + * waterson@netscape.com (Chris Waterson)
    378 + *
    379 + * Alternatively, the contents of this file may be used under the terms of
    380 + * either of the GNU General Public License Version 2 or later (the "GPL"),
    381 + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    382 + * in which case the provisions of the GPL or the LGPL are applicable instead
    383 + * of those above. If you wish to allow use of your version of this file only
    384 + * under the terms of either the GPL or the LGPL, and not to allow others to
    385 + * use your version of this file under the terms of the MPL, indicate your
    386 + * decision by deleting the provisions above and replace them with the notice
    387 + * and other provisions required by the GPL or the LGPL. If you do not delete
    388 + * the provisions above, a recipient may use your version of this file under
    389 + * the terms of any one of the MPL, the GPL or the LGPL.
    390 + *
    391 + * ***** END LICENSE BLOCK ***** */
    392 +
    393 +// Implement shared vtbl methods.
    394 +
    395 +#include "xptcprivate.h"
    396 +#include "xptiprivate.h"
    397 +
    398 +// The PPC/SYSV ABI passes the first 8 integral
    399 +// parameters and the first 8 floating point parameters in registers
    400 +// (r3-r10 and f1-f8), no stack space is allocated for these by the
    401 +// caller. The rest of the parameters are passed in the callers stack
    402 +// area. The stack pointer has to retain 16-byte alignment, longlongs
    403 +// and doubles are aligned on 8-byte boundaries.
    404 +
    405 +#define PARAM_BUFFER_COUNT 16
    406 +#define GPR_COUNT 8
    407 +#define FPR_COUNT 8
    408 +
    409 +// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
    410 +//
    411 +// - 'args[]' contains the arguments passed on stack
    412 +// - 'gprData[]' contains the arguments passed in integer registers
    413 +// - 'fprData[]' contains the arguments passed in floating point registers
    414 +//
    415 +// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
    416 +// and then the method gets called.
    417 +
    418 +extern "C" nsresult
    419 +PrepareAndDispatch(nsXPTCStubBase* self,
    420 + PRUint32 methodIndex,
    421 + PRUint32* args,
    422 + PRUint32 *gprData,
    423 + double *fprData)
    424 +{
    425 + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
    426 + nsXPTCMiniVariant* dispatchParams = NULL;
    427 + const nsXPTMethodInfo* info = NULL;
    428 + PRUint32 paramCount;
    429 + PRUint32 i;
    430 + nsresult result = NS_ERROR_FAILURE;
    431 +
    432 + NS_ASSERTION(self,"no self");
    433 +
    434 + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
    435 + NS_ASSERTION(info,"no method info");
    436 + if (! info)
    437 + return NS_ERROR_UNEXPECTED;
    438 +
    439 + paramCount = info->GetParamCount();
    440 +
    441 + // setup variant array pointer
    442 + if(paramCount > PARAM_BUFFER_COUNT)
    443 + dispatchParams = new nsXPTCMiniVariant[paramCount];
    444 + else
    445 + dispatchParams = paramBuffer;
    446 +
    447 + NS_ASSERTION(dispatchParams,"no place for params");
    448 + if (! dispatchParams)
    449 + return NS_ERROR_OUT_OF_MEMORY;
    450 +
    451 + PRUint32* ap = args;
    452 + PRUint32 gpr = 1; // skip one GPR register
    453 + PRUint32 fpr = 0;
    454 + PRUint32 tempu32;
    455 + PRUint64 tempu64;
    456 +
    457 + for(i = 0; i < paramCount; i++) {
    458 + const nsXPTParamInfo& param = info->GetParam(i);
    459 + const nsXPTType& type = param.GetType();
    460 + nsXPTCMiniVariant* dp = &dispatchParams[i];
    461 +
    462 + if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
    463 + if (fpr < FPR_COUNT)
    464 + dp->val.d = fprData[fpr++];
    465 + else {
    466 + if ((PRUint32) ap & 4) ap++; // doubles are 8-byte aligned on stack
    467 + dp->val.d = *(double*) ap;
    468 + ap += 2;
    469 + }
    470 + continue;
    471 + }
    472 + else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
    473 + if (fpr < FPR_COUNT)
    474 + dp->val.f = (float) fprData[fpr++]; // in registers floats are passed as doubles
    475 + else
    476 + dp->val.f = *(float*) ap++;
    477 + continue;
    478 + }
    479 + else if (!param.IsOut() && (type == nsXPTType::T_I64
    480 + || type == nsXPTType::T_U64)) {
    481 + if (gpr & 1) gpr++; // longlongs are aligned in odd/even register pairs, eg. r5/r6
    482 + if ((gpr + 1) < GPR_COUNT) {
    483 + tempu64 = *(PRUint64*) &gprData[gpr];
    484 + gpr += 2;
    485 + }
    486 + else {
    487 + if ((PRUint32) ap & 4) ap++; // longlongs are 8-byte aligned on stack
    488 + tempu64 = *(PRUint64*) ap;
    489 + ap += 2;
    490 + }
    491 + }
    492 + else {
    493 + if (gpr < GPR_COUNT)
    494 + tempu32 = gprData[gpr++];
    495 + else
    496 + tempu32 = *ap++;
    497 + }
    498 +
    499 + if(param.IsOut() || !type.IsArithmetic()) {
    500 + dp->val.p = (void*) tempu32;
    501 + continue;
    502 + }
    503 +
    504 + switch(type) {
    505 + case nsXPTType::T_I8: dp->val.i8 = (PRInt8) tempu32; break;
    506 + case nsXPTType::T_I16: dp->val.i16 = (PRInt16) tempu32; break;
    507 + case nsXPTType::T_I32: dp->val.i32 = (PRInt32) tempu32; break;
    508 + case nsXPTType::T_I64: dp->val.i64 = (PRInt64) tempu64; break;
    509 + case nsXPTType::T_U8: dp->val.u8 = (PRUint8) tempu32; break;
    510 + case nsXPTType::T_U16: dp->val.u16 = (PRUint16) tempu32; break;
    511 + case nsXPTType::T_U32: dp->val.u32 = (PRUint32) tempu32; break;
    512 + case nsXPTType::T_U64: dp->val.u64 = (PRUint64) tempu64; break;
    513 + case nsXPTType::T_BOOL: dp->val.b = (PRBool) tempu32; break;
    514 + case nsXPTType::T_CHAR: dp->val.c = (char) tempu32; break;
    515 + case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) tempu32; break;
    516 +
    517 + default:
    518 + NS_ASSERTION(0, "bad type");
    519 + break;
    520 + }
    521 + }
    522 +
    523 + result = self->mOuter->CallMethod((PRUint16)methodIndex,
    524 + info,
    525 + dispatchParams);
    526 +
    527 + if (dispatchParams != paramBuffer)
    528 + delete [] dispatchParams;
    529 +
    530 + return result;
    531 +
    532 +}
    533 +
    534 +// Load r11 with the constant 'n' and branch to SharedStub().
    535 +
    536 +// As G++3 ABI contains the length of the functionname in the mangled
    537 +// name, it is difficult to get a generic assembler mechanism like
    538 +// in the G++ 2.95 case.
    539 +// Create names would be like:
    540 +// _ZN14nsXPTCStubBase5Stub1Ev
    541 +// _ZN14nsXPTCStubBase6Stub12Ev
    542 +// _ZN14nsXPTCStubBase7Stub123Ev
    543 +// _ZN14nsXPTCStubBase8Stub1234Ev
    544 +// etc.
    545 +// Use assembler directives to get the names right...
    546 +
    547 +# define STUB_ENTRY(n) \
    548 +__asm__ ( \
    549 + ".align 2 \n\t" \
    550 + ".if "#n" < 10 \n\t" \
    551 + ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
    552 + ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \
    553 +"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
    554 + \
    555 + ".elseif "#n" < 100 \n\t" \
    556 + ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
    557 + ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \
    558 +"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
    559 + \
    560 + ".elseif "#n" < 1000 \n\t" \
    561 + ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
    562 + ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \
    563 +"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
    564 + \
    565 + ".else \n\t" \
    566 + ".err \"stub number "#n" >= 1000 not yet supported\"\n" \
    567 + ".endif \n\t" \
    568 + \
    569 + "li 11,"#n" \n\t" \
    570 + "b SharedStub@local \n" \
    571 +);
    572 +
    573 +#define SENTINEL_ENTRY(n) \
    574 +nsresult nsXPTCStubBase::Sentinel##n() \
    575 +{ \
    576 + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
    577 + return NS_ERROR_NOT_IMPLEMENTED; \
    578 +}
    579 +
    580 +#include "xptcstubsdef.inc"
  • www/libxul/files/patch-xptcall-sparc64

     
    1 --- xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_freebsd.cpp.orig 2009-09-30 22:48:25.000000000 +0200
    2 +++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_freebsd.cpp 2009-09-30 23:09:48.000000000 +0200
    3 @@ -0,0 +1,125 @@
    4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    5 + *
    6 + * The contents of this file are subject to the Mozilla Public
    7 + * License Version 1.1 (the "License"); you may not use this file
    8 + * except in compliance with the License. You may obtain a copy of
    9 + * the License at http://www.mozilla.org/MPL/
    10 + *
    11 + * Software distributed under the License is distributed on an "AS
    12 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    13 + * implied. See the License for the specific language governing
    14 + * rights and limitations under the License.
    15 + *
    16 + * The Original Code is mozilla.org code.
    17 + *
    18 + * The Initial Developer of the Original Code is Netscape
    19 + * Communications Corporation. Portions created by Netscape are
    20 + * Copyright (C) 2001 Netscape Communications Corporation. All
    21 + * Rights Reserved.
    22 + *
    23 + * Contributor(s):
    24 + * Stuart Parmenter <pavlov@netscape.com>
    25 + */
    26 +
    27 +/* Implement shared vtbl methods. */
    28 +
    29 +#include "xptcprivate.h"
    30 +#include "xptiprivate.h"
    31 +
    32 +#if defined(sparc) || defined(__sparc__)
    33 +
    34 +extern "C" nsresult
    35 +PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args)
    36 +{
    37 +
    38 +#define PARAM_BUFFER_COUNT 16
    39 +
    40 + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
    41 + nsXPTCMiniVariant* dispatchParams = NULL;
    42 + const nsXPTMethodInfo* info;
    43 + PRUint8 paramCount;
    44 + PRUint8 i;
    45 + nsresult result = NS_ERROR_FAILURE;
    46 +
    47 + NS_ASSERTION(self,"no self");
    48 +
    49 + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
    50 + NS_ASSERTION(info,"no method info");
    51 + if (! info)
    52 + return NS_ERROR_UNEXPECTED;
    53 +
    54 + paramCount = info->GetParamCount();
    55 +
    56 + // setup variant array pointer
    57 + if(paramCount > PARAM_BUFFER_COUNT)
    58 + dispatchParams = new nsXPTCMiniVariant[paramCount];
    59 + else
    60 + dispatchParams = paramBuffer;
    61 +
    62 + NS_ASSERTION(dispatchParams,"no place for params");
    63 +
    64 + if (! dispatchParams)
    65 + return NS_ERROR_OUT_OF_MEMORY;
    66 +
    67 + PRUint64* ap = args;
    68 + for(i = 0; i < paramCount; i++, ap++)
    69 + {
    70 + const nsXPTParamInfo& param = info->GetParam(i);
    71 + const nsXPTType& type = param.GetType();
    72 + nsXPTCMiniVariant* dp = &dispatchParams[i];
    73 +
    74 + if(param.IsOut() || !type.IsArithmetic())
    75 + {
    76 + dp->val.p = (void*) *ap;
    77 + continue;
    78 + }
    79 + // else
    80 + switch(type)
    81 + {
    82 + case nsXPTType::T_I8 : dp->val.i8 = *((PRInt64*) ap); break;
    83 + case nsXPTType::T_I16 : dp->val.i16 = *((PRInt64*) ap); break;
    84 + case nsXPTType::T_I32 : dp->val.i32 = *((PRInt64*) ap); break;
    85 + case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break;
    86 + case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break;
    87 + case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break;
    88 + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint64*) ap); break;
    89 + case nsXPTType::T_U16 : dp->val.u16 = *((PRUint64*)ap); break;
    90 + case nsXPTType::T_U32 : dp->val.u32 = *((PRUint64*)ap); break;
    91 + case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break;
    92 + case nsXPTType::T_BOOL : dp->val.b = *((PRInt64*) ap); break;
    93 + case nsXPTType::T_CHAR : dp->val.c = *((PRUint64*) ap); break;
    94 + case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt64*) ap); break;
    95 + default:
    96 + NS_ASSERTION(0, "bad type");
    97 + break;
    98 + }
    99 + }
    100 +
    101 + result = self->mOuter->CallMethod((PRUint16)methodIndex, info,
    102 + dispatchParams);
    103 +
    104 + if(dispatchParams != paramBuffer)
    105 + delete [] dispatchParams;
    106 +
    107 + return result;
    108 +}
    109 +
    110 +extern "C" int SharedStub(int, int*);
    111 +
    112 +#define STUB_ENTRY(n) \
    113 +nsresult nsXPTCStubBase::Stub##n() \
    114 +{ \
    115 + int dummy; /* defeat tail-call optimization */ \
    116 + return SharedStub(n, &dummy); \
    117 +}
    118 +
    119 +#define SENTINEL_ENTRY(n) \
    120 +nsresult nsXPTCStubBase::Sentinel##n() \
    121 +{ \
    122 + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
    123 + return NS_ERROR_NOT_IMPLEMENTED; \
    124 +}
    125 +
    126 +#include "xptcstubsdef.inc"
    127 +
    128 +#endif /* sparc || __sparc__ */
    129 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_freebsd.s.orig 2009-09-30 22:48:25.000000000 +0200
    130 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_freebsd.s 2009-09-30 22:48:25.000000000 +0200
    131 @@ -0,0 +1,104 @@
    132 +/* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    133 + *
    134 + * The contents of this file are subject to the Mozilla Public
    135 + * License Version 1.1 (the "License"); you may not use this file
    136 + * except in compliance with the License. You may obtain a copy of
    137 + * the License at http://www.mozilla.org/MPL/
    138 + *
    139 + * Software distributed under the License is distributed on an "AS
    140 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    141 + * implied. See the License for the specific language governing
    142 + * rights and limitations under the License.
    143 + *
    144 + * The Original Code is mozilla.org code.
    145 + *
    146 + * The Initial Developer of the Original Code is Netscape
    147 + * Communications Corporation. Portions created by Netscape are
    148 + * Copyright (C) 2001 Netscape Communications Corporation. All
    149 + * Rights Reserved.
    150 + *
    151 + * Contributor(s):
    152 + * Stuart Parmenter <pavlov@netscape.com>
    153 + * Chris Seawood <cls@seawood.org>
    154 + */
    155 +
    156 +/*
    157 + Platform specific code to invoke XPCOM methods on native objects
    158 + for sparcv9 Solaris.
    159 +
    160 + See the SPARC Compliance Definition (SCD) Chapter 3
    161 + for more information about what is going on here, including
    162 + the use of BIAS (0x7ff).
    163 + The SCD is available from http://www.sparc.com/.
    164 +*/
    165 +
    166 + .global NS_InvokeByIndex_P
    167 + .type NS_InvokeByIndex_P, #function
    168 +
    169 +/*
    170 + NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
    171 + PRUint32 paramCount, nsXPTCVariant* params);
    172 +
    173 +*/
    174 +NS_InvokeByIndex_P:
    175 + save %sp,-(128 + 64),%sp ! room for the register window and
    176 + ! struct pointer, rounded up to 0 % 64
    177 + sll %i2,4,%l0 ! assume the worst case
    178 + ! paramCount * 2 * 8 bytes
    179 + cmp %l0, 0 ! are there any args? If not,
    180 + be .invoke ! no need to copy args to stack
    181 + nop
    182 +
    183 + sub %sp,%l0,%sp ! create the additional stack space
    184 + add %sp,0x7ff+136,%o0 ! step past the register window, the
    185 + ! struct result pointer and the 'this' slot
    186 + mov %i2,%o1 ! paramCount
    187 + call invoke_copy_to_stack
    188 + mov %i3,%o2 ! params
    189 +
    190 +!
    191 +! load arguments from stack into the outgoing registers
    192 +! BIAS is 0x7ff (2047)
    193 +!
    194 +
    195 +! load the %o1..5 64bit (extended word) output registers registers
    196 + ldx [%sp + 0x7ff + 136],%o1 ! %i1
    197 + ldx [%sp + 0x7ff + 144],%o2 ! %i2
    198 + ldx [%sp + 0x7ff + 152],%o3 ! %i3
    199 + ldx [%sp + 0x7ff + 160],%o4 ! %i4
    200 + ldx [%sp + 0x7ff + 168],%o5 ! %i5
    201 +
    202 +! load the even number double registers starting with %d2
    203 + ldd [%sp + 0x7ff + 136],%f2
    204 + ldd [%sp + 0x7ff + 144],%f4
    205 + ldd [%sp + 0x7ff + 152],%f6
    206 + ldd [%sp + 0x7ff + 160],%f8
    207 + ldd [%sp + 0x7ff + 168],%f10
    208 + ldd [%sp + 0x7ff + 176],%f12
    209 + ldd [%sp + 0x7ff + 184],%f14
    210 + ldd [%sp + 0x7ff + 192],%f16
    211 + ldd [%sp + 0x7ff + 200],%f18
    212 + ldd [%sp + 0x7ff + 208],%f20
    213 + ldd [%sp + 0x7ff + 216],%f22
    214 + ldd [%sp + 0x7ff + 224],%f24
    215 + ldd [%sp + 0x7ff + 232],%f26
    216 + ldd [%sp + 0x7ff + 240],%f28
    217 + ldd [%sp + 0x7ff + 248],%f30
    218 +
    219 +!
    220 +! calculate the target address from the vtable
    221 +!
    222 +.invoke:
    223 + sll %i1,3,%l0 ! index *= 8
    224 +! add %l0,16,%l0 ! there are 2 extra entries in the vTable (16bytes)
    225 + ldx [%i0],%l1 ! *that --> address of vtable
    226 + ldx [%l0 + %l1],%l0 ! that->vtable[index * 8 + 16] --> address
    227 +
    228 + jmpl %l0,%o7 ! call the routine
    229 + mov %i0,%o0 ! move 'this' pointer to out register
    230 +
    231 + mov %o0,%i0 ! propagate return value
    232 + ret
    233 + restore
    234 +
    235 + .size NS_InvokeByIndex_P, .-NS_InvokeByIndex_P
    236 --- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_freebsd.cpp.orig 2009-09-30 22:48:25.000000000 +0200
    237 +++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_freebsd.cpp 2009-09-30 22:48:25.000000000 +0200
    238 @@ -0,0 +1,91 @@
    239 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    240 + *
    241 + * The contents of this file are subject to the Mozilla Public
    242 + * License Version 1.1 (the "License"); you may not use this file
    243 + * except in compliance with the License. You may obtain a copy of
    244 + * the License at http://www.mozilla.org/MPL/
    245 + *
    246 + * Software distributed under the License is distributed on an "AS
    247 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    248 + * implied. See the License for the specific language governing
    249 + * rights and limitations under the License.
    250 + *
    251 + * The Original Code is mozilla.org code.
    252 + *
    253 + * The Initial Developer of the Original Code is Netscape
    254 + * Communications Corporation. Portions created by Netscape are
    255 + * Copyright (C) 2001 Netscape Communications Corporation. All
    256 + * Rights Reserved.
    257 + *
    258 + * Contributor(s):
    259 + * Stuart Parmenter <pavlov@netscape.com>
    260 + * Chris Seawood <cls@seawood.org>
    261 + */
    262 +
    263 +
    264 +/* Platform specific code to invoke XPCOM methods on native objects */
    265 +
    266 +#include "xptcprivate.h"
    267 +
    268 +#if !defined(__sparc) && !defined(__sparc__)
    269 +#error "This code is for Sparc only"
    270 +#endif
    271 +
    272 +/* Prototype specifies unmangled function name */
    273 +extern "C" PRUint64
    274 +invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s);
    275 +
    276 +extern "C" PRUint64
    277 +invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s)
    278 +{
    279 + /*
    280 + We need to copy the parameters for this function to locals and use them
    281 + from there since the parameters occupy the same stack space as the stack
    282 + we're trying to populate.
    283 + */
    284 + PRUint64 *l_d = d;
    285 + nsXPTCVariant *l_s = s;
    286 + PRUint64 l_paramCount = paramCount;
    287 + PRUint64 regCount = 0; // return the number of registers to load from the stack
    288 +
    289 + for(PRUint64 i = 0; i < l_paramCount; i++, l_d++, l_s++)
    290 + {
    291 + if (regCount < 5) regCount++;
    292 +
    293 + if (l_s->IsPtrData())
    294 + {
    295 + *l_d = (PRUint64)l_s->ptr;
    296 + continue;
    297 + }
    298 + switch (l_s->type)
    299 + {
    300 + case nsXPTType::T_I8 : *((PRInt64*)l_d) = l_s->val.i8; break;
    301 + case nsXPTType::T_I16 : *((PRInt64*)l_d) = l_s->val.i16; break;
    302 + case nsXPTType::T_I32 : *((PRInt64*)l_d) = l_s->val.i32; break;
    303 + case nsXPTType::T_I64 : *((PRInt64*)l_d) = l_s->val.i64; break;
    304 +
    305 + case nsXPTType::T_U8 : *((PRUint64*)l_d) = l_s->val.u8; break;
    306 + case nsXPTType::T_U16 : *((PRUint64*)l_d) = l_s->val.u16; break;
    307 + case nsXPTType::T_U32 : *((PRUint64*)l_d) = l_s->val.u32; break;
    308 + case nsXPTType::T_U64 : *((PRUint64*)l_d) = l_s->val.u64; break;
    309 +
    310 + /* in the case of floats, we want to put the bits in to the
    311 + 64bit space right justified... floats in the paramter array on
    312 + sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip
    313 + the space that would be occupied by %f0, %f2, etc.
    314 + */
    315 + case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break;
    316 + case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break;
    317 + case nsXPTType::T_BOOL : *((PRInt64*)l_d) = l_s->val.b; break;
    318 + case nsXPTType::T_CHAR : *((PRUint64*)l_d) = l_s->val.c; break;
    319 + case nsXPTType::T_WCHAR : *((PRInt64*)l_d) = l_s->val.wc; break;
    320 +
    321 + default:
    322 + // all the others are plain pointer types
    323 + *((void**)l_d) = l_s->val.p;
    324 + break;
    325 + }
    326 + }
    327 +
    328 + return regCount;
    329 +}
  • www/libxul/files/patch-xulrunner_installer_libxul.pc.in

     
    1 --- xulrunner/installer/libxul.pc.in.orig 2007-08-03 10:46:28.000000000 -0400
    2 +++ xulrunner/installer/libxul.pc.in 2009-03-29 15:17:17.000000000 -0400
    3 @@ -12,5 +12,5 @@ Name: libxul
    4 Description: The Mozilla Runtime and Embedding Engine
    5 Version: %MOZILLA_VERSION%
    6 Requires: %NSPR_NAME% >= %NSPR_VERSION%
    7 -Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom
    8 -Cflags: -I${includedir}/${includetype} -fshort-wchar
    9 \ No newline at end of file
    10 +Libs: -L${sdkdir}/lib -L%%MOZ_LIBDIR%% -lxpcomglue_s -lxul -lxpcom
    11 +Cflags: -I${includedir}/${includetype} -fshort-wchar
  • www/libxul/files/releng6_pulseaudio

     
    1 --- media/libsydneyaudio/src/Makefile.in.orig 2009-08-11 17:22:08.000000000 +0200
    2 +++ media/libsydneyaudio/src/Makefile.in 2009-08-11 17:22:36.000000000 +0200
    3 @@ -45,6 +45,12 @@
    4 LIBRARY_NAME = sydneyaudio
    5 FORCE_STATIC_LIB= 1
    6
    7 +ifeq ($(OS_ARCH),FreeBSD)
    8 +CSRCS = \
    9 + sydney_audio_pulseaudio.c \
    10 + $(NULL)
    11 +endif
    12 +
    13 ifeq ($(OS_ARCH),Linux)
    14 CSRCS = \
    15 sydney_audio_alsa.c \