diff options
author | martin <martin> | 2008-12-13 00:42:26 +0000 |
---|---|---|
committer | martin <martin> | 2008-12-13 00:42:26 +0000 |
commit | a3d52e863382b2952161a819e406967a9f1ab724 (patch) | |
tree | cf12f40b214ae6ce79329dfb3adb0a177dfac804 /www/firefox3 | |
parent | b9199e47a9ce255b843e0aad8296e5a0f3feb72b (diff) | |
download | pkgsrc-a3d52e863382b2952161a819e406967a9f1ab724.tar.gz |
Make firefox3 work on sparc64.
ok: tnn
Diffstat (limited to 'www/firefox3')
-rw-r--r-- | www/firefox3/Makefile | 3 | ||||
-rw-r--r-- | www/firefox3/distinfo | 3 | ||||
-rwxr-xr-x | www/firefox3/files/moz-install | 77 | ||||
-rw-r--r-- | www/firefox3/files/mozilla-ELF.in | 6 | ||||
-rw-r--r-- | www/firefox3/files/mozilla-Mach-O.in | 4 | ||||
-rw-r--r-- | www/firefox3/files/mozilla-a.out.in | 6 | ||||
-rw-r--r-- | www/firefox3/files/xptcinvoke_asm_sparc64_netbsd.s | 112 | ||||
-rw-r--r-- | www/firefox3/files/xptcinvoke_sparc64_netbsd.cpp | 84 | ||||
-rw-r--r-- | www/firefox3/files/xptcstubs_asm_sparc64_netbsd.s | 66 | ||||
-rw-r--r-- | www/firefox3/files/xptcstubs_sparc64_netbsd.cpp | 117 | ||||
-rw-r--r-- | www/firefox3/patches/patch-ee | 30 |
11 files changed, 506 insertions, 2 deletions
diff --git a/www/firefox3/Makefile b/www/firefox3/Makefile index d9c3ead1f1a..e02edd01ef2 100644 --- a/www/firefox3/Makefile +++ b/www/firefox3/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2008/11/13 14:44:00 tron Exp $ +# $NetBSD: Makefile,v 1.9 2008/12/13 00:42:26 martin Exp $ MOZILLA= firefox3 # allow coexisting with firefox2 COMMENT= Lightweight gecko-based web browser @@ -25,6 +25,7 @@ CONFIGURE_ENV+= PYTHON=${PYTHONBIN:Q} MAINTAINER= tnn@NetBSD.org MOZ_VER= 3.0.4 +FILESDIR= ${.CURDIR}/files DESCR_SRC= ${.CURDIR}/../../www/firefox/DESCR DISTINFO_FILE= ${.CURDIR}/../../www/firefox3/distinfo diff --git a/www/firefox3/distinfo b/www/firefox3/distinfo index 8b5c342ab03..ce0d0c85da5 100644 --- a/www/firefox3/distinfo +++ b/www/firefox3/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2008/12/11 09:34:12 tnn Exp $ +$NetBSD: distinfo,v 1.9 2008/12/13 00:42:26 martin Exp $ SHA1 (firefox-3.0.4-source.tar.bz2) = 16715b4af7ca2bad6baa8d450a3fd9cb375ad6d6 RMD160 (firefox-3.0.4-source.tar.bz2) = 99e34b76feca22c74287b1e8d78a042c313c3f97 @@ -36,6 +36,7 @@ SHA1 (patch-dv) = a380d261d4c2771a672d2b0f4f1f23821e3e5266 SHA1 (patch-ea) = 14e31d17c2493e468cd01f99abfc996853a11032 SHA1 (patch-eb) = dc9232b10075d17f7ed742e7be8ea036db2f0241 SHA1 (patch-ed) = 3c6281a75373843c5767fc1213d8cc67dc549e03 +SHA1 (patch-ee) = d5aeca91305ed2e1f522b2c0ed4bb17f7f8b881b SHA1 (patch-eh) = 60aca7f94ee04c957386014f7d4df9e3c8ac8ff1 SHA1 (patch-wc) = 2de8665ed6c23c26566ca6d50165c0cf413a753d SHA1 (patch-wd) = fc5c3103ae6f2a2eccc01911a8207f3ca614008b diff --git a/www/firefox3/files/moz-install b/www/firefox3/files/moz-install new file mode 100755 index 00000000000..f67279f1829 --- /dev/null +++ b/www/firefox3/files/moz-install @@ -0,0 +1,77 @@ +#!/bin/sh +# +# $NetBSD: moz-install,v 1.1 2008/12/13 00:42:26 martin Exp $ + +${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin +${SED} -e "s,@PREFIX@,${PREFIX},g" -e "s,@MOZILLA@,${MOZILLA}," -e "s,@MOZILLA_BIN@,${MOZILLA_BIN}," ${FILESDIR}/mozilla-${OBJECT_FMT}.in > ${DESTDIR}${PREFIX}/bin/${MOZILLA} +${CHOWN} ${BINOWN} ${DESTDIR}${PREFIX}/bin/${MOZILLA} +${CHGRP} ${BINGRP} ${DESTDIR}${PREFIX}/bin/${MOZILLA} +${CHMOD} ${BINMODE} ${DESTDIR}${PREFIX}/bin/${MOZILLA} + +# +# Substitute variables +# +TMP_PLIST=${WRKDIR}/TMP_PLIST.$$ +trap "${RM} -f ${TMP_PLIST}" 1 2 15 + +${SED} -e "s/\${MOZILLA}/${MOZILLA}/g" -e "s/\${SO_SUFFIX}/${SO_SUFFIX}/" -e "s/\${MOZILLA_BIN}/${MOZILLA_BIN}/g" < ${PLIST_SRC} > ${TMP_PLIST} + +# make directories +for i in `${SED} -n -e '/^@comment begin DIRS$/,/^@comment end DIRS$/p' ${TMP_PLIST} | ${EGREP} ^@dirrm | ${SED} -e 's/^@dirrm//'` ; do + ${BSD_INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/$i +done + +# install programs +for i in `${SED} -n -e '/^@comment begin PROGRAMS$/,/^@comment end PROGRAMS$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@lib/${MOZILLA}@dist/bin@"`; + ${BSD_INSTALL_PROGRAM} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install scripts +for i in `${SED} -n -e '/^@comment begin SCRIPTS$/,/^@comment end SCRIPTS$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@lib/${MOZILLA}@dist/bin@"`; + ${BSD_INSTALL_SCRIPT} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install DSO +for i in `${SED} -n -e '/^@comment begin DSO$/,/^@comment end DSO$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@lib/${MOZILLA}@dist/bin@"`; + ${MOZ_INSTALL_LIB} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install PKGCONFIG +for i in `${SED} -n -e '/^@comment begin PKGCONFIG$/,/^@comment end PKGCONFIG$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@lib/pkgconfig@build/unix@"`; + ${BSD_INSTALL_DATA} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install DATA +for i in `${SED} -n -e '/^@comment begin DATA$/,/^@comment end DATA$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@lib/${MOZILLA}@dist/bin@"`; + ${BSD_INSTALL_DATA} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install INCLUDE +for i in `${SED} -n -e '/^@comment begin INCLUDE$/,/^@comment end INCLUDE$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@include/${MOZILLA}@dist/include@"`; + ${BSD_INSTALL_DATA} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install INCLUDE-PUBLIC +for i in `${SED} -n -e '/^@comment begin INCLUDE-PUBLIC$/,/^@comment end INCLUDE-PUBLIC$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@include/${MOZILLA}@dist/public@"`; + ${BSD_INSTALL_DATA} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +# install INCLUDE-SDK +for i in `${SED} -n -e '/^@comment begin INCLUDE-SDK$/,/^@comment end INCLUDE-SDK$/p' ${TMP_PLIST} | ${EGREP} -v ^@comment` ; do + src=`echo $i | ${SED} -e "s@include/${MOZILLA}@dist/sdk/include@"`; + ${BSD_INSTALL_DATA} ${WRKSRC}/${src} ${DESTDIR}${PREFIX}/$i +done + +${RM} -f ${TMP_PLIST} + +# +# remove generated user conf directory ${WRKDIR}/.mozilla +# +${RM} -rf ${WRKDIR}/.mozilla diff --git a/www/firefox3/files/mozilla-ELF.in b/www/firefox3/files/mozilla-ELF.in new file mode 100644 index 00000000000..9523d1269e4 --- /dev/null +++ b/www/firefox3/files/mozilla-ELF.in @@ -0,0 +1,6 @@ +#!/bin/sh +MOZILLA_FIVE_HOME=@PREFIX@/lib/@MOZILLA@ +export MOZILLA_FIVE_HOME +LD_LIBRARY_PATH=@PREFIX@/lib/@MOZILLA@:@PREFIX@/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH +exec @PREFIX@/lib/@MOZILLA@/@MOZILLA_BIN@ "$@" diff --git a/www/firefox3/files/mozilla-Mach-O.in b/www/firefox3/files/mozilla-Mach-O.in new file mode 100644 index 00000000000..99470536423 --- /dev/null +++ b/www/firefox3/files/mozilla-Mach-O.in @@ -0,0 +1,4 @@ +#!/bin/sh +MOZILLA_FIVE_HOME=@PREFIX@/lib/@MOZILLA@ +export MOZILLA_FIVE_HOME +exec @PREFIX@/lib/@MOZILLA@/@MOZILLA_BIN@ "$@" diff --git a/www/firefox3/files/mozilla-a.out.in b/www/firefox3/files/mozilla-a.out.in new file mode 100644 index 00000000000..72af99363b6 --- /dev/null +++ b/www/firefox3/files/mozilla-a.out.in @@ -0,0 +1,6 @@ +#!/bin/sh +MOZILLA_FIVE_HOME=@PREFIX@/lib/@MOZILLA@ +LD_LIBRARY_PATH=@PREFIX@/lib/@MOZILLA@ +export MOZILLA_FIVE_HOME +export LD_LIBRARY_PATH +exec @PREFIX@/lib/@MOZILLA@/@MOZILLA_BIN@ "$@" diff --git a/www/firefox3/files/xptcinvoke_asm_sparc64_netbsd.s b/www/firefox3/files/xptcinvoke_asm_sparc64_netbsd.s new file mode 100644 index 00000000000..c501f4fd7a4 --- /dev/null +++ b/www/firefox3/files/xptcinvoke_asm_sparc64_netbsd.s @@ -0,0 +1,112 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + +/* Platform specific code to invoke XPCOM methods on native objects */ + .global NS_InvokeByIndex_P + .type NS_InvokeByIndex_P, #function +/* + NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, + PRUint32 paramCount, nsXPTCVariant* params); + +*/ +/* + * Note: To simplify stack handling we allocate an extra stack + * frame here. In principle invoke_copy_to_stack() could + * save the parameters our caller's frame and we could + * reclaim the stackframe and do a tail call to the + * function. However, this gets complicated.... + * + * The vtable consist of be: + * + * struct { + * short __delta; + * short __index; + * union { + * P __pfn; + * short __delta2; + * } __pfn_or_delta2; + * }; + * + * See gcc/cp/cp-tree.h + */ + +NS_InvokeByIndex_P: + save %sp,-(128 + 64),%sp ! room for the register window and + ! struct pointer, rounded up to 0 % 64 + sll %i2,4,%l0 ! assume the worst case + ! paramCount * 2 * 8 bytes + cmp %l0, 0 ! are there any args? If not, + be .invoke ! no need to copy args to stack + nop + + sub %sp,%l0,%sp ! create the additional stack space + add %sp,0x7ff+136,%o0 ! step past the register window, the + ! struct result pointer and the 'this' slot + mov %i2,%o1 ! paramCount + call invoke_copy_to_stack + mov %i3,%o2 ! params + +! +! load arguments from stack into the outgoing registers +! BIAS is 0x7ff (2047) +! + +! load the %o1..5 64bit (extended word) output registers registers + ldx [%sp + 0x7ff + 136],%o1 ! %i1 + ldx [%sp + 0x7ff + 144],%o2 ! %i2 + ldx [%sp + 0x7ff + 152],%o3 ! %i3 + ldx [%sp + 0x7ff + 160],%o4 ! %i4 + ldx [%sp + 0x7ff + 168],%o5 ! %i5 + +! load the even number double registers starting with %f2 + ldd [%sp + 0x7ff + 136],%f2 + ldd [%sp + 0x7ff + 144],%f4 + ldd [%sp + 0x7ff + 152],%f6 + ldd [%sp + 0x7ff + 160],%f8 + ldd [%sp + 0x7ff + 168],%f10 + ldd [%sp + 0x7ff + 176],%f12 + ldd [%sp + 0x7ff + 184],%f14 + ldd [%sp + 0x7ff + 192],%f16 + ldd [%sp + 0x7ff + 200],%f18 + ldd [%sp + 0x7ff + 208],%f20 + ldd [%sp + 0x7ff + 216],%f22 + ldd [%sp + 0x7ff + 224],%f24 + ldd [%sp + 0x7ff + 232],%f26 + ldd [%sp + 0x7ff + 240],%f28 + ldd [%sp + 0x7ff + 248],%f30 + +! +! calculate the target address from the vtable +! +.invoke: + sll %i1,3,%l0 ! index *= 8 + ldx [%i0],%l1 ! *this --> address of vtable + ldx [%l0 + %l1],%l0 ! this->vtable[index] --> address + + jmpl %l0,%o7 ! call the routine + mov %i0,%o0 ! move 'this' pointer to out register + + mov %o0,%i0 ! propagate return value + ret + restore + + .size NS_InvokeByIndex_P, .-NS_InvokeByIndex_P diff --git a/www/firefox3/files/xptcinvoke_sparc64_netbsd.cpp b/www/firefox3/files/xptcinvoke_sparc64_netbsd.cpp new file mode 100644 index 00000000000..82d7c9cc3b5 --- /dev/null +++ b/www/firefox3/files/xptcinvoke_sparc64_netbsd.cpp @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + +/* Platform specific code to invoke XPCOM methods on native objects */ + +#include "xptcprivate.h" + +#if !defined(__sparc64__) && !defined(_LP64) +#error "This code is for Sparc64 only" +#endif + +extern "C" PRUint32 +invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) +{ + /* + We need to copy the parameters for this function to locals and use them + from there since the parameters occupy the same stack space as the stack + we're trying to populate. + */ + PRUint64 *l_d = d; + nsXPTCVariant *l_s = s; + PRUint64 l_paramCount = paramCount; + PRUint64 regCount = 0; // return the number of registers to load from the stack + + for(PRUint64 i = 0; i < l_paramCount; i++, l_d++, l_s++) + { + if (regCount < 5) regCount++; + + if (l_s->IsPtrData()) + { + *l_d = (PRUint64)l_s->ptr; + continue; + } + switch (l_s->type) + { + case nsXPTType::T_I8 : *((PRInt64*)l_d) = l_s->val.i8; break; + case nsXPTType::T_I16 : *((PRInt64*)l_d) = l_s->val.i16; break; + case nsXPTType::T_I32 : *((PRInt64*)l_d) = l_s->val.i32; break; + case nsXPTType::T_I64 : *((PRInt64*)l_d) = l_s->val.i64; break; + + case nsXPTType::T_U8 : *((PRUint64*)l_d) = l_s->val.u8; break; + case nsXPTType::T_U16 : *((PRUint64*)l_d) = l_s->val.u16; break; + case nsXPTType::T_U32 : *((PRUint64*)l_d) = l_s->val.u32; break; + case nsXPTType::T_U64 : *((PRUint64*)l_d) = l_s->val.u64; break; + + /* in the case of floats, we want to put the bits in to the + 64bit space right justified... floats in the paramter array on + sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip + the space that would be occupied by %f0, %f2, etc. + */ + case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break; + case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break; + case nsXPTType::T_BOOL : *((PRInt64*)l_d) = l_s->val.b; break; + case nsXPTType::T_CHAR : *((PRUint64*)l_d) = l_s->val.c; break; + case nsXPTType::T_WCHAR : *((PRInt64*)l_d) = l_s->val.wc; break; + + default: + // all the others are plain pointer types + *((void**)l_d) = l_s->val.p; + break; + } + } + + return regCount; +} diff --git a/www/firefox3/files/xptcstubs_asm_sparc64_netbsd.s b/www/firefox3/files/xptcstubs_asm_sparc64_netbsd.s new file mode 100644 index 00000000000..6557db78b18 --- /dev/null +++ b/www/firefox3/files/xptcstubs_asm_sparc64_netbsd.s @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + + .global SharedStub + +/* + in the frame for the function that called SharedStub are the + rest of the parameters we need + +*/ + +SharedStub: +! we don't create a new frame yet, but work within the frame of the calling +! function to give ourselves the other parameters we want + + mov %o0, %o1 ! shuffle the index up to 2nd place + mov %i0, %o0 ! the original 'this' + add %fp, 0x7ff + 136, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this') + +! save off the original incoming parameters that arrived in +! registers, the ABI guarantees the space for us to do this + stx %i1, [%fp + 0x7ff + 136] + stx %i2, [%fp + 0x7ff + 144] + stx %i3, [%fp + 0x7ff + 152] + stx %i4, [%fp + 0x7ff + 160] + stx %i5, [%fp + 0x7ff + 168] +! now we can build our own stack frame + save %sp,-(128 + 64),%sp ! room for the register window and + ! struct pointer, rounded up to 0 % 64 +! our function now appears to have been called +! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args) +! so we can just copy these through + + mov %i0, %o0 + mov %i1, %o1 + mov %i2, %o2 + call PrepareAndDispatch + nop + mov %o0,%i0 ! propagate return value + b .LL1 + nop +.LL1: + ret + restore + + .size SharedStub, .-SharedStub + .type SharedStub, #function diff --git a/www/firefox3/files/xptcstubs_sparc64_netbsd.cpp b/www/firefox3/files/xptcstubs_sparc64_netbsd.cpp new file mode 100644 index 00000000000..f48bca5c3f5 --- /dev/null +++ b/www/firefox3/files/xptcstubs_sparc64_netbsd.cpp @@ -0,0 +1,117 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + +/* Implement shared vtbl methods. */ + +#include "xptcprivate.h" +#include "xptiprivate.h" + +#if defined(sparc) || defined(__sparc__) + +extern "C" nsresult +PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args) +{ + +#define PARAM_BUFFER_COUNT 16 + + 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 interface 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; + for(i = 0; i < paramCount; i++, ap++) + { + const nsXPTParamInfo& param = info->GetParam(i); + const nsXPTType& type = param.GetType(); + nsXPTCMiniVariant* dp = &dispatchParams[i]; + + if(param.IsOut() || !type.IsArithmetic()) + { + dp->val.p = (void*) *ap; + continue; + } + // else + switch(type) + { + case nsXPTType::T_I8 : dp->val.i8 = *((PRInt32*) ap); break; + case nsXPTType::T_I16 : dp->val.i16 = *((PRInt32*) ap); break; + case nsXPTType::T_I32 : dp->val.i32 = *((PRInt32*) ap); break; + case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break; + case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break; + case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break; + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; + case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; + case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; + case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRBool*) ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; + case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; + default: + NS_ASSERTION(0, "bad type"); + break; + } + } + + result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); + + if(dispatchParams != paramBuffer) + delete [] dispatchParams; + + return result; +} + +extern "C" int SharedStub(int, int*); + +#define STUB_ENTRY(n) \ +nsresult nsXPTCStubBase::Stub##n() \ +{ \ + int dummy; /* defeat tail-call optimization */ \ + return SharedStub(n, &dummy); \ +} + +#define SENTINEL_ENTRY(n) \ +nsresult nsXPTCStubBase::Sentinel##n() \ +{ \ + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ + return NS_ERROR_NOT_IMPLEMENTED; \ +} + +#include "xptcstubsdef.inc" + +#endif /* sparc || __sparc__ */ diff --git a/www/firefox3/patches/patch-ee b/www/firefox3/patches/patch-ee new file mode 100644 index 00000000000..d6df2abfb4e --- /dev/null +++ b/www/firefox3/patches/patch-ee @@ -0,0 +1,30 @@ +$NetBSD: patch-ee,v 1.1 2008/12/13 00:42:26 martin Exp $ + +# reported upstream as: https://bugzilla.mozilla.org/show_bug.cgi?id=469276 + +--- toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp.orig 2008-08-25 22:59:14.000000000 +0200 ++++ toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp 2008-12-12 16:31:11.000000000 +0100 +@@ -2023,8 +2023,9 @@ + return NS_ERROR_FAILURE; + } + const nsCSubstring& str = Substring(chunk, start, 4); +- const PRUint32 *p = reinterpret_cast<const PRUint32*>(str.BeginReading()); +- entry->mAddChunkId = PR_ntohl(*p); ++ PRUint32 p; ++ memcpy(&p, str.BeginReading(), 4); ++ entry->mAddChunkId = PR_ntohl(p); + if (entry->mAddChunkId == 0) { + NS_WARNING("Received invalid chunk number."); + return NS_ERROR_FAILURE; +@@ -2052,8 +2053,9 @@ + + if (chunkType == CHUNK_SUB) { + const nsCSubstring& str = Substring(chunk, start, 4); +- const PRUint32 *p = reinterpret_cast<const PRUint32*>(str.BeginReading()); +- entry->mAddChunkId = PR_ntohl(*p); ++ PRUint32 p; ++ memcpy(&p, str.BeginReading(), 4); ++ entry->mAddChunkId = PR_ntohl(p); + if (entry->mAddChunkId == 0) { + NS_WARNING("Received invalid chunk number."); + return NS_ERROR_FAILURE; |