summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
committerZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
commit0b139a92ae2ea51793901c302e1d262e8b712636 (patch)
tree9717902776eb5714a5ea9fc151bc536a5745241c /net-libs/xulrunner/files
parentfixed binutils's mo confliction with gdb (diff)
downloadloongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.gz
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.bz2
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.zip
added xulrunner-1.9.2.13, firefox-3.6.13 and xorg-server-1.9.2.902
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'net-libs/xulrunner/files')
-rw-r--r--net-libs/xulrunner/files/bug-606109.patch48
-rw-r--r--net-libs/xulrunner/files/fix-animated-gifs.patch246
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch24
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch762
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch30
5 files changed, 1110 insertions, 0 deletions
diff --git a/net-libs/xulrunner/files/bug-606109.patch b/net-libs/xulrunner/files/bug-606109.patch
new file mode 100644
index 0000000..93f1142
--- /dev/null
+++ b/net-libs/xulrunner/files/bug-606109.patch
@@ -0,0 +1,48 @@
+# HG changeset patch
+# User Jory A. Pratt <anarchy@gentoo.org>
+# Parent 74e4421e0a30c6e21b594675e32a8d9d663c309c
+Add missing ifde MOZ_MEDIA
+
+diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp
+--- a/content/base/src/nsContentSink.cpp
++++ b/content/base/src/nsContentSink.cpp
+@@ -1860,17 +1860,19 @@ nsIAtom** const kDefaultAllowedTags [] =
+ &nsGkAtoms::nobr,
+ &nsGkAtoms::noscript,
+ &nsGkAtoms::ol,
+ &nsGkAtoms::optgroup,
+ &nsGkAtoms::option,
+ &nsGkAtoms::output,
+ &nsGkAtoms::p,
+ &nsGkAtoms::pre,
++#ifdef MOZ_MEDIA
+ &nsGkAtoms::progress,
++#endif
+ &nsGkAtoms::q,
+ &nsGkAtoms::rp,
+ &nsGkAtoms::rt,
+ &nsGkAtoms::ruby,
+ &nsGkAtoms::s,
+ &nsGkAtoms::samp,
+ &nsGkAtoms::section,
+ &nsGkAtoms::select,
+@@ -1952,17 +1954,19 @@ nsIAtom** const kDefaultAllowedAttribute
+ &nsGkAtoms::itemref,
+ &nsGkAtoms::itemscope,
+ &nsGkAtoms::itemtype,
+ &nsGkAtoms::kind,
+ &nsGkAtoms::label,
+ &nsGkAtoms::lang,
+ &nsGkAtoms::list,
+ &nsGkAtoms::longdesc,
++#ifdef MOZ_MEDIA
+ &nsGkAtoms::loop,
++#endif
+ &nsGkAtoms::low,
+ &nsGkAtoms::max,
+ &nsGkAtoms::maxlength,
+ &nsGkAtoms::media,
+ &nsGkAtoms::min,
+ &nsGkAtoms::mozdonotsend,
+ &nsGkAtoms::method,
+ &nsGkAtoms::multiple,
diff --git a/net-libs/xulrunner/files/fix-animated-gifs.patch b/net-libs/xulrunner/files/fix-animated-gifs.patch
new file mode 100644
index 0000000..58b994c
--- /dev/null
+++ b/net-libs/xulrunner/files/fix-animated-gifs.patch
@@ -0,0 +1,246 @@
+# HG changeset patch
+# User Rafał Mużyło <galtgendo@o2.pl>
+# Parent 69e253891ca3839b6d4b8f5cb7c0e6950bb66902
+Fix animated gif flickering bug 597174
+
+diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+--- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
++++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+@@ -197,30 +197,29 @@ static NS_METHOD ReadDataOut(nsIInputStr
+ }
+
+ // Push any new rows according to mCurrentPass/mLastFlushedPass and
+ // mCurrentRow/mLastFlushedRow. Note: caller is responsible for
+ // updating mlastFlushed{Row,Pass}.
+ nsresult
+ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
+ {
+- nsIntRect r(0, fromRow, mGIFStruct.width, rows);
++ nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
+
+ // Update image
+ nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ // Offset to the frame position
+ // Only notify observer(s) for first frame
+ if (!mGIFStruct.images_decoded && mObserver) {
+ PRUint32 imgCurFrame;
+ mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
+- r.y += mGIFStruct.y_offset;
+ mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
+ }
+ return NS_OK;
+ }
+
+ nsresult
+ nsGIFDecoder2::FlushImageData()
+ {
+diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp
+--- a/modules/libpr0n/src/imgContainer.cpp
++++ b/modules/libpr0n/src/imgContainer.cpp
+@@ -415,16 +415,18 @@ nsresult imgContainer::InternalAddFrameH
+
+ nsAutoPtr<imgFrame> frame(aFrame);
+
+ if (paletteData && paletteLength)
+ frame->GetPaletteData(paletteData, paletteLength);
+
+ frame->GetImageData(imageData, imageLength);
+
++ frame->LockImageData();
++
+ mFrames.InsertElementAt(framenum, frame.forget());
+ mNumFrames++;
+
+ return NS_OK;
+ }
+
+ nsresult imgContainer::InternalAddFrame(PRUint32 framenum,
+ PRInt32 aX, PRInt32 aY,
+@@ -440,16 +442,21 @@ nsresult imgContainer::InternalAddFrame(
+ return NS_ERROR_INVALID_ARG;
+
+ nsAutoPtr<imgFrame> frame(new imgFrame());
+ NS_ENSURE_TRUE(frame, NS_ERROR_OUT_OF_MEMORY);
+
+ nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
+ NS_ENSURE_SUCCESS(rv, rv);
+
++ if (mFrames.Length() > 0) {
++ imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
++ prevframe->UnlockImageData();
++ }
++
+ if (mFrames.Length() == 0) {
+ return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
+ paletteData, paletteLength);
+ }
+
+ if (mFrames.Length() == 1) {
+ // Since we're about to add our second frame, initialize animation stuff
+ if (!ensureAnimExists())
+diff --git a/modules/libpr0n/src/imgFrame.cpp b/modules/libpr0n/src/imgFrame.cpp
+--- a/modules/libpr0n/src/imgFrame.cpp
++++ b/modules/libpr0n/src/imgFrame.cpp
+@@ -152,16 +152,17 @@ imgFrame::imgFrame() :
+ mBlendMethod(1), /* imgIContainer::kBlendOver */
+ mSinglePixel(PR_FALSE),
+ mNeverUseDeviceSurface(PR_FALSE),
+ mFormatChanged(PR_FALSE),
+ mCompositingFailed(PR_FALSE)
+ #ifdef USE_WIN_SURFACE
+ , mIsDDBSurface(PR_FALSE)
+ #endif
++ , mLocked(PR_FALSE)
+ {
+ static PRBool hasCheckedOptimize = PR_FALSE;
+ if (!hasCheckedOptimize) {
+ if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
+ gDisableOptimize = PR_TRUE;
+ }
+ hasCheckedOptimize = PR_TRUE;
+ }
+@@ -413,18 +414,17 @@ void imgFrame::Draw(gfxContext *aContext
+ nsRefPtr<gfxASurface> surface;
+ gfxImageSurface::gfxImageFormat format;
+
+ NS_ASSERTION(!sourceRect.Intersect(subimage).IsEmpty(),
+ "We must be allowed to sample *some* source pixels!");
+
+ PRBool doTile = !imageRect.Contains(sourceRect);
+ if (doPadding || doPartialDecode) {
+- gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
+- gfxPoint(aPadding.left, aPadding.top);
++ gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
+
+ if (!doTile && !mSinglePixel) {
+ // Not tiling, and we have a surface, so we can account for
+ // padding and/or a partial decode just by twiddling parameters.
+ // First, update our user-space fill rect.
+ sourceRect = sourceRect.Intersect(available);
+ gfxMatrix imageSpaceToUserSpace = userSpaceToImageSpace;
+ imageSpaceToUserSpace.Invert();
+@@ -708,17 +708,17 @@ nsresult imgFrame::ImageUpdated(const ns
+ mem->IsLowMemory(&lowMemory);
+ if (lowMemory)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+ mDecoded.UnionRect(mDecoded, aUpdateRect);
+
+ // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
+ // you, gif decoder)
+- nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
++ nsIntRect boundsRect(mOffset, mSize);
+ mDecoded.IntersectRect(mDecoded, boundsRect);
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+@@ -806,17 +806,23 @@ void imgFrame::GetPaletteData(PRUint32 *
+ *aPalette = (PRUint32 *) mPalettedImageData;
+ *length = PaletteDataLength();
+ }
+ }
+
+ nsresult imgFrame::LockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
++ if (mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_TRUE;
+
+ if ((mOptSurface || mSinglePixel) && !mImageSurface) {
+ // Recover the pixels
+ mImageSurface = new gfxImageSurface(gfxIntSize(mSize.width, mSize.height),
+ gfxImageSurface::ImageFormatARGB32);
+ if (!mImageSurface || mImageSurface->CairoStatus())
+ return NS_ERROR_OUT_OF_MEMORY;
+
+@@ -832,23 +838,35 @@ nsresult imgFrame::LockImageData()
+ #ifdef USE_WIN_SURFACE
+ mWinSurface = nsnull;
+ #endif
+ #ifdef XP_MACOSX
+ mQuartzSurface = nsnull;
+ #endif
+ }
+
++ if (mImageSurface)
++ mImageSurface->Flush();
++
+ return NS_OK;
+ }
+
+ nsresult imgFrame::UnlockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
++ if (!mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_FALSE;
++
++ if (mImageSurface)
++ mImageSurface->MarkDirty();
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+
+@@ -895,17 +913,17 @@ PRInt32 imgFrame::GetBlendMethod() const
+
+ void imgFrame::SetBlendMethod(PRInt32 aBlendMethod)
+ {
+ mBlendMethod = (PRInt8)aBlendMethod;
+ }
+
+ PRBool imgFrame::ImageComplete() const
+ {
+- return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
++ return mDecoded == nsIntRect(mOffset, mSize);
+ }
+
+ // A hint from the image decoders that this image has no alpha, even
+ // though we created is ARGB32. This changes our format to RGB24,
+ // which in turn will cause us to Optimize() to RGB24. Has no effect
+ // after Optimize() is called, though in all cases it will be just a
+ // performance win -- the pixels are still correct and have the A byte
+ // set to 0xff.
+diff --git a/modules/libpr0n/src/imgFrame.h b/modules/libpr0n/src/imgFrame.h
+--- a/modules/libpr0n/src/imgFrame.h
++++ b/modules/libpr0n/src/imgFrame.h
+@@ -167,16 +167,17 @@ private: // data
+
+ gfxASurface::gfxImageFormat mFormat;
+ PRInt8 mPaletteDepth;
+ PRInt8 mBlendMethod;
+ PRPackedBool mSinglePixel;
+ PRPackedBool mNeverUseDeviceSurface;
+ PRPackedBool mFormatChanged;
+ PRPackedBool mCompositingFailed;
++ PRPackedBool mLocked;
+
+ #ifdef XP_WIN
+ PRPackedBool mIsDDBSurface;
+ #endif
+
+ };
+
+ #endif /* imgFrame_h */
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch
new file mode 100644
index 0000000..2bf51d7
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch
@@ -0,0 +1,24 @@
+--- ./xpcom/glue/nsTArray.h.orig 2009-04-26 01:21:58.000000000 +0800
++++ ./xpcom/glue/nsTArray.h 2009-04-26 01:21:33.000000000 +0800
+@@ -168,6 +168,7 @@
+
+ // The array's elements (prefixed with a Header). This pointer is never
+ // null. If the array is empty, then this will point to sEmptyHdr.
++ void *padding;
+ Header *mHdr;
+ };
+
+diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+index 6d452d0..3ce4193 100644
+--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
++++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+@@ -169,8 +169,8 @@ private:
+ PRBool SetupForDirectTextRun(gfxContext *aContext, float aScale);
+ void SetupFor(gfxContext *aContext, float aScale);
+
+- nsSVGGlyphFrame *mSource;
+ nsAutoTArray<CharacterPosition,80> mPositions;
++ nsSVGGlyphFrame *mSource;
+ gfxMatrix mInitialMatrix;
+ // Textrun advance width from start to mCurrentChar, in appunits
+ gfxFloat mCurrentAdvance;
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch
new file mode 100644
index 0000000..c1a415d
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch
@@ -0,0 +1,762 @@
+From 1aa3577cf7e79b574bd2cff058ea00221194869b Mon Sep 17 00:00:00 2001
+From: Zhang Le <r0bertz@gentoo.org>
+Date: Thu, 12 Mar 2009 02:24:34 +0800
+Subject: [PATCH 2/2] xulrunner mips n32 ABI patch
+
+Signed-off-by: Zhang Le <r0bertz@gentoo.org>
+---
+ xpcom/reflect/xptcall/src/md/unix/Makefile.in | 5 +
+ .../xptcall/src/md/unix/xptcinvoke_asm_mips64.s | 159 ++++++++++++++
+ .../xptcall/src/md/unix/xptcinvoke_mips64.cpp | 173 ++++++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_asm_mips64.s | 149 +++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_mips64.cpp | 218 ++++++++++++++++++++
+ 5 files changed, 704 insertions(+), 0 deletions(-)
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+
+diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+index 524174e..63586cf 100644
+--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -274,8 +274,13 @@ endif
+
+ ifeq ($(OS_ARCH),Linux)
+ ifneq (,$(findstring mips, $(OS_TEST)))
++ifneq (,$(findstring mips64, $(OS_TEST)))
++CPPSRCS := xptcinvoke_mips64.cpp xptcstubs_mips64.cpp
++ASFILES := xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s
++else
+ CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp
+ ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
++endif
+ ASFLAGS += -I$(DIST)/include -x assembler-with-cpp
+ endif
+ endif
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+new file mode 100644
+index 0000000..f146ad8
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+@@ -0,0 +1,159 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++.text
++.globl invoke_count_words
++.globl invoke_copy_to_stack
++
++LOCALSZ=7 # a0, a1, a2, a3, s0, ra, gp
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++RAOFF=FRAMESZ-(1*SZREG)
++A0OFF=FRAMESZ-(2*SZREG)
++A1OFF=FRAMESZ-(3*SZREG)
++A2OFF=FRAMESZ-(4*SZREG)
++A3OFF=FRAMESZ-(5*SZREG)
++S0OFF=FRAMESZ-(6*SZREG)
++GPOFF=FRAMESZ-(7*SZREG)
++
++#
++# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
++# a0 a1 a2 a3
++
++NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
++ PTR_SUBU sp, FRAMESZ
++ SETUP_GP64(GPOFF, _NS_InvokeByIndex_P)
++
++ REG_S ra, RAOFF(sp)
++ REG_S a0, A0OFF(sp)
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S s0, S0OFF(sp)
++
++ # invoke_count_words(paramCount, params)
++ move a0, a2
++ move a1, a3
++ jal invoke_count_words
++
++ # invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount,
++ # nsXPTCVariant* s, PRUint32 *reg)
++
++ REG_L a1, A2OFF(sp) # a1 - paramCount
++ REG_L a2, A3OFF(sp) # a2 - params
++
++ # save sp before we copy the params to the stack
++ move t0, sp
++
++ # assume full size of 16 bytes per param to be safe
++ sll v0, 4 # 16 bytes * num params
++ subu sp, sp, v0 # make room
++ move a0, sp # a0 - param stack address
++
++ # create temporary stack space to write int and fp regs
++ subu sp, 64 # 64 = 8 regs of 8 bytes
++ move a3, sp
++
++ # save the old sp and save the arg stack
++ subu sp, sp, 16
++ REG_S t0, 0(sp)
++ REG_S a0, 8(sp)
++
++ # copy the param into the stack areas
++ jal invoke_copy_to_stack
++
++ REG_L t3, 8(sp) # get previous a0
++ REG_L sp, 0(sp) # get orig sp back
++
++ REG_L a0, A0OFF(sp) # a0 - that
++ REG_L a1, A1OFF(sp) # a1 - methodIndex
++
++ # t1 = methodIndex * pow(2, PTRLOG)
++ # (use shift instead of mult)
++ sll t1, a1, PTRLOG
++
++ # calculate the function we need to jump to,
++ # which must then be saved in t9
++ lw t9, 0(a0)
++ addu t9, t9, t1
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++ lw t9, (t9)
++#else /* not G++ V3 ABI */
++ lw t9, 2*PTRSIZE(t9)
++#endif /* G++ V3 ABI */
++
++ # get register save area from invoke_copy_to_stack
++ subu t1, t3, 64
++
++ # a1..a7 and f13..f19 should now be set to what
++ # invoke_copy_to_stack told us. skip a0 and f12
++ # because that's the "this" pointer
++
++ REG_L a1, 0(t1)
++ REG_L a2, 8(t1)
++ REG_L a3, 16(t1)
++ REG_L a4, 24(t1)
++ REG_L a5, 32(t1)
++ REG_L a6, 40(t1)
++ REG_L a7, 48(t1)
++
++ l.d $f13, 0(t1)
++ l.d $f14, 8(t1)
++ l.d $f15, 16(t1)
++ l.d $f16, 24(t1)
++ l.d $f17, 32(t1)
++ l.d $f18, 40(t1)
++ l.d $f19, 48(t1)
++
++ # save away our stack pointer and create
++ # the stack pointer for the function
++ move s0, sp
++ move sp, t3
++
++ jalr t9
++
++ move sp, s0
++
++ RESTORE_GP64
++ REG_L ra, RAOFF(sp)
++ REG_L s0, S0OFF(sp)
++ PTR_ADDU sp, FRAMESZ
++ j ra
++.end _NS_InvokeByIndex_P
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+new file mode 100644
+index 0000000..d1d1a7d
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+@@ -0,0 +1,173 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/* Platform specific code to invoke XPCOM methods on native objects */
++
++#include "xptcprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++extern "C" uint32
++invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
++{
++ return paramCount;
++}
++
++extern "C" void
++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount,
++ nsXPTCVariant* s, PRUint64 *regs)
++{
++#define N_ARG_REGS 7 /* 8 regs minus 1 for "this" ptr */
++
++ for (PRUint32 i = 0; i < paramCount; i++, s++)
++ {
++ if (s->IsPtrData()) {
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->ptr;
++ else
++ *d++ = (PRUint64)s->ptr;
++ continue;
++ }
++ switch (s->type) {
++ //
++ // signed types first
++ //
++ case nsXPTType::T_I8:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i8;
++ else
++ *d++ = s->val.i8;
++ break;
++ case nsXPTType::T_I16:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i16;
++ else
++ *d++ = s->val.i16;
++ break;
++ case nsXPTType::T_I32:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i32;
++ else
++ *d++ = s->val.i32;
++ break;
++ case nsXPTType::T_I64:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i64;
++ else
++ *d++ = s->val.i64;
++ break;
++ //
++ // unsigned types next
++ //
++ case nsXPTType::T_U8:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u8;
++ else
++ *d++ = s->val.u8;
++ break;
++ case nsXPTType::T_U16:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u16;
++ else
++ *d++ = s->val.u16;
++ break;
++ case nsXPTType::T_U32:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u32;
++ else
++ *d++ = s->val.u32;
++ break;
++ case nsXPTType::T_U64:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u64;
++ else
++ *d++ = s->val.u64;
++ break;
++ case nsXPTType::T_FLOAT:
++ if (i < N_ARG_REGS)
++ *(float*)&regs[i] = s->val.f;
++ else
++ *(float*)d++ = s->val.f;
++ break;
++ case nsXPTType::T_DOUBLE:
++ if (i < N_ARG_REGS)
++ *(double*)&regs[i] = s->val.d;
++ else
++ *(double*)d++ = s->val.d;
++ break;
++ case nsXPTType::T_BOOL:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.b;
++ else
++ *d++ = s->val.b;
++ break;
++ case nsXPTType::T_CHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.c;
++ else
++ *d++ = s->val.c;
++ break;
++ case nsXPTType::T_WCHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.wc;
++ else
++ *d++ = s->val.wc;
++ break;
++ default:
++ // all the others are plain pointer types
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->val.p;
++ else
++ *d++ = (PRUint64)s->val.p;
++ break;
++ }
++ }
++}
++
++extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount,
++ nsXPTCVariant* params);
++
++EXPORT_XPCOM_API(nsresult)
++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount, nsXPTCVariant* params)
++{
++ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
++}
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+new file mode 100644
+index 0000000..dfee24b
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+@@ -0,0 +1,149 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++LOCALSZ=16
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++A1OFF=FRAMESZ-(9*SZREG)
++A2OFF=FRAMESZ-(8*SZREG)
++A3OFF=FRAMESZ-(7*SZREG)
++A4OFF=FRAMESZ-(6*SZREG)
++A5OFF=FRAMESZ-(5*SZREG)
++A6OFF=FRAMESZ-(4*SZREG)
++A7OFF=FRAMESZ-(3*SZREG)
++GPOFF=FRAMESZ-(2*SZREG)
++RAOFF=FRAMESZ-(1*SZREG)
++
++F13OFF=FRAMESZ-(16*SZREG)
++F14OFF=FRAMESZ-(15*SZREG)
++F15OFF=FRAMESZ-(14*SZREG)
++F16OFF=FRAMESZ-(13*SZREG)
++F17OFF=FRAMESZ-(12*SZREG)
++F18OFF=FRAMESZ-(11*SZREG)
++F19OFF=FRAMESZ-(10*SZREG)
++
++#define SENTINEL_ENTRY(n) /* defined in cpp file, not here */
++
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ .if x < 10; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev); \
++ .elseif x < 100; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev); \
++ .elseif x < 1000; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev); \
++ .else; \
++ .err; \
++ .endif
++#else /* not G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase)
++#endif /* G++ V3 ABI */
++
++#define MAKE_STUB(x, name) \
++ .globl name; \
++ .type name,@function; \
++ .aent name,0; \
++name:; \
++ PTR_SUBU sp,FRAMESZ; \
++ SETUP_GP64(GPOFF, name); \
++ li t0,x; \
++ b sharedstub; \
++
++#
++# open a dummy frame for the function entries
++#
++ .text
++ .align 2
++ .type dummy,@function
++ .ent dummy, 0
++dummy:
++ .frame sp, FRAMESZ, ra
++ .mask 0x90000FF0, RAOFF-FRAMESZ
++ .fmask 0x000FF000, F19OFF-FRAMESZ
++
++#include "xptcstubsdef.inc"
++
++sharedstub:
++
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S a4, A4OFF(sp)
++ REG_S a5, A5OFF(sp)
++ REG_S a6, A6OFF(sp)
++ REG_S a7, A7OFF(sp)
++ REG_S ra, RAOFF(sp)
++
++ s.d $f13, F13OFF(sp)
++ s.d $f14, F14OFF(sp)
++ s.d $f15, F15OFF(sp)
++ s.d $f16, F16OFF(sp)
++ s.d $f17, F17OFF(sp)
++ s.d $f18, F18OFF(sp)
++ s.d $f19, F19OFF(sp)
++
++ # t0 is methodIndex
++ move a1, t0
++
++ # a2 is stack address where extra function params
++ # are stored that do not fit in registers
++ move a2, sp
++ addi a2, FRAMESZ
++
++ # a3 is stack address of a1..a7
++ move a3, sp
++ addi a3, A1OFF
++
++ # a4 is stack address of f13..f19
++ move a4, sp
++ addi a4, F13OFF
++
++ # PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs)
++ # a0 a1 a2 a3 a4
++ #
++ jal PrepareAndDispatch
++
++ REG_L ra, RAOFF(sp)
++ RESTORE_GP64
++
++ PTR_ADDU sp, FRAMESZ
++ j ra
++ END(dummy)
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+new file mode 100644
+index 0000000..c404065
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+@@ -0,0 +1,218 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1999
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "xptcprivate.h"
++#include "xptiprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++/*
++ * This is for MIPS N32 ABI
++ *
++ * When we're called, the "gp" registers are stored in gprData and
++ * the "fp" registers are stored in fprData. There are 8 regs
++ * available which coorespond to the first 7 parameters of the
++ * function and the "this" pointer. If there are additional parms,
++ * they are stored on the stack at address "args".
++ *
++ */
++extern "C" nsresult
++PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint64* args,
++ PRUint64 *gprData, double *fprData)
++{
++#define PARAM_BUFFER_COUNT 16
++#define PARAM_GPR_COUNT 7
++#define PARAM_FPR_COUNT 7
++
++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
++ nsXPTCMiniVariant* dispatchParams = NULL;
++ const nsXPTMethodInfo* info;
++ PRUint8 paramCount;
++ PRUint8 i;
++ nsresult result = NS_ERROR_FAILURE;
++
++ NS_ASSERTION(self,"no self");
++
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
++ NS_ASSERTION(info,"no method info");
++
++ paramCount = info->GetParamCount();
++
++ // setup variant array pointer
++ if(paramCount > PARAM_BUFFER_COUNT)
++ dispatchParams = new nsXPTCMiniVariant[paramCount];
++ else
++ dispatchParams = paramBuffer;
++ NS_ASSERTION(dispatchParams,"no place for params");
++
++ PRUint64* ap = args;
++ PRUint32 iCount = 0;
++ for(i = 0; i < paramCount; i++)
++ {
++ const nsXPTParamInfo& param = info->GetParam(i);
++ const nsXPTType& type = param.GetType();
++ nsXPTCMiniVariant* dp = &dispatchParams[i];
++
++ if(param.IsOut() || !type.IsArithmetic())
++ {
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.p = (void*)gprData[iCount++];
++ else
++ dp->val.p = (void*)*ap++;
++ continue;
++ }
++ // else
++ switch(type)
++ {
++ case nsXPTType::T_I8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i8 = (PRInt8)gprData[iCount++];
++ else
++ dp->val.i8 = (PRInt8)*ap++;
++ break;
++
++ case nsXPTType::T_I16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i16 = (PRInt16)gprData[iCount++];
++ else
++ dp->val.i16 = (PRInt16)*ap++;
++ break;
++
++ case nsXPTType::T_I32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i32 = (PRInt32)gprData[iCount++];
++ else
++ dp->val.i32 = (PRInt32)*ap++;
++ break;
++
++ case nsXPTType::T_I64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i64 = (PRInt64)gprData[iCount++];
++ else
++ dp->val.i64 = (PRInt64)*ap++;
++ break;
++
++ case nsXPTType::T_U8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u8 = (PRUint8)gprData[iCount++];
++ else
++ dp->val.u8 = (PRUint8)*ap++;
++ break;
++
++ case nsXPTType::T_U16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u16 = (PRUint16)gprData[iCount++];
++ else
++ dp->val.u16 = (PRUint16)*ap++;
++ break;
++
++ case nsXPTType::T_U32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u32 = (PRUint32)gprData[iCount++];
++ else
++ dp->val.u32 = (PRUint32)*ap++;
++ break;
++
++ case nsXPTType::T_U64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u64 = (PRUint64)gprData[iCount++];
++ else
++ dp->val.u64 = (PRUint64)*ap++;
++ break;
++
++ case nsXPTType::T_FLOAT:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.f = (double)fprData[iCount++];
++ else
++ dp->val.f = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_DOUBLE:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.d = (double)fprData[iCount++];
++ else
++ dp->val.d = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_BOOL:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.b = (PRBool)gprData[iCount++];
++ else
++ dp->val.b = (PRBool)*ap++;
++ break;
++
++ case nsXPTType::T_CHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.c = (char)gprData[iCount++];
++ else
++ dp->val.c = (char)*ap++;
++ break;
++
++ case nsXPTType::T_WCHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.wc = (wchar_t)gprData[iCount++];
++ else
++ dp->val.wc = (wchar_t)*ap++;
++ break;
++
++ default:
++ NS_ASSERTION(0, "bad type");
++ break;
++ }
++ }
++
++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
++
++ if(dispatchParams != paramBuffer)
++ delete [] dispatchParams;
++
++ return result;
++}
++
++#define STUB_ENTRY(n) /* defined in the assembly file */
++
++#define SENTINEL_ENTRY(n) \
++nsresult nsXPTCStubBase::Sentinel##n() \
++{ \
++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
++ return NS_ERROR_NOT_IMPLEMENTED; \
++}
++
++#include "xptcstubsdef.inc"
+--
+1.6.2
+
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch
new file mode 100644
index 0000000..51aaf57
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch
@@ -0,0 +1,30 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1271746824 -7200
+# Node ID bfe106e6ca9a983a0059911df70b0701c0c1786b
+# Parent a164b2809859dd76bc254e077b7191ffb4b06469
+Bug 528687 - Don't use TLS variables on mips, because of a binutils bug [r=benjamin]
+
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -4269,7 +4269,16 @@ AC_CACHE_CHECK(for __thread keyword for
+ ac_cv_thread_keyword=no)])
+ LDFLAGS=$_SAVE_LDFLAGS
+ if test "$ac_cv_thread_keyword" = yes; then
+- AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
++ # mips builds fail with TLS variables because of a binutils bug.
++ # See bug 528687
++ case "${target_cpu}" in
++ mips*)
++ :
++ ;;
++ *)
++ AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
++ ;;
++ esac
+ fi
+
+ dnl Check for the existence of various allocation headers/functions
+