Bug 639191: update NSPR to NSPR_4_8_8_BETA2. Include fixes

for bug 546535, bug 587426, bug 622425, bug 624868,
bug 626035 (attachment 504094 only), bug 626309, bug 627299,
bug 629653, bug 635667.
This commit is contained in:
Wan-Teh Chang 2011-03-26 10:42:58 -07:00
parent eb31aa597e
commit c8af169ce4
19 changed files with 475 additions and 318 deletions

View File

@ -1 +1 @@
NSPR_4_8_7_RTM
NSPR_4_8_8_BETA2

View File

@ -64,10 +64,10 @@
#
# ------------------------------------------------------------------
FROMTOP=/share/builds/components/nspr20/v4.8.7
TOTOP=./v4.8.7
NSPRDIR=nspr-4.8.7
SOURCETAG=NSPR_4_8_7_RTM
FROMTOP=/share/builds/components/nspr20/v4.8.8
TOTOP=./v4.8.8
NSPRDIR=nspr-4.8.8
SOURCETAG=NSPR_4_8_8_RTM
#
# enumerate Unix object directories on /s/b/c

View File

@ -42,4 +42,3 @@
*/
#error "Do not include this header file."

16
nsprpub/configure vendored
View File

@ -67,7 +67,7 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-os2-high-mem Disable high-memory support on OS/2"
ac_help="$ac_help
--enable-thumb2 Enable Thumb2 instruction set"
--enable-thumb2 Enable Thumb-2 instruction set"
ac_help="$ac_help
--with-symbian-sdk=SYMBIAN_SDK_DIR
The path to the Symbian SDK"
@ -713,7 +713,7 @@ test "$host_alias" != "$target_alias" &&
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
MOD_PATCH_VERSION=7
MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
@ -3101,8 +3101,8 @@ if test -n "$MOZ_THUMB2"; then
case "$target_cpu" in
arm*)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CFLAGS="$CFLAGS -march=armv7-a -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb"
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
else
{ echo "configure: error: --enable-thumb2 is not supported for non-GNU toolchains" 1>&2; exit 1; }
@ -3113,11 +3113,11 @@ if test -n "$MOZ_THUMB2"; then
;;
esac
else
case "$target_cpu" in
arm*)
case "$target" in
arm-android-eabi)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork"
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork"
fi
;;

View File

@ -50,7 +50,7 @@ dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
MOD_PATCH_VERSION=7
MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
@ -916,7 +916,7 @@ dnl ========================================================
dnl = Enable building the Thumb2 instruction set
dnl ========================================================
AC_ARG_ENABLE(thumb2,
[ --enable-thumb2 Enable Thumb2 instruction set],
[ --enable-thumb2 Enable Thumb-2 instruction set],
[ if test "$enableval" = "yes"; then
MOZ_THUMB2=1,
fi ])
@ -925,8 +925,8 @@ if test -n "$MOZ_THUMB2"; then
case "$target_cpu" in
arm*)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CFLAGS="$CFLAGS -march=armv7-a -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb"
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
else
AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
@ -937,11 +937,11 @@ if test -n "$MOZ_THUMB2"; then
;;
esac
else
case "$target_cpu" in
arm*)
case "$target" in
arm-android-eabi)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork"
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork"
fi
;;

View File

@ -314,8 +314,8 @@ PR_IMPLEMENT(void) PL_ArenaRelease(PLArenaPool *pool, char *mark)
{
PLArena *a;
for (a = pool->first.next; a; a = a->next) {
if (PR_UPTRDIFF(mark, a->base) < PR_UPTRDIFF(a->avail, a->base)) {
for (a = &pool->first; a; a = a->next) {
if (PR_UPTRDIFF(mark, a->base) <= PR_UPTRDIFF(a->avail, a->base)) {
a->avail = (PRUword)PL_ARENA_ALIGN(pool, mark);
FreeArenaList(pool, a, PR_FALSE);
return;

View File

@ -110,6 +110,30 @@ extern PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval);
#define _PR_HAVE_INET_NTOP
#else
#define _PR_INET6_PROBE
/* for HP-UX 11.11 without IPv6 */
#ifndef AF_INET6
#define AF_INET6 22
#define AI_CANONNAME 2
#define AI_NUMERICHOST 4
#define AI_NUMERICSERV 8
#define AI_V4MAPPED 0x00000010
#define AI_ADDRCONFIG 0x00000040
#define AI_ALL 0x00000020
#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
#define NI_NUMERICHOST 2
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for host */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
#endif /* for HP-UX 11.11 without IPv6 */
#define _PR_HAVE_MD_SOCKADDR_IN6
/* isomorphic to struct in6_addr on HP-UX B.11.23 */
struct _md_in6_addr {

View File

@ -797,6 +797,51 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#elif defined(__m32r__)
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define PR_ALIGN_OF_WORD 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#else
#error "Unknown CPU architecture"

View File

@ -83,6 +83,8 @@
#define _PR_SI_ARCHITECTURE "sh"
#elif defined(__avr32__)
#define _PR_SI_ARCHITECTURE "avr32"
#elif defined(__m32r__)
#define _PR_SI_ARCHITECTURE "m32r"
#else
#error "Unknown CPU architecture"
#endif
@ -216,7 +218,18 @@ extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval);
})
#endif
#if defined(__arm__) && defined(_PR_ARM_KUSER)
#if defined(__arm__)
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
/* Use GCC built-in functions */
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
#elif defined(_PR_ARM_KUSER)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
@ -259,16 +272,18 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *ptr, PRInt32 nv)
return ov;
}
#endif
#endif /* __arm__ */
#define USE_SETJMP
#if defined(__GLIBC__) && __GLIBC__ >= 2
#if (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(ANDROID)
#define _PR_POLL_AVAILABLE
#endif
#undef _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
#if defined(__alpha) || defined(__ia64__)
#define _PR_HAVE_LARGE_OFF_T
#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) \
|| defined(ANDROID)
#define _PR_HAVE_OFF64_T
#else
#define _PR_NO_LARGE_FILES
@ -459,6 +474,18 @@ extern void _MD_CleanupBeforeExit(void);
#error "SH/Linux pre-glibc2 not supported yet"
#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
#elif defined(__m32r__)
/* Linux/M32R */
#if defined(__GLIBC__) && __GLIBC__ >= 2
#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__regs[JB_SP]
#define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[0].__regs[JB_FP] = (val))
#define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
#define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[0].__regs[JB_FP])
#define _MD_SP_TYPE __ptr_t
#else
#error "Linux/M32R pre-glibc2 not supported yet"
#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */
#else
#error "Unknown CPU architecture"

View File

@ -140,6 +140,8 @@ long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value);
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
defined(__ia64__) || defined(__x86_64__) || \
(defined(__powerpc__) && !defined(__powerpc64__)) || \
(defined(__arm__) && \
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
defined(__alpha))))
/*

View File

@ -63,11 +63,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.8.7"
#define PR_VERSION "4.8.8 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 8
#define PR_VPATCH 7
#define PR_BETA PR_FALSE
#define PR_VPATCH 8
#define PR_BETA PR_TRUE
/*
** PRVersionCheck

View File

@ -1,46 +1,46 @@
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/
/ ***** 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 the Netscape Portable Runtime (NSPR).
/
/ The Initial Developer of the Original Code is
/ Netscape Communications Corporation.
/ Portions created by the Initial Developer are Copyright (C) 2000
/ the Initial Developer. All Rights Reserved.
/
/ Contributor(s):
/
/ Alternatively, the contents of this file may be used under the terms of
/ either 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 *****
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
//
// ***** 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 the Netscape Portable Runtime (NSPR).
//
// The Initial Developer of the Original Code is
// Netscape Communications Corporation.
// Portions created by the Initial Developer are Copyright (C) 2000
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//
// Alternatively, the contents of this file may be used under the terms of
// either 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 *****
/ PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val)
/
/ Atomically increment the integer pointed to by 'val' and return
/ the result of the increment.
/
// PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val)
//
// Atomically increment the integer pointed to by 'val' and return
// the result of the increment.
//
.text
.globl _PR_x86_AtomicIncrement
.align 4
@ -52,11 +52,11 @@ _PR_x86_AtomicIncrement:
incl %eax
ret
/ PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val)
/
/ Atomically decrement the integer pointed to by 'val' and return
/ the result of the decrement.
/
// PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val)
//
// Atomically decrement the integer pointed to by 'val' and return
// the result of the decrement.
//
.text
.globl _PR_x86_AtomicDecrement
.align 4
@ -68,25 +68,25 @@ _PR_x86_AtomicDecrement:
decl %eax
ret
/ PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval)
/
/ Atomically set the integer pointed to by 'val' to the new
/ value 'newval' and return the old value.
/
/ An alternative implementation:
/ .text
/ .globl _PR_x86_AtomicSet
/ .align 4
/_PR_x86_AtomicSet:
/ movl 4(%esp), %ecx
/ movl 8(%esp), %edx
/ movl (%ecx), %eax
/retry:
/ lock
/ cmpxchgl %edx, (%ecx)
/ jne retry
/ ret
/
// PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval)
//
// Atomically set the integer pointed to by 'val' to the new
// value 'newval' and return the old value.
//
// An alternative implementation:
// .text
// .globl _PR_x86_AtomicSet
// .align 4
//_PR_x86_AtomicSet:
// movl 4(%esp), %ecx
// movl 8(%esp), %edx
// movl (%ecx), %eax
//retry:
// lock
// cmpxchgl %edx, (%ecx)
// jne retry
// ret
//
.text
.globl _PR_x86_AtomicSet
.align 4
@ -96,11 +96,11 @@ _PR_x86_AtomicSet:
xchgl %eax, (%ecx)
ret
/ PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val)
/
/ Atomically add 'val' to the integer pointed to by 'ptr'
/ and return the result of the addition.
/
// PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val)
//
// Atomically add 'val' to the integer pointed to by 'ptr'
// and return the result of the addition.
//
.text
.globl _PR_x86_AtomicAdd
.align 4
@ -113,5 +113,5 @@ _PR_x86_AtomicAdd:
addl %edx, %eax
ret
/ Magic indicating no need for an executable stack
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous

View File

@ -1,46 +1,46 @@
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/
/ ***** 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 the Netscape Portable Runtime (NSPR).
/
/ The Initial Developer of the Original Code is
/ Netscape Communications Corporation.
/ Portions created by the Initial Developer are Copyright (C) 2004
/ the Initial Developer. All Rights Reserved.
/
/ Contributor(s):
/
/ Alternatively, the contents of this file may be used under the terms of
/ either 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 *****
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
//
// ***** 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 the Netscape Portable Runtime (NSPR).
//
// The Initial Developer of the Original Code is
// Netscape Communications Corporation.
// Portions created by the Initial Developer are Copyright (C) 2004
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//
// Alternatively, the contents of this file may be used under the terms of
// either 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 *****
/ PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val)
/
/ Atomically increment the integer pointed to by 'val' and return
/ the result of the increment.
/
// PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val)
//
// Atomically increment the integer pointed to by 'val' and return
// the result of the increment.
//
.text
.globl _PR_x86_64_AtomicIncrement
.type _PR_x86_64_AtomicIncrement, @function
@ -53,11 +53,11 @@ _PR_x86_64_AtomicIncrement:
ret
.size _PR_x86_64_AtomicIncrement, .-_PR_x86_64_AtomicIncrement
/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
/
/ Atomically decrement the integer pointed to by 'val' and return
/ the result of the decrement.
/
// PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
//
// Atomically decrement the integer pointed to by 'val' and return
// the result of the decrement.
//
.text
.globl _PR_x86_64_AtomicDecrement
.type _PR_x86_64_AtomicDecrement, @function
@ -70,11 +70,11 @@ _PR_x86_64_AtomicDecrement:
ret
.size _PR_x86_64_AtomicDecrement, .-_PR_x86_64_AtomicDecrement
/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
/
/ Atomically set the integer pointed to by 'val' to the new
/ value 'newval' and return the old value.
/
// PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
//
// Atomically set the integer pointed to by 'val' to the new
// value 'newval' and return the old value.
//
.text
.globl _PR_x86_64_AtomicSet
.type _PR_x86_64_AtomicSet, @function
@ -85,11 +85,11 @@ _PR_x86_64_AtomicSet:
ret
.size _PR_x86_64_AtomicSet, .-_PR_x86_64_AtomicSet
/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
/
/ Atomically add 'val' to the integer pointed to by 'ptr'
/ and return the result of the addition.
/
// PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
//
// Atomically add 'val' to the integer pointed to by 'ptr'
// and return the result of the addition.
//
.text
.globl _PR_x86_64_AtomicAdd
.type _PR_x86_64_AtomicAdd, @function
@ -102,5 +102,5 @@ _PR_x86_64_AtomicAdd:
ret
.size _PR_x86_64_AtomicAdd, .-_PR_x86_64_AtomicAdd
/ Magic indicating no need for an executable stack
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous

View File

@ -1,40 +1,40 @@
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/
/ ***** 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 the Netscape Portable Runtime (NSPR).
/
/ The Initial Developer of the Original Code is
/ Netscape Communications Corporation.
/ Portions created by the Initial Developer are Copyright (C) 1998-2000
/ the Initial Developer. All Rights Reserved.
/
/ Contributor(s):
/
/ Alternatively, the contents of this file may be used under the terms of
/ either 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 *****
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
//
// ***** 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 the Netscape Portable Runtime (NSPR).
//
// The Initial Developer of the Original Code is
// Netscape Communications Corporation.
// Portions created by the Initial Developer are Copyright (C) 1998-2000
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//
// Alternatively, the contents of this file may be used under the terms of
// either 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 *****
.text
@ -60,31 +60,31 @@ _MD_FlushRegisterWindows:
ret
/
/ sol_getsp()
/
/ Return the current sp (for debugging)
/
//
// sol_getsp()
//
// Return the current sp (for debugging)
//
.globl sol_getsp
sol_getsp:
movl %esp, %eax
ret
/
/ sol_curthread()
/
/ Return a unique identifier for the currently active thread.
/
//
// sol_curthread()
//
// Return a unique identifier for the currently active thread.
//
.globl sol_curthread
sol_curthread:
movl %ecx, %eax
ret
/ PRInt32 _MD_AtomicIncrement(PRInt32 *val)
/
/ Atomically increment the integer pointed to by 'val' and return
/ the result of the increment.
/
// PRInt32 _MD_AtomicIncrement(PRInt32 *val)
//
// Atomically increment the integer pointed to by 'val' and return
// the result of the increment.
//
.text
.globl _MD_AtomicIncrement
.align 4
@ -96,11 +96,11 @@ _MD_AtomicIncrement:
incl %eax
ret
/ PRInt32 _MD_AtomicDecrement(PRInt32 *val)
/
/ Atomically decrement the integer pointed to by 'val' and return
/ the result of the decrement.
/
// PRInt32 _MD_AtomicDecrement(PRInt32 *val)
//
// Atomically decrement the integer pointed to by 'val' and return
// the result of the decrement.
//
.text
.globl _MD_AtomicDecrement
.align 4
@ -112,25 +112,25 @@ _MD_AtomicDecrement:
decl %eax
ret
/ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
/
/ Atomically set the integer pointed to by 'val' to the new
/ value 'newval' and return the old value.
/
/ An alternative implementation:
/ .text
/ .globl _MD_AtomicSet
/ .align 4
/_MD_AtomicSet:
/ movl 4(%esp), %ecx
/ movl 8(%esp), %edx
/ movl (%ecx), %eax
/retry:
/ lock
/ cmpxchgl %edx, (%ecx)
/ jne retry
/ ret
/
// PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
//
// Atomically set the integer pointed to by 'val' to the new
// value 'newval' and return the old value.
//
// An alternative implementation:
// .text
// .globl _MD_AtomicSet
// .align 4
//_MD_AtomicSet:
// movl 4(%esp), %ecx
// movl 8(%esp), %edx
// movl (%ecx), %eax
//retry:
// lock
// cmpxchgl %edx, (%ecx)
// jne retry
// ret
//
.text
.globl _MD_AtomicSet
.align 4
@ -140,11 +140,11 @@ _MD_AtomicSet:
xchgl %eax, (%ecx)
ret
/ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
/
/ Atomically add 'val' to the integer pointed to by 'ptr'
/ and return the result of the addition.
/
// PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
//
// Atomically add 'val' to the integer pointed to by 'ptr'
// and return the result of the addition.
//
.text
.globl _MD_AtomicAdd
.align 4

View File

@ -1,46 +1,46 @@
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/
/ ***** 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 the Netscape Portable Runtime (NSPR).
/
/ The Initial Developer of the Original Code is
/ Netscape Communications Corporation.
/ Portions created by the Initial Developer are Copyright (C) 2004
/ the Initial Developer. All Rights Reserved.
/
/ Contributor(s):
/
/ Alternatively, the contents of this file may be used under the terms of
/ either 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 *****
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
//
// ***** 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 the Netscape Portable Runtime (NSPR).
//
// The Initial Developer of the Original Code is
// Netscape Communications Corporation.
// Portions created by the Initial Developer are Copyright (C) 2004
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//
// Alternatively, the contents of this file may be used under the terms of
// either 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 *****
/ PRInt32 _MD_AtomicIncrement(PRInt32 *val)
/
/ Atomically increment the integer pointed to by 'val' and return
/ the result of the increment.
/
// PRInt32 _MD_AtomicIncrement(PRInt32 *val)
//
// Atomically increment the integer pointed to by 'val' and return
// the result of the increment.
//
.text
.globl _MD_AtomicIncrement
.align 4
@ -51,11 +51,11 @@ _MD_AtomicIncrement:
incl %eax
ret
/ PRInt32 _MD_AtomicDecrement(PRInt32 *val)
/
/ Atomically decrement the integer pointed to by 'val' and return
/ the result of the decrement.
/
// PRInt32 _MD_AtomicDecrement(PRInt32 *val)
//
// Atomically decrement the integer pointed to by 'val' and return
// the result of the decrement.
//
.text
.globl _MD_AtomicDecrement
.align 4
@ -66,11 +66,11 @@ _MD_AtomicDecrement:
decl %eax
ret
/ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
/
/ Atomically set the integer pointed to by 'val' to the new
/ value 'newval' and return the old value.
/
// PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
//
// Atomically set the integer pointed to by 'val' to the new
// value 'newval' and return the old value.
//
.text
.globl _MD_AtomicSet
.align 4
@ -79,11 +79,11 @@ _MD_AtomicSet:
xchgl %eax, (%rdi)
ret
/ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
/
/ Atomically add 'val' to the integer pointed to by 'ptr'
/ and return the result of the addition.
/
// PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
//
// Atomically add 'val' to the integer pointed to by 'ptr'
// and return the result of the addition.
//
.text
.globl _MD_AtomicAdd
.align 4

View File

@ -2256,6 +2256,10 @@ PRInt32 _MD_open(const char *name, PRIntn flags, PRIntn mode)
PR_Lock(_pr_rename_lock);
}
#if defined(ANDROID)
osflags |= O_LARGEFILE;
#endif
rv = _md_iovector._open64(name, osflags, mode);
if (rv < 0) {
@ -2742,6 +2746,23 @@ static void* _MD_Unix_mmap64(
} /* _MD_Unix_mmap64 */
#endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
/* Android doesn't have mmap64. */
#if defined(ANDROID)
extern void *__mmap2(void *, size_t, int, int, int, size_t);
#define ANDROID_PAGE_SIZE 4096
static void *
mmap64(void *addr, size_t len, int prot, int flags, int fd, loff_t offset)
{
if (offset & (ANDROID_PAGE_SIZE - 1)) {
errno = EINVAL;
return MAP_FAILED;
}
return __mmap2(addr, len, prot, flags, fd, offset / ANDROID_PAGE_SIZE);
}
#endif
#if defined(OSF1) && defined(__GNUC__)
/*
@ -2796,7 +2817,11 @@ static void _PR_InitIOV(void)
_md_iovector._stat64 = stat;
_md_iovector._lseek64 = _MD_Unix_lseek64;
#elif defined(_PR_HAVE_OFF64_T)
#if defined(IRIX5_3)
#if defined(IRIX5_3) || defined(ANDROID)
/*
* Android doesn't have open64. We pass the O_LARGEFILE flag to open
* in _MD_open.
*/
_md_iovector._open64 = open;
#else
_md_iovector._open64 = open64;

View File

@ -70,7 +70,8 @@
* #define IBM for IBM mainframe-style floating-point arithmetic.
* #define VAX for VAX-style floating-point arithmetic (D_floating).
* #define No_leftright to omit left-right logic in fast floating-point
* computation of dtoa.
* computation of dtoa. This will cause dtoa modes 4 and 5 to be
* treated the same as modes 2 and 3 for some inputs.
* #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3
* and strtod and dtoa should round accordingly. Unless Trust_FLT_ROUNDS
* is also #defined, fegetround() will be queried for the rounding mode.
@ -84,7 +85,12 @@
* #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
* that use extended-precision instructions to compute rounded
* products and quotients) with IBM.
* #define ROUND_BIASED for IEEE-format with biased rounding.
* #define ROUND_BIASED for IEEE-format with biased rounding and arithmetic
* that rounds toward +Infinity.
* #define ROUND_BIASED_without_Round_Up for IEEE-format with biased
* rounding when the underlying floating-point arithmetic uses
* unbiased rounding. This prevent using ordinary floating-point
* arithmetic when the result could be computed with one rounding error.
* #define Inaccurate_Divide for IEEE-format with correctly rounded
* products but inaccurate quotients, e.g., for Intel i860.
* #define NO_LONG_LONG on machines that do not have a "long long"
@ -453,6 +459,11 @@ extern int strtod_diglim;
#ifndef IEEE_Arith
#define ROUND_BIASED
#else
#ifdef ROUND_BIASED_without_Round_Up
#undef ROUND_BIASED
#define ROUND_BIASED
#endif
#endif
#ifdef RND_PRODQUOT
@ -2576,6 +2587,8 @@ strtod
for(; c == '0'; c = *++s)
nz++;
if (c > '0' && c <= '9') {
bc.dp0 = s0 - s;
bc.dp1 = bc.dp0 + bc.dplen;
s0 = s;
nf += nz;
nz = 0;
@ -2703,6 +2716,7 @@ strtod
) {
if (!e)
goto ret;
#ifndef ROUND_BIASED_without_Round_Up
if (e > 0) {
if (e <= Ten_pmax) {
#ifdef VAX
@ -2763,6 +2777,7 @@ strtod
goto ret;
}
#endif
#endif /* ROUND_BIASED_without_Round_Up */
}
e1 += nd - k;
@ -3678,6 +3693,9 @@ dtoa
U d2, eps, u;
double ds;
char *s, *s0;
#ifdef IEEE_Arith
U eps1;
#endif
#ifdef SET_INEXACT
int inexact, oldinexact;
#endif
@ -3941,14 +3959,26 @@ dtoa
* generating digits needed.
*/
dval(&eps) = 0.5/tens[ilim-1] - dval(&eps);
#ifdef IEEE_Arith
if (k0 < 0 && j1 >= 307) {
eps1.d = 1.01e256; /* 1.01 allows roundoff in the next few lines */
word0(&eps1) -= Exp_msk1 * (Bias+P-1);
dval(&eps1) *= tens[j1 & 0xf];
for(i = 0, j = (j1-256) >> 4; j; j >>= 1, i++)
if (j & 1)
dval(&eps1) *= bigtens[i];
if (eps.d < eps1.d)
eps.d = eps1.d;
}
#endif
for(i = 0;;) {
L = dval(&u);
dval(&u) -= L;
*s++ = '0' + (int)L;
if (dval(&u) < dval(&eps))
goto ret1;
if (1. - dval(&u) < dval(&eps))
goto bump_up;
if (dval(&u) < dval(&eps))
goto ret1;
if (++i >= ilim)
break;
dval(&eps) *= 10.;
@ -4022,7 +4052,12 @@ dtoa
}
#endif
dval(&u) += dval(&u);
if (dval(&u) > ds || (dval(&u) == ds && L & 1)) {
#ifdef ROUND_BIASED
if (dval(&u) >= ds)
#else
if (dval(&u) > ds || (dval(&u) == ds && L & 1))
#endif
{
bump_up:
while(*--s == '9')
if (s == s0) {
@ -4106,15 +4141,6 @@ dtoa
* and for all and pass them and a shift to quorem, so it
* can do shifts and ors to compute the numerator for q.
*/
#ifdef Pack_32
if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f))
i = 32 - i;
#define iInc 28
#else
if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf)
i = 16 - i;
#define iInc 12
#endif
i = dshift(S, s2);
b2 += i;
m2 += i;
@ -4207,7 +4233,11 @@ dtoa
if (j1 > 0) {
b = lshift(b, 1);
j1 = cmp(b, S);
#ifdef ROUND_BIASED
if (j1 >= 0 /*)*/
#else
if ((j1 > 0 || (j1 == 0 && dig & 1))
#endif
&& dig++ == '9')
goto round_9_up;
}
@ -4267,7 +4297,12 @@ dtoa
#endif
b = lshift(b, 1);
j = cmp(b, S);
if (j > 0 || (j == 0 && dig & 1)) {
#ifdef ROUND_BIASED
if (j >= 0)
#else
if (j > 0 || (j == 0 && dig & 1))
#endif
{
roundoff:
while(*--s == '9')
if (s == s0) {

View File

@ -284,7 +284,7 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void)
long pageCount = sysconf(_SC_PHYS_PAGES);
bytes = (PRUint64) pageSize * pageCount;
#elif defined(NETBSD)
#elif defined(NETBSD) || defined(OPENBSD)
int mib[2];
int rc;

View File

@ -52,9 +52,9 @@
#include <stdlib.h>
/*
* This release (4.8.7) is backward compatible with the
* This release (4.8.8) is backward compatible with the
* 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
* 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, and 4.8.6 releases.
* 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6 and 4.8.7 releases.
* It, of course, is compatible with itself.
*/
static char *compatible_version[] = {
@ -66,7 +66,7 @@ static char *compatible_version[] = {
"4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
"4.7.6",
"4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
"4.8.6", PR_VERSION
"4.8.6", "4.8.7", PR_VERSION
};
/*