author | Wan-Teh Chang <wtc@google.com> |
Mon, 12 Nov 2012 17:44:12 -0800 | |
changeset 113048 | 0d124d4f28b0d3365ae7c4ec0ab4b2a99e399405 |
parent 113047 | de9fff3a523240b175c0aca822911011b926d64d |
child 113049 | 85b3e7667edc32526740f1391709b730d63f6ba5 |
push id | 17908 |
push user | wtc@google.com |
push date | Tue, 13 Nov 2012 01:44:22 +0000 |
treeherder | mozilla-inbound@0d124d4f28b0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 757593, 804806, 804833 |
milestone | 19.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/nsprpub/admin/repackage.sh +++ b/nsprpub/admin/repackage.sh @@ -27,20 +27,20 @@ # Note! Files written with Gnu tar are not readable by some non-Gnu # versions. Sun, in particular. # # # # # ------------------------------------------------------------------ -FROMTOP=/share/builds/components/nspr20/v4.9.3 -TOTOP=./v4.9.3 -NSPRDIR=nspr-4.9.3 -SOURCETAG=NSPR_4_9_3_RTM +FROMTOP=/share/builds/components/nspr20/v4.9.4 +TOTOP=./v4.9.4 +NSPRDIR=nspr-4.9.4 +SOURCETAG=NSPR_4_9_4_RTM # # enumerate Unix object directories on /s/b/c UNIX_OBJDIRS=" HP-UXB.11.11_64_DBG.OBJ HP-UXB.11.11_64_OPT.OBJ HP-UXB.11.11_DBG.OBJ HP-UXB.11.11_OPT.OBJ
--- a/nsprpub/config/pathsub.h +++ b/nsprpub/config/pathsub.h @@ -8,20 +8,16 @@ /* ** Pathname subroutines. ** ** Brendan Eich, 8/29/95 */ #include <limits.h> #include <sys/types.h> -#if SUNOS4 -#include "../pr/include/md/sunos4.h" -#endif - #ifndef PATH_MAX #define PATH_MAX 1024 #endif /* * Just prevent stupidity */ #undef NAME_MAX
--- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -5,9 +5,8 @@ /* * A dummy header file that is a dependency for all the object files. * Used to force a full recompilation of NSPR in Mozilla's Tinderbox * depend builds. See comments in rules.mk. */ #error "Do not include this header file." -
--- a/nsprpub/configure +++ b/nsprpub/configure @@ -731,17 +731,17 @@ echo "$ac_t""$build" 1>&6 test "$host_alias" != "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=9 -MOD_PATCH_VERSION=3 +MOD_PATCH_VERSION=4 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= USE_USER_PTHREADS= USE_NSPR_THREADS= USE_N32= USE_64= USE_CPLUS= @@ -4772,90 +4772,16 @@ EOF OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV' OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV' DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV' fi _DEBUG_FLAGS=-Zi _OPTIMIZE_FLAGS=-O2 ;; -*-ncr-sysv*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define SVR4 1 -EOF - - cat >> confdefs.h <<\EOF -#define SYSV 1 -EOF - - cat >> confdefs.h <<\EOF -#define NCR 1 -EOF - - USE_NSPR_THREADS=1 - if test "$OS_RELEASE" = "2.03"; then - cat >> confdefs.h <<\EOF -#define _PR_STAT_HAS_ST_ATIM 1 -EOF - - else - cat >> confdefs.h <<\EOF -#define _PR_STAT_HAS_ST_ATIM_UNION 1 -EOF - - fi - - if test -z "$GNU_CC"; then - CFLAGS="$CFLAGS -Hnocopyr" - CXXFLAGS="$CXXFLAGS -Hnocopyr" - else - CFLAGS="$CFLAGS -fPIC -Wall" - CXXFLAGS="$CXXFLAGS -fPIC -Wall" - DSO_LDOPTS=-G - fi - MDCPUCFG_H=_ncr.cfg - PR_MD_CSRCS=ncr.c - ;; - -mips-nec-sysv*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define SVR4 1 -EOF - - cat >> confdefs.h <<\EOF -#define __SVR4 1 -EOF - - cat >> confdefs.h <<\EOF -#define NEC 1 -EOF - - cat >> confdefs.h <<\EOF -#define nec_ews 1 -EOF - - USE_NSPR_THREADS=1 - if test -z "$GNU_CC"; then - CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000' - CXX=g++ - fi - OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl" - DSO_LDOPTS=-G - MDCPUCFG_H=_nec.cfg - PR_MD_CSRCS=nec.c - ;; - *-netbsd*) cat >> confdefs.h <<\EOF #define XP_UNIX 1 EOF cat >> confdefs.h <<\EOF #define NETBSD 1 EOF @@ -4887,79 +4813,16 @@ EOF fi fi if test "$LIBRUNPATH"; then DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH" fi ;; -mips-sony-newsos*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define SONY 1 -EOF - - cat >> confdefs.h <<\EOF -#define SYSV 1 -EOF - - cat >> confdefs.h <<\EOF -#define SVR4 1 -EOF - - cat >> confdefs.h <<\EOF -#define __svr4 1 -EOF - - cat >> confdefs.h <<\EOF -#define __svr4__ 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SVID_GETTOD 1 -EOF - - USE_NSPR_THREADS=1 - CFLAGS="$CFLAGS -Xa -fullwarn" - CXXFLAGS="$CXXFLAGS -Xa -fullwarn" - DSO_LDOPTS=-G - MDCPUCFG_H=_sony.cfg - PR_MD_CSRCS=sony.c - ;; - -*-nextstep*|*-openstep*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define NEXTSTEP 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_BSD_FLOCK 1 -EOF - - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix" - CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix" - USE_NSPR_THREADS=1 - DLL_SUFFIX=dylib - MDCPUCFG_H=_nextstep.cfg - PR_MD_CSRCS=nextstep.c - ;; - - *-nto*) cat >> confdefs.h <<\EOF #define XP_UNIX 1 EOF cat >> confdefs.h <<\EOF #define NTO 1 EOF @@ -5043,27 +4906,27 @@ EOF if test -z "$GNU_CC"; then CC="$CC -std1 -ieee_with_inexact" if test "$OS_RELEASE" != "V2.0"; then CC="$CC -readonly_strings" fi _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:5052: checking for machine/builtins.h" >&5 +echo "configure:4915: checking for machine/builtins.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5057 "configure" +#line 4920 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -5181,106 +5044,16 @@ EOF CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w' USE_NSPR_THREADS=1 CPU_ARCH=x86 DSO_LDOPTS='-b elf -G' MDCPUCFG_H=_scoos.cfg PR_MD_SRCS=scoos.c ;; -*-sinix*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define SVR4 1 -EOF - - cat >> confdefs.h <<\EOF -#define SNI 1 -EOF - - cat >> confdefs.h <<\EOF -#define RELIANTUNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define sinix 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SVID_GETTOD 1 -EOF - - if echo "$OS_TEST" | grep -c 86 2>/dev/null; then - cat >> confdefs.h <<\EOF -#define i386 1 -EOF - - CPU_ARCH=x86 - else - CPU_ARCH=mips - fi - - if test "$GNU_CC"; then - AS='$(CC) -x assembler-with-cpp' - if test "$CPU_ARCH" = "mips"; then - LD=gld - fi - CFLAGS="$CFLAGS -Wall -Wno-format" - else - AS='/usr/bin/cc' - _OPTIMIZE_FLAGS='-O -F Olimit,4000' - fi - - DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)' - - if test "$OS_RELEASE" = "5.43"; then - cat >> confdefs.h <<\EOF -#define IP_MULTICAST 1 -EOF - - fi - - OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc" - USE_NSPR_THREADS=1 - MDCPUCFG_H=_reliantunix.cfg - PR_MD_CSRCS=reliantunix.c - if test "${OS_ARCH}" = "mips"; then - PR_MD_ASFILES=os_ReliantUNIX.s - fi - ;; - -*-sunos*) - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define SUNOS4 1 -EOF - - CFLAGS="$CFLAGS -Wall -Wno-format" - if test "$USE_MDUPDATE"; then - CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)" - fi - CPU_ARCH=sparc - DLL_SUFFIX=so.1.0 - DSO_LDOPTS= - DSO_CFLAGS=-fPIC - USE_NSPR_THREADS=1 - if test "$OS_RELEASE" = "4.1.3_U1"; then - _OPTIMIZE_FLAGS= - OS_LIBS="$OS_LIBS -lm" - fi - MDCPUCFG_H=_sunos4.cfg - PR_MD_CSRCS=sunos4.c - ;; - *-solaris*) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi cat >> confdefs.h <<\EOF #define XP_UNIX 1 EOF @@ -5702,63 +5475,63 @@ if test -z "$SKIP_LIBRARY_CHECKS"; then case $target in *-darwin*|*-beos*|*-os2*) ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5711: checking for dlopen in -ldl" >&5 +echo "configure:5484: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 5719 "configure" +#line 5492 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen(); int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5747: checking for dlfcn.h" >&5 +echo "configure:5520: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5752 "configure" +#line 5525 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -5781,23 +5554,23 @@ fi ;; esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5790: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5563: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 5796 "configure" +#line 5569 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes @@ -5805,17 +5578,17 @@ else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 5814 "configure" +#line 5587 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes @@ -5831,22 +5604,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional fi fi _SAVE_LIBS="$LIBS" LIBS="$LIBS $OS_LIBS" for ac_func in lchown strerror dladdr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5840: checking for $ac_func" >&5 +echo "configure:5613: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5845 "configure" +#line 5618 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); @@ -5859,17 +5632,17 @@ int main() { #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF -if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi @@ -5911,17 +5684,17 @@ if test "$CCACHE" != "no"; then fi fi fi for ac_prog in $CCACHE ccache do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5920: checking for $ac_word" >&5 +echo "configure:5693: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$CCACHE" in /*) ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path. ;; ?:/*) @@ -5970,17 +5743,17 @@ if test "${enable_strip+set}" = set; the fi case "${target_os}" in hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5979: checking for +Olit support" >&5 +echo "configure:5752: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_hpux_usable_olit_option=no rm -f conftest* echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -6012,17 +5785,17 @@ darwin*) _HAVE_PTHREADS=1 ;; wince*) _HAVE_PTHREADS= ;; *) echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:6021: checking for pthread_create in -lpthreads" >&5 +echo "configure:5794: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } @@ -6034,17 +5807,17 @@ echo " rm -f dummy.c dummy${ac_exeext} ; if test "$_res" = "0"; then echo "$ac_t""yes" 1>&6 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:6043: checking for pthread_create in -lpthread" >&5 +echo "configure:5816: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } @@ -6056,17 +5829,17 @@ echo " rm -f dummy.c dummy${ac_exeext} ; if test "$_res" = "0"; then echo "$ac_t""yes" 1>&6 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:6065: checking for pthread_create in -lc_r" >&5 +echo "configure:5838: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } @@ -6078,17 +5851,17 @@ echo " rm -f dummy.c dummy${ac_exeext} ; if test "$_res" = "0"; then echo "$ac_t""yes" 1>&6 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:6087: checking for pthread_create in -lc" >&5 +echo "configure:5860: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } @@ -6196,17 +5969,17 @@ if test "${enable_ipv6+set}" = set; then fi fi if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:6205: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5978: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthread=yes case "$target_os" in freebsd*) # Freebsd doesn't use -pthread for compiles, it uses them for linking @@ -6219,17 +5992,17 @@ echo "configure:6205: checking whether $ fi fi rm -f conftest* echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:6228: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:6001: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthreads=yes CFLAGS="$CFLAGS -pthreads" CXXFLAGS="$CXXFLAGS -pthreads" fi
--- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -10,17 +10,17 @@ AC_INIT(config/libc_r.h) AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) AC_CANONICAL_SYSTEM dnl ======================================================== dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=9 -MOD_PATCH_VERSION=3 +MOD_PATCH_VERSION=4 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= USE_USER_PTHREADS= USE_NSPR_THREADS= USE_N32= USE_64= USE_CPLUS= @@ -2060,57 +2060,16 @@ tools are selected during the Xcode/Deve OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV' OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV' DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV' fi _DEBUG_FLAGS=-Zi _OPTIMIZE_FLAGS=-O2 ;; -*-ncr-sysv*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(SVR4) - AC_DEFINE(SYSV) - AC_DEFINE(NCR) - USE_NSPR_THREADS=1 - if test "$OS_RELEASE" = "2.03"; then - AC_DEFINE(_PR_STAT_HAS_ST_ATIM) - else - AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION) - fi - - if test -z "$GNU_CC"; then - CFLAGS="$CFLAGS -Hnocopyr" - CXXFLAGS="$CXXFLAGS -Hnocopyr" - else - CFLAGS="$CFLAGS -fPIC -Wall" - CXXFLAGS="$CXXFLAGS -fPIC -Wall" - DSO_LDOPTS=-G - fi - MDCPUCFG_H=_ncr.cfg - PR_MD_CSRCS=ncr.c - ;; - -mips-nec-sysv*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(SVR4) - AC_DEFINE(__SVR4) - AC_DEFINE(NEC) - AC_DEFINE(nec_ews) - USE_NSPR_THREADS=1 - if test -z "$GNU_CC"; then - CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000' - CXX=g++ - fi - OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl" - DSO_LDOPTS=-G - MDCPUCFG_H=_nec.cfg - PR_MD_CSRCS=nec.c - ;; - *-netbsd*) AC_DEFINE(XP_UNIX) AC_DEFINE(NETBSD) AC_DEFINE(HAVE_BSD_FLOCK) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi MDCPUCFG_H=_netbsd.cfg @@ -2133,46 +2092,16 @@ mips-nec-sysv*) fi fi if test "$LIBRUNPATH"; then DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH" fi ;; -mips-sony-newsos*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(SONY) - AC_DEFINE(SYSV) - AC_DEFINE(SVR4) - AC_DEFINE(__svr4) - AC_DEFINE(__svr4__) - AC_DEFINE(HAVE_SVID_GETTOD) - USE_NSPR_THREADS=1 - CFLAGS="$CFLAGS -Xa -fullwarn" - CXXFLAGS="$CXXFLAGS -Xa -fullwarn" - DSO_LDOPTS=-G - MDCPUCFG_H=_sony.cfg - PR_MD_CSRCS=sony.c - ;; - -*-nextstep*|*-openstep*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(NEXTSTEP) - AC_DEFINE(HAVE_BSD_FLOCK) - AC_DEFINE(_POSIX_SOURCE) - CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix" - CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix" - USE_NSPR_THREADS=1 - DLL_SUFFIX=dylib - MDCPUCFG_H=_nextstep.cfg - PR_MD_CSRCS=nextstep.c - ;; - - *-nto*) AC_DEFINE(XP_UNIX) AC_DEFINE(NTO) AC_DEFINE(_QNX_SOURCE) AC_DEFINE(HAVE_POINTER_LOCALTIME_R) MDCPUCFG_H=_nto.cfg PR_MD_CSRCS=nto.c MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@' @@ -2275,76 +2204,16 @@ mips-sony-newsos*) CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w' USE_NSPR_THREADS=1 CPU_ARCH=x86 DSO_LDOPTS='-b elf -G' MDCPUCFG_H=_scoos.cfg PR_MD_SRCS=scoos.c ;; -*-sinix*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(SVR4) - AC_DEFINE(SNI) - AC_DEFINE(RELIANTUNIX) - AC_DEFINE(sinix) - AC_DEFINE(HAVE_SVID_GETTOD) - if echo "$OS_TEST" | grep -c 86 2>/dev/null; then - AC_DEFINE(i386) - CPU_ARCH=x86 - else - CPU_ARCH=mips - fi - - if test "$GNU_CC"; then - AS='$(CC) -x assembler-with-cpp' - if test "$CPU_ARCH" = "mips"; then - LD=gld - fi - CFLAGS="$CFLAGS -Wall -Wno-format" - else - AS='/usr/bin/cc' - _OPTIMIZE_FLAGS='-O -F Olimit,4000' - fi - - DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)' - - if test "$OS_RELEASE" = "5.43"; then - AC_DEFINE(IP_MULTICAST) - fi - - OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc" - USE_NSPR_THREADS=1 - MDCPUCFG_H=_reliantunix.cfg - PR_MD_CSRCS=reliantunix.c - if test "${OS_ARCH}" = "mips"; then - PR_MD_ASFILES=os_ReliantUNIX.s - fi - ;; - -*-sunos*) - AC_DEFINE(XP_UNIX) - AC_DEFINE(SUNOS4) - CFLAGS="$CFLAGS -Wall -Wno-format" - if test "$USE_MDUPDATE"; then - CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)" - fi - CPU_ARCH=sparc - DLL_SUFFIX=so.1.0 - DSO_LDOPTS= - DSO_CFLAGS=-fPIC - USE_NSPR_THREADS=1 - if test "$OS_RELEASE" = "4.1.3_U1"; then - _OPTIMIZE_FLAGS= - OS_LIBS="$OS_LIBS -lm" - fi - MDCPUCFG_H=_sunos4.cfg - PR_MD_CSRCS=sunos4.c - ;; - *-solaris*) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi AC_DEFINE(XP_UNIX) AC_DEFINE(SVR4) AC_DEFINE(SYSV) AC_DEFINE(__svr4)
--- a/nsprpub/pr/include/md/_aix.h +++ b/nsprpub/pr/include/md/_aix.h @@ -50,25 +50,26 @@ #endif #endif #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #define _PR_ACCEPT_INHERIT_NONBLOCK /* Timer operations */ #if defined(AIX_TIMERS) +#define _MD_INTERVAL_INIT() + extern PRIntervalTime _MD_AixGetInterval(void); #define _MD_GET_INTERVAL _MD_AixGetInterval extern PRIntervalTime _MD_AixIntervalPerSec(void); #define _MD_INTERVAL_PER_SEC _MD_AixIntervalPerSec #else /* defined(AIX_TIMERS) */ -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #endif /* defined(AIX_TIMERS) */ #ifdef AIX_HAVE_ATOMIC_OP_H /* The atomic operations */ #include <sys/atomic_op.h> #define _PR_HAVE_ATOMIC_OPS #ifndef IS_64 #define _PR_HAVE_ATOMIC_CAS
--- a/nsprpub/pr/include/md/_bsdi.h +++ b/nsprpub/pr/include/md/_bsdi.h @@ -171,12 +171,11 @@ struct _MDCPU { #endif /* ! _PR_PTHREADS */ #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #include <sys/syscall.h> #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #endif /* nspr_bsdi_defs_h___ */
--- a/nsprpub/pr/include/md/_darwin.h +++ b/nsprpub/pr/include/md/_darwin.h @@ -275,22 +275,24 @@ extern void _MD_SET_PRIORITY(struct _MDT extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout); extern PRStatus _MD_WAKEUP_WAITER(PRThread *); extern void _MD_YIELD(void); #endif /* ! _PR_PTHREADS */ #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_INIT _PR_Mach_IntervalInit +#define _MD_GET_INTERVAL _PR_Mach_GetInterval +#define _MD_INTERVAL_PER_SEC _PR_Mach_TicksPerSecond extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); +extern void _PR_Mach_IntervalInit(void); +extern PRIntervalTime _PR_Mach_GetInterval(void); +extern PRIntervalTime _PR_Mach_TicksPerSecond(void); /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) /* For writev() */
--- a/nsprpub/pr/include/md/_dgux.h +++ b/nsprpub/pr/include/md/_dgux.h @@ -153,18 +153,17 @@ struct _MDCPU { #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() /* * The following are copied from _sunos.h, _aix.h. This means * some of them should probably be moved into _unixos.h. But * _irix.h seems to be quite different in regard to these macros. */ -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/_freebsd.h +++ b/nsprpub/pr/include/md/_freebsd.h @@ -210,23 +210,20 @@ extern PRStatus _MD_CREATE_THREAD( extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri); extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout); extern PRStatus _MD_WAKEUP_WAITER(PRThread *); extern void _MD_YIELD(void); #endif /* ! _PR_PTHREADS */ extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) #if defined(_PR_POLL_AVAILABLE)
--- a/nsprpub/pr/include/md/_hpux.h +++ b/nsprpub/pr/include/md/_hpux.h @@ -264,18 +264,17 @@ struct _MDCPU { #if defined(HPUX_LW_TIMER) extern void _PR_HPUX_LW_IntervalInit(void); extern PRIntervalTime _PR_HPUX_LW_GetInterval(void); #define _MD_INTERVAL_INIT _PR_HPUX_LW_IntervalInit #define _MD_GET_INTERVAL _PR_HPUX_LW_GetInterval #define _MD_INTERVAL_PER_SEC() 1000 #else -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #endif /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
--- a/nsprpub/pr/include/md/_linux.h +++ b/nsprpub/pr/include/md/_linux.h @@ -621,23 +621,20 @@ extern PRStatus _MD_CREATE_THREAD( extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri); extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout); extern PRStatus _MD_WAKEUP_WAITER(PRThread *); extern void _MD_YIELD(void); #endif /* ! _PR_PTHREADS */ extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define HAVE_CLOCK_MONOTONIC /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT __select #ifdef _PR_POLL_AVAILABLE
deleted file mode 100644 --- a/nsprpub/pr/include/md/_ncr.cfg +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef NCR -#define NCR -#endif - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#undef HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#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_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#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_POLL_BACKCOMPAT - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_ncr.h +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_unixware_defs_h___ -#define nspr_unixware_defs_h___ - -/* - * Internal configuration macros - */ - -#define PR_LINKER_ARCH "ncr" -#define _PR_SI_SYSNAME "NCR" -#define _PR_SI_ARCHITECTURE "x86" -#define PR_DLL_SUFFIX ".so" - -#define _PR_VMBASE 0x30000000 -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE 65536L -#define _MD_MMAP_FLAGS MAP_PRIVATE - -#define HAVE_DLL -#define USE_DLFCN -#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */ - -#if !defined (HAVE_STRERROR) -#define HAVE_STRERROR -#endif - -#ifndef HAVE_WEAK_IO_SYMBOLS -#define HAVE_WEAK_IO_SYMBOLS -#endif - -#define _PR_POLL_AVAILABLE -#define _PR_USE_POLL -#define _PR_NO_LARGE_FILES - -#undef HAVE_STACK_GROWING_UP -#define HAVE_NETCONFIG -#define NEED_STRFTIME_LOCK -#define NEED_TIME_R -#define NEED_LOCALTIME_R -#define NEED_GMTIME_R -#define NEED_ASCTIME_R -#define NEED_STRTOK_R -#define NEED_CTIME_R -#define _PR_NEED_STRCASECMP - -#define USE_SETJMP - -#include <setjmp.h> - -#define _SETJMP setjmp -#define _LONGJMP longjmp -#define _PR_CONTEXT_TYPE jmp_buf -#define _MD_GET_SP(_t) (_t)->md.context[4] -#define _PR_NUM_GCREGS _JBLEN - -#define CONTEXT(_th) ((_th)->md.context) - -/* -** Initialize the thread context preparing it to execute _main. -*/ -#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ -{ \ - *status = PR_TRUE; \ - if(_SETJMP(CONTEXT(_thread))) (*_main)(); \ - _MD_GET_SP(_thread) = (int) ((_sp) - 128); \ -} - -#define _MD_SWITCH_CONTEXT(_thread) \ - if (!_SETJMP(CONTEXT(_thread))) { \ - (_thread)->md.errcode = errno; \ - _PR_Schedule(); \ - } - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ -{ \ - errno = (_thread)->md.errcode; \ - _MD_SET_CURRENT_THREAD(_thread); \ - _LONGJMP(CONTEXT(_thread), 1); \ -} - -/* Machine-dependent (MD) data structures. - * Don't use SVR4 native threads (yet). - */ - -struct _MDThread { - _PR_CONTEXT_TYPE context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -/* - * The following are copied from _sunos.h, _aix.h. This means - * some of them should probably be moved into _unixos.h. But - * _irix.h seems to be quite different in regard to these macros. - */ -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_SUSPEND_THREAD(thread) -#define _MD_RESUME_THREAD(thread) -#define _MD_CLEAN_THREAD(_thread) - -/* - * We wrapped the select() call. _MD_SELECT refers to the built-in, - * unwrapped version. - */ -#include <sys/time.h> -#include <sys/types.h> -#include <sys/select.h> -extern int _select(int nfds, fd_set *readfds, fd_set *writefds, - fd_set *execptfds, struct timeval *timeout); -#define _MD_SELECT _select - -#define _MD_POLL _poll -extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout); - -#endif /* nspr_ncr_defs_h */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_nec.cfg +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef NEC -#define NEC -#endif - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#undef HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#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 8 -#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 - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_nec.h +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_nec_defs_h___ -#define nspr_nec_defs_h___ - -/* - * Internal configuration macros - */ - -#define PR_LINKER_ARCH "nec" -#define _PR_SI_SYSNAME "NEC" -#define _PR_SI_ARCHITECTURE "mips" -#define PR_DLL_SUFFIX ".so" - -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE 65536L -#define _MD_MMAP_FLAGS MAP_PRIVATE - -#undef HAVE_STACK_GROWING_UP -#define HAVE_DLL -#define USE_DLFCN -#define NEED_TIME_R -#define NEED_STRFTIME_LOCK -#define _PR_POLL_AVAILABLE -#define _PR_USE_POLL -#define _PR_NO_LARGE_FILES -#define _PR_STAT_HAS_ST_ATIM_UNION - -#include <ucontext.h> -#include <sys/regset.h> - -#define PR_NUM_GCREGS NGREG -#define PR_CONTEXT_TYPE ucontext_t - -#define CONTEXT(_thread) (&(_thread)->md.context) - -#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gregs[CXT_SP] - -/* -** Initialize the thread context preparing it to execute "e(o,a)" -*/ -#define _MD_INIT_CONTEXT(thread, _sp, _main, status) \ -{ \ - *status = PR_TRUE; \ - getcontext(CONTEXT(thread)); \ - CONTEXT(thread)->uc_stack.ss_sp = (char*) (thread)->stack->stackBottom; \ - CONTEXT(thread)->uc_stack.ss_size = (thread)->stack->stackSize; \ - _MD_GET_SP(thread) = (greg_t) _sp - 64; \ - makecontext(CONTEXT(thread), _main, 0); \ -} - -#define _MD_SWITCH_CONTEXT(_thread) \ - if (!getcontext(CONTEXT(_thread))) { \ - (_thread)->md.errcode = errno; \ - _PR_Schedule(); \ - } - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ -{ \ - ucontext_t *uc = CONTEXT(_thread); \ - uc->uc_mcontext.gregs[CXT_V0] = 1; \ - uc->uc_mcontext.gregs[CXT_A3] = 0; \ - errno = (_thread)->md.errcode; \ - _MD_SET_CURRENT_THREAD(_thread); \ - setcontext(uc); \ -} - -/* Machine-dependent (MD) data structures */ - -struct _MDThread { - PR_CONTEXT_TYPE context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_CLEAN_THREAD(_thread) - -#define _MD_SELECT _select -#define _MD_POLL _poll - -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -#endif /* nspr_nec_defs_h___ */
--- a/nsprpub/pr/include/md/_netbsd.h +++ b/nsprpub/pr/include/md/_netbsd.h @@ -203,23 +203,20 @@ struct _MDCPU { #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread #define _MD_RESUME_THREAD(thread) _MD_resume_thread #define _MD_CLEAN_THREAD(_thread) #endif /* ! _PR_PTHREADS */ extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) #if defined(_PR_POLL_AVAILABLE) #include <poll.h>
deleted file mode 100644 --- a/nsprpub/pr/include/md/_nextstep.cfg +++ /dev/null @@ -1,223 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef NEXTSTEP -#define NEXTSTEP -#endif - -/* Platform specific -*/ -#if defined(__sparc__) - -/* Check these -*/ -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#define HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#define HAVE_ALIGNED_LONGLONGS 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 -/* Taken from _solaris.cfg -*/ -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#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 -/* Taken from _solaris.cfg -*/ -#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 -/* Taken from _solaris.cfg -*/ -#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 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 - -#define PR_WORDS_PER_DWORD_LOG2 1 - -#elif defined(__m68k__) - -/* Check these -*/ -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#define HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#define HAVE_ALIGNED_LONGLONGS 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_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#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 2 -#define PR_ALIGN_OF_LONG 2 -#define PR_ALIGN_OF_INT64 2 -#define PR_ALIGN_OF_FLOAT 2 -#define PR_ALIGN_OF_DOUBLE 2 -#define PR_ALIGN_OF_POINTER 2 - -#define PR_WORDS_PER_DWORD_LOG2 1 - -#elif defined(__i386__) - -/* Check these -*/ -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#define HAVE_ALIGNED_LONGLONGS 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 -#define PR_WORDS_PER_DWORD_LOG2 1 -#endif /* defined(__somearch__) */ - - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_nextstep.h +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_nextstep_defs_h___ -#define nspr_nextstep_defs_h___ - -#include "prthread.h" - -#include <bsd/libc.h> -#include <bsd/syscall.h> - -/* syscall() is not declared in NEXTSTEP's syscall.h ... -*/ -extern int syscall(int number, ...); - -/* - * Internal configuration macros - */ - -#define PR_LINKER_ARCH "nextstep" -#define _PR_SI_SYSNAME "NEXTSTEP" -#if defined(__sparc__) -#define _PR_SI_ARCHITECTURE "sparc" -#elif defined(__m68k__) -#define _PR_SI_ARCHITECTURE "m68k" -#elif defined(__i386__) -#define _PR_SI_ARCHITECTURE "x86" -#else -error Unknown NEXTSTEP architecture -#endif -#define PR_DLL_SUFFIX ".so" - -#define _PR_VMBASE 0x30000000 -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE 65536L -#define _MD_MMAP_FLAGS MAP_PRIVATE - -#undef HAVE_STACK_GROWING_UP - -#define HAVE_WEAK_MALLOC_SYMBOLS - -#define HAVE_DLL -#define USE_MACH_DYLD -#define _PR_STAT_HAS_ONLY_ST_ATIME -#define _PR_NO_LARGE_FILES - -#define USE_SETJMP - -#ifndef _PR_PTHREADS - -#include <setjmp.h> - -#define PR_CONTEXT_TYPE jmp_buf - -#define CONTEXT(_th) ((_th)->md.context) - -/* balazs.pataki@sztaki.hu: -** __sparc__ is checked -** __m68k__ is checked -** __i386__ is a guess (one of the two defines should work) -*/ -#if defined(__sparc__) -#define _MD_GET_SP(_th) (_th)->md.context[2] -#elif defined(__m68k__) -#define _MD_GET_SP(_th) (_th)->md.context[2] -#elif defined(__i386__) -/* One of this two must be OK ... try using sc_onstack -*/ -#define _MD_GET_SP(_th) (((struct sigcontext *) (_th)->md.context)->sc_onstack) -//#define _MD_GET_SP(_th) (_th)->md.context[0].sc_esp -#else -error Unknown NEXTSTEP architecture -#endif - -#define PR_NUM_GCREGS _JBLEN - -/* -** Initialize a thread context to run "_main()" when started -*/ -#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ -{ \ - *status = PR_TRUE; \ - if (setjmp(CONTEXT(_thread))) { \ - _main(); \ - } \ - _MD_GET_SP(_thread) = (int) ((_sp) - 64); \ -} - -#define _MD_SWITCH_CONTEXT(_thread) \ - if (!setjmp(CONTEXT(_thread))) { \ - (_thread)->md.errcode = errno; \ - _PR_Schedule(); \ - } - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ -{ \ - errno = (_thread)->md.errcode; \ - _MD_SET_CURRENT_THREAD(_thread); \ - longjmp(CONTEXT(_thread), 1); \ -} - -/* Machine-dependent (MD) data structures */ - -struct _MDThread { - PR_CONTEXT_TYPE context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -extern PRStatus _MD_InitializeThread(PRThread *thread); - -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread -#define _MD_RESUME_THREAD(thread) _MD_resume_thread -#define _MD_CLEAN_THREAD(_thread) - -extern PRStatus _MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize); -extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri); -extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout); -extern PRStatus _MD_WAKEUP_WAITER(PRThread *); -extern void _MD_YIELD(void); - -#endif /* ! _PR_PTHREADS */ - -extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -/* - * We wrapped the select() call. _MD_SELECT refers to the built-in, - * unwrapped version. - */ -#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) - -/* For writev() */ -#include <sys/uio.h> - -/* signal.h */ -/* balazs.pataki@sztaki.hu: this is stolen from sunos4.h. The things is that -** NEXTSTEP doesn't support these flags for `struct sigaction's sa_flags, so -** I have to fake them ... -*/ -#define SA_RESTART 0 - -/* mmap */ -/* balazs.pataki@sztaki.hu: NEXTSTEP doesn't have mmap, at least not -** publically. We have sys/mman.h, but it doesn't declare mmap(), and -** PROT_NONE is also missing. syscall.h has entries for mmap, munmap, and -** mprotect so I wrap these in nextstep.c as mmap(), munmap() and mprotect() -** and pray for it to work. -** -*/ -caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, - int fildes, off_t off); -int munmap(caddr_t addr, size_t len); -int mprotect(caddr_t addr, size_t len, int prot); - -/* my_mmap() is implemented in nextstep.c and is based on map_fd() of mach. -*/ -caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags, - int fildes, off_t off); -int my_munmap(caddr_t addr, size_t len); - - -/* string.h -*/ -/* balazs.pataki@sztaki.hu: this is missing so implemenetd in nextstep.c ... -*/ -char *strdup(const char *s1); - -/* unistd.h -*/ -/* balazs.pataki@sztaki.hu: these functions are hidden, though correctly -** implemented in NEXTSTEP. Here I give the declaration for them to be used -** by prmalloc.c, and I have a wrapped syscall() version of them in nextstep.c -*/ -int brk(void *endds); -void *sbrk(int incr); - -#endif /* nspr_nextstep_defs_h___ */
--- a/nsprpub/pr/include/md/_nto.h +++ b/nsprpub/pr/include/md/_nto.h @@ -162,18 +162,17 @@ struct _MDCPU { #define _MD_NEW_LOCK(lock) PR_SUCCESS #define _MD_FREE_LOCK(lock) #define _MD_LOCK(lock) #define _MD_UNLOCK(lock) #define _MD_INIT_IO() #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread) #define _MD_CLEAN_THREAD(_thread)
--- a/nsprpub/pr/include/md/_openbsd.h +++ b/nsprpub/pr/include/md/_openbsd.h @@ -187,18 +187,17 @@ struct _MDCPU { #define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread #define _MD_RESUME_THREAD(thread) _MD_resume_thread #define _MD_CLEAN_THREAD(_thread) #endif /* ! _PR_PTHREADS */ #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD /* * We wrapped the select() call. _MD_SELECT refers to the built-in, * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) #include <poll.h> #define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
--- a/nsprpub/pr/include/md/_osf1.h +++ b/nsprpub/pr/include/md/_osf1.h @@ -181,18 +181,17 @@ struct _MDCPU { #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() /* * The following are copied from _sunos.h, _aix.h. This means * some of them should probably be moved into _unixos.h. But * _irix.h seems to be quite different in regard to these macros. */ -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/_qnx.h +++ b/nsprpub/pr/include/md/_qnx.h @@ -153,18 +153,17 @@ struct _MDCPU { #define _MD_NEW_LOCK(lock) PR_SUCCESS #define _MD_FREE_LOCK(lock) #define _MD_LOCK(lock) #define _MD_UNLOCK(lock) #define _MD_INIT_IO() #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread) #define _MD_CLEAN_THREAD(_thread)
deleted file mode 100644 --- a/nsprpub/pr/include/md/_reliantunix.cfg +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef RELIANTUNIX -#define RELIANTUNIX -#endif - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#undef HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#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_WORD 4 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_DOUBLE 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_WORD 32 -#define PR_BITS_PER_DWORD 64 -#define PR_BITS_PER_DOUBLE 64 - -#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_WORD_LOG2 5 -#define PR_BITS_PER_DWORD_LOG2 6 -#define PR_BITS_PER_DOUBLE_LOG2 6 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 -#define PR_WORDS_PER_DWORD_LOG2 1 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_WORD 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 - -#define _PR_POLL_BACKCOMPAT - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_reliantunix.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * reliantunix.h - * 5/18/96 Taken from nec.h -- chrisk@netscape.com - * 3/14/97 Modified for nspr20 -- chrisk@netscape.com - */ -#ifndef nspr_reliantunix_defs_h___ -#define nspr_reliantunix_defs_h___ - -/* - * Internal configuration macros - */ - -#define PR_LINKER_ARCH "sinix" -#define _PR_SI_SYSNAME "SINIX" -#define _PR_SI_ARCHITECTURE "mips" -#define PR_DLL_SUFFIX ".so" - -#define _PR_VMBASE 0x30000000 -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE (2*65536L) -#define _MD_MMAP_FLAGS MAP_PRIVATE|MAP_FIXED - -#undef HAVE_STACK_GROWING_UP -#define HAVE_DLL -#define USE_DLFCN -#define NEED_STRFTIME_LOCK -#define NEED_TIME_R -#define HAVE_NETCONFIG -#define HAVE_WEAK_IO_SYMBOLS -#define HAVE_WEAK_MALLOC_SYMBOLS -#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */ -#define _PR_POLL_AVAILABLE -#define _PR_USE_POLL -#define _PR_STAT_HAS_ST_ATIM -#define _PR_NO_LARGE_FILES - -/* - * Mike Patnode indicated that it is possibly safe now to use context-switching - * calls that do not change the signal mask, like setjmp vs. sigsetjmp. - * So we'll use our homegrown, getcontext/setcontext-compatible stuff which - * will save us the getcontext/setcontext system calls at each context switch. - * It already works in FastTrack 2.01, so it should do it here :-) - * - chrisk 040497 - */ -#define USE_SETCXT /* temporarily disabled... */ - -#include <ucontext.h> - -#ifdef USE_SETCXT -/* use non-syscall machine language replacement */ -#define _GETCONTEXT getcxt -#define _SETCONTEXT setcxt -/* defined in os_ReliantUNIX.s */ -extern int getcxt(ucontext_t *); -extern int setcxt(ucontext_t *); -#else -#define _GETCONTEXT getcontext -#define _SETCONTEXT setcontext -#endif - -#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gpregs[CXT_SP] -#define _PR_CONTEXT_TYPE ucontext_t -#define _PR_NUM_GCREGS NGREG - -#define CONTEXT(_thread) (&(_thread)->md.context) - -#define _PR_IS_NATIVE_THREAD_SUPPORTED() 0 - -/* -** Machine-dependent (MD) data structures. -*/ -struct _MDThread { - _PR_CONTEXT_TYPE context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -/* -** Initialize the thread context preparing it to execute "_main()" -** - get a nice, fresh context -** - set its SP to the stack we allcoated for it -** - set it to start things at "e" -*/ -#define _MD_INIT_CONTEXT(thread, _sp, _main, status) \ - PR_BEGIN_MACRO \ - *status = PR_TRUE; \ - _GETCONTEXT(CONTEXT(thread)); \ - /* this is supposed to point to the stack BASE, not to SP */ \ - CONTEXT(thread)->uc_stack.ss_sp = thread->stack->stackBottom; \ - CONTEXT(thread)->uc_stack.ss_size = thread->stack->stackSize; \ - CONTEXT(thread)->uc_mcontext.gpregs[CXT_SP] = ((unsigned long)_sp - 128) & 0xfffffff8; \ - CONTEXT(thread)->uc_mcontext.gpregs[CXT_T9] = _main; \ - CONTEXT(thread)->uc_mcontext.gpregs[CXT_EPC] = _main; \ - CONTEXT(thread)->uc_mcontext.gpregs[CXT_RA] = 0; \ - thread->no_sched = 0; \ - PR_END_MACRO - -/* -** Save current context as it is scheduled away -*/ -#define _MD_SWITCH_CONTEXT(_thread) \ - PR_BEGIN_MACRO \ - if (!_GETCONTEXT(CONTEXT(_thread))) { \ - _MD_SAVE_ERRNO(_thread); \ - _MD_SET_LAST_THREAD(_thread); \ - _PR_Schedule(); \ - } \ - PR_END_MACRO - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT or set up -** by _MD_INIT_CONTEXT -** CXT_V0 is the register that holds the return value. -** We must set it to 1 so that we can see if the return from -** getcontext() is the result of calling getcontext() or -** setcontext()... -** setting a context got with getcontext() appears to -** return from getcontext(), too! -** CXT_A3 is the register that holds status when returning -** from a syscall. It is set to 0 to indicate success, -** because we want getcontext() on the other side of the magic -** door to be ok. -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ - PR_BEGIN_MACRO \ - ucontext_t *uc = CONTEXT(_thread); \ - uc->uc_mcontext.gpregs[CXT_V0] = 1;\ - uc->uc_mcontext.gpregs[CXT_A3] = 0;\ - _MD_RESTORE_ERRNO(_thread); \ - _MD_SET_CURRENT_THREAD(_thread); \ - _SETCONTEXT(uc); \ - PR_END_MACRO - -#define _MD_SAVE_ERRNO(t) (t)->md.errcode = errno; -#define _MD_RESTORE_ERRNO(t) errno = (t)->md.errcode; - -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_SUSPEND_THREAD(thread) -#define _MD_RESUME_THREAD(thread) -#define _MD_CLEAN_THREAD(_thread) - -#if !defined(S_ISSOCK) && defined(S_IFSOCK) -#define S_ISSOCK(mode) ((mode&0xF000) == 0xC000) -#endif -#if !defined(S_ISLNK) && defined(S_IFLNK) -#define S_ISLNK(mode) ((mode&0xA000) == 0xC000) -#endif - -#include <sys/time.h> -#include <sys/types.h> -#include <sys/select.h> -extern int _select(int nfds, fd_set *readfds, fd_set *writefds, - fd_set *execptfds, struct timeval *timeout); -#define _MD_SELECT(nfds,r,w,e,tv) _select(nfds,r,w,e,tv) -#define _MD_POLL _poll - -#endif /* nspr_reliantunix_defs_h___ */
--- a/nsprpub/pr/include/md/_riscos.h +++ b/nsprpub/pr/include/md/_riscos.h @@ -149,18 +149,17 @@ struct _MDCPU { #define _MD_NEW_LOCK(lock) PR_SUCCESS #define _MD_FREE_LOCK(lock) #define _MD_LOCK(lock) #define _MD_UNLOCK(lock) #define _MD_INIT_IO() #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread) #define _MD_CLEAN_THREAD(_thread)
--- a/nsprpub/pr/include/md/_scoos.h +++ b/nsprpub/pr/include/md/_scoos.h @@ -158,15 +158,14 @@ struct _MDCPU { #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread) #define _MD_CLEAN_THREAD(_thread) -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_SELECT _select #define _MD_POLL _poll #endif /* nspr_scoos5_defs_h___ */
--- a/nsprpub/pr/include/md/_solaris.h +++ b/nsprpub/pr/include/md/_solaris.h @@ -105,16 +105,17 @@ struct _md_sockaddr_in6 { }; #endif #if defined(_PR_PTHREADS) #define _PR_HAVE_GETHOST_R #define _PR_HAVE_GETHOST_R_POINTER #endif #include "prinrval.h" +#define _MD_INTERVAL_INIT() NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void); #define _MD_GET_INTERVAL _MD_Solaris_GetInterval NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void); #define _MD_INTERVAL_PER_SEC _MD_Solaris_TicksPerSecond #if defined(_PR_HAVE_ATOMIC_OPS) /* ** Atomic Operations @@ -434,19 +435,17 @@ struct _MDCPU_Unix { #define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) #define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 struct _MDCPU { struct _MDCPU_Unix md_unix; }; -#ifndef _PR_PTHREADS #define _MD_INIT_LOCKS() -#endif #define _MD_NEW_LOCK(lock) PR_SUCCESS #define _MD_FREE_LOCK(lock) #define _MD_LOCK(lock) #define _MD_UNLOCK(lock) #define _MD_INIT_IO() #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() @@ -462,21 +461,16 @@ extern PRStatus _MD_WAKEUP_WAITER(struct extern void _MD_YIELD(void); extern PRStatus _MD_InitializeThread(PRThread *thread); extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRThreadPriority newPri); extern PRStatus _MD_CREATE_THREAD(PRThread *thread, void (*start) (void *), PRThreadPriority priority, PRThreadScope scope, PRThreadState state, PRUint32 stackSize); -NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void); -#define _MD_GET_INTERVAL _MD_Solaris_GetInterval -NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void); -#define _MD_INTERVAL_PER_SEC _MD_Solaris_TicksPerSecond - /* The following defines the unwrapped versions of select() and poll(). */ extern int _select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #define _MD_SELECT _select #include <stropts.h> #include <poll.h> #define _MD_POLL _poll
deleted file mode 100644 --- a/nsprpub/pr/include/md/_sony.cfg +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef SONY -#define SONY -#endif - -#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 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#undef HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_sony.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_sony_defs_h___ -#define nspr_sony_defs_h___ - -#define PR_LINKER_ARCH "sony" -#define _PR_SI_SYSNAME "SONY" -#define _PR_SI_ARCHITECTURE "mips" -#define PR_DLL_SUFFIX ".so" - -#define _PR_VMBASE 0x30000000 -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE 65536L -#define _MD_MMAP_FLAGS MAP_PRIVATE - -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -#if defined(_PR_LOCAL_THREADS_ONLY) -#include <ucontext.h> -#include <sys/regset.h> - -#define PR_NUM_GCREGS NGREG -#define PR_CONTEXT_TYPE ucontext_t - -#define CONTEXT(_thread) (&(_thread)->md.context) - -#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gregs[CXT_SP] - -/* -** Initialize the thread context preparing it to execute _main() -*/ -#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ -{ \ - *status = PR_TRUE; \ - getcontext(CONTEXT(_thread)); \ - CONTEXT(_thread)->uc_stack.ss_sp = (char*) (_thread)->stack->stackBottom; \ - CONTEXT(_thread)->uc_stack.ss_size = (_thread)->stack->stackSize; \ - _MD_GET_SP(_thread) = (greg_t) (_sp) - 64; \ - makecontext(CONTEXT(_thread), _main, 0); \ -} - -#define _MD_SWITCH_CONTEXT(_thread) \ - if (!getcontext(CONTEXT(_thread))) { \ - (_thread)->md.errcode = errno; \ - _PR_Schedule(); \ - } - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ -{ \ - ucontext_t *uc = CONTEXT(_thread); \ - uc->uc_mcontext.gregs[CXT_V0] = 1; \ - uc->uc_mcontext.gregs[CXT_A3] = 0; \ - _MD_SET_CURRENT_THREAD(_thread); \ - errno = (_thread)->md.errcode; \ - setcontext(uc); \ -} - -/* Machine-dependent (MD) data structures */ - -struct _MDThread { - PR_CONTEXT_TYPE context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_SUSPEND_THREAD(thread) -#define _MD_RESUME_THREAD(thread) -#define _MD_CLEAN_THREAD(_thread) - -/* The following defines unwrapped versions of select() and poll(). */ -extern int _select (int, fd_set *, fd_set *, fd_set *, struct timeval *); -#define _MD_SELECT _select - -#include <sys/poll.h> -extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout); -#define _MD_POLL _poll - -#endif /* _PR_LOCAL_THREADS_ONLY */ - -#undef HAVE_STACK_GROWING_UP -#define HAVE_DLL -#define USE_DLFCN -#define NEED_TIME_R -#define NEED_STRFTIME_LOCK - -/* -** Missing function prototypes -*/ -extern int gethostname(char *name, int namelen); - -#endif /* nspr_sony_defs_h___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_sunos4.cfg +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef SUNOS4 -#define SUNOS4 -#endif - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#undef HAVE_LONG_LONG -#define HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#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_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#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 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* ifndef nspr_cpucfg___ */
deleted file mode 100644 --- a/nsprpub/pr/include/md/_sunos4.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_sunos_defs_h___ -#define nspr_sunos_defs_h___ - -#include "md/sunos4.h" - -/* On SunOS 4, memset is declared in memory.h */ -#include <memory.h> -#include <errno.h> -#include <sys/syscall.h> - -/* - * Internal configuration macros - */ - -#define PR_LINKER_ARCH "sunos" -#define _PR_SI_SYSNAME "SUNOS" -#define _PR_SI_ARCHITECTURE "sparc" -#define PR_DLL_SUFFIX ".so.1.0" - -/* -** For sunos type machines, don't specify an address because the -** NetBSD/SPARC O.S. does the wrong thing. -*/ -#define _PR_VMBASE 0x30000000 -#define _PR_STACK_VMBASE 0x50000000 -#define _MD_DEFAULT_STACK_SIZE 65536L -#define _MD_MMAP_FLAGS MAP_PRIVATE - -#undef HAVE_STACK_GROWING_UP -#undef HAVE_WEAK_IO_SYMBOLS -#undef HAVE_WEAK_MALLOC_SYMBOLS -#define HAVE_DLL -#define USE_DLFCN -#define NEED_STRFTIME_LOCK -#define NEED_TIME_R -#define HAVE_BSD_FLOCK -#define _PR_NO_LARGE_FILES -#define _PR_STAT_HAS_ONLY_ST_ATIME - -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond - -#define USE_SETJMP - -#include <setjmp.h> - -#define _MD_GET_SP(_t) (_t)->md.context[2] - -#define PR_NUM_GCREGS _JBLEN - -#define CONTEXT(_th) ((_th)->md.context) - -/* -** Initialize the thread context preparing it to execute _main. -*/ -#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ - PR_BEGIN_MACRO \ - int *context = (_thread)->md.context; \ - *status = PR_TRUE; \ - asm("ta 3"); \ - (void) setjmp(context); \ - (_thread)->md.context[2] = (int) ((_sp) - 64); \ - (_thread)->md.context[2] &= ~7; \ - (_thread)->md.context[3] = (int) _main; \ - (_thread)->md.context[4] = (int) _main + 4; \ - PR_END_MACRO - -#define _MD_SWITCH_CONTEXT(_thread) \ - asm("ta 3"); \ - if (!setjmp(CONTEXT(_thread))) { \ - (_thread)->md.errcode = errno; \ - _PR_Schedule(); \ - } - -/* -** Restore a thread context, saved by _MD_SWITCH_CONTEXT -*/ -#define _MD_RESTORE_CONTEXT(_thread) \ -{ \ - errno = (_thread)->md.errcode; \ - _MD_SET_CURRENT_THREAD(_thread); \ - longjmp(CONTEXT(_thread), 1); \ -} - -#pragma unknown_control_flow(longjmp) -#pragma unknown_control_flow(setjmp) -#pragma unknown_control_flow(_PR_Schedule) - -/* -** Missing function prototypes -*/ - -extern int socket (int domain, int type, int protocol); -extern int getsockname (int s, struct sockaddr *name, int *namelen); -extern int getpeername (int s, struct sockaddr *name, int *namelen); -extern int getsockopt (int s, int level, int optname, char* optval, int* optlen); -extern int setsockopt (int s, int level, int optname, const char* optval, int optlen); -extern int accept (int s, struct sockaddr *addr, int *addrlen); -extern int listen (int s, int backlog); -extern int brk(void *); -extern void *sbrk(int); - - -/* Machine-dependent (MD) data structures. SunOS 4 has no native threads. */ - -struct _MDThread { - jmp_buf context; - int id; - int errcode; -}; - -struct _MDThreadStack { - PRInt8 notused; -}; - -struct _MDLock { - PRInt8 notused; -}; - -struct _MDSemaphore { - PRInt8 notused; -}; - -struct _MDCVar { - PRInt8 notused; -}; - -struct _MDSegment { - PRInt8 notused; -}; - -/* - * md-specific cpu structure field - */ -#define _PR_MD_MAX_OSFD FD_SETSIZE - -struct _MDCPU_Unix { - PRCList ioQ; - PRUint32 ioq_timeout; - PRInt32 ioq_max_osfd; - PRInt32 ioq_osfd_cnt; -#ifndef _PR_USE_POLL - fd_set fd_read_set, fd_write_set, fd_exception_set; - PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD], - fd_exception_cnt[_PR_MD_MAX_OSFD]; -#else - struct pollfd *ioq_pollfds; - int ioq_pollfds_size; -#endif /* _PR_USE_POLL */ -}; - -#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ) -#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu)) -#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set) -#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt) -#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set) -#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt) -#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set) -#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt) -#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout) -#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd) -#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt) -#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds) -#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size) - -#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32 - -struct _MDCPU { - struct _MDCPU_Unix md_unix; -}; - -#define _MD_INIT_LOCKS() -#define _MD_NEW_LOCK(lock) PR_SUCCESS -#define _MD_FREE_LOCK(lock) -#define _MD_LOCK(lock) -#define _MD_UNLOCK(lock) -#define _MD_INIT_IO() -#define _MD_IOQ_LOCK() -#define _MD_IOQ_UNLOCK() - -/* These are copied from _solaris.h */ - -#define _MD_EARLY_INIT _MD_EarlyInit -#define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) -#define _MD_INIT_THREAD _MD_InitializeThread -#define _MD_EXIT_THREAD(thread) -#define _MD_SUSPEND_THREAD(thread) -#define _MD_RESUME_THREAD(thread) -#define _MD_CLEAN_THREAD(_thread) - -/* - * We wrapped the select() call. _MD_SELECT refers to the built-in, - * unwrapped version. - */ -#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) -#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout) - -#endif /* nspr_sparc_defs_h___ */
--- a/nsprpub/pr/include/md/_symbian.h +++ b/nsprpub/pr/include/md/_symbian.h @@ -34,20 +34,17 @@ #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #ifndef _PR_PTHREADS #error "Classic NSPR is not implemented" #endif extern void _MD_EarlyInit(void); -extern PRIntervalTime _PR_UNIX_GetInterval(void); -extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD /* For writev() */ #include <sys/uio.h> #endif /* nspr_symbian_defs_h___ */
--- a/nsprpub/pr/include/md/_unixos.h +++ b/nsprpub/pr/include/md/_unixos.h @@ -289,19 +289,32 @@ extern void _MD_FreeSegment(PRSegment * #define _MD_INIT_SEGS _MD_InitSegs #define _MD_ALLOC_SEGMENT _MD_AllocSegment #define _MD_FREE_SEGMENT _MD_FreeSegment #endif /* !defined(_PR_PTHREADS) */ /************************************************************************/ -#if !defined(HPUX_LW_TIMER) +#ifdef _MD_INTERVAL_USE_GTOD +extern PRIntervalTime _PR_UNIX_GetInterval(void); +extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_INTERVAL_INIT() +#define _MD_GET_INTERVAL _PR_UNIX_GetInterval +#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond #endif + +#ifdef HAVE_CLOCK_MONOTONIC +extern PRIntervalTime _PR_UNIX_GetInterval2(void); +extern PRIntervalTime _PR_UNIX_TicksPerSecond2(void); +#define _MD_INTERVAL_INIT() +#define _MD_GET_INTERVAL _PR_UNIX_GetInterval2 +#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond2 +#endif + #define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000) #define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000) /************************************************************************/ #define _MD_ERRNO() (errno) #define _MD_GET_SOCKET_ERROR() (errno)
--- a/nsprpub/pr/include/md/_unixware.h +++ b/nsprpub/pr/include/md/_unixware.h @@ -153,18 +153,17 @@ struct _MDCPU { #define _MD_IOQ_LOCK() #define _MD_IOQ_UNLOCK() /* * The following are copied from _sunos.h, _aix.h. This means * some of them should probably be moved into _unixos.h. But * _irix.h seems to be quite different in regard to these macros. */ -#define _MD_GET_INTERVAL _PR_UNIX_GetInterval -#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond +#define _MD_INTERVAL_USE_GTOD #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_THREAD _MD_InitializeThread #define _MD_EXIT_THREAD(thread) #define _MD_SUSPEND_THREAD(thread) #define _MD_RESUME_THREAD(thread)
--- a/nsprpub/pr/include/md/prosdep.h +++ b/nsprpub/pr/include/md/prosdep.h @@ -56,43 +56,25 @@ PR_BEGIN_EXTERN_C #include "md/_linux.h" #elif defined(OSF1) #include "md/_osf1.h" #elif defined(DARWIN) #include "md/_darwin.h" -#elif defined(NEXTSTEP) -#include "md/_nextstep.h" - #elif defined(SOLARIS) #include "md/_solaris.h" -#elif defined(SUNOS4) -#include "md/_sunos4.h" - -#elif defined(SNI) -#include "md/_reliantunix.h" - -#elif defined(SONY) -#include "md/_sony.h" - -#elif defined(NEC) -#include "md/_nec.h" - #elif defined(SCO) #include "md/_scoos.h" #elif defined(UNIXWARE) #include "md/_unixware.h" -#elif defined(NCR) -#include "md/_ncr.h" - #elif defined(DGUX) #include "md/_dgux.h" #elif defined(QNX) #include "md/_qnx.h" #elif defined(NTO) #include "md/_nto.h"
deleted file mode 100644 --- a/nsprpub/pr/include/md/sunos4.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef pr_sunos4_h___ -#define pr_sunos4_h___ - -#ifndef SVR4 - -/* -** Hodge podge of random missing prototypes for the Sunos4 system -*/ -#include <stdio.h> -#include <stdarg.h> -#include <time.h> -#include <limits.h> -#include <sys/types.h> - -#define PATH_MAX _POSIX_PATH_MAX - -struct timeval; -struct timezone; -struct itimerval; -struct sockaddr; -struct stat; -struct tm; - -/* ctype.h */ -extern int tolower(int); -extern int toupper(int); - -/* errno.h */ -extern char *sys_errlist[]; -extern int sys_nerr; - -#define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0] - -extern void perror(const char *); - -/* getopt */ -extern char *optarg; -extern int optind; -extern int getopt(int argc, char **argv, char *spec); - -/* math.h */ -extern int srandom(long val); -extern long random(void); - -/* memory.h */ -#define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len) - -extern void bcopy(const char *, char *, int); - -/* signal.h */ -/* -** SunOS4 sigaction hides interrupts by default, so we can safely define -** SA_RESTART to 0. -*/ -#define SA_RESTART 0 - -/* stdio.h */ -extern int printf(const char *, ...); -extern int fprintf(FILE *, const char *, ...); -extern int vprintf(const char *, va_list); -extern int vfprintf(FILE *, const char *, va_list); -extern char *vsprintf(char *, const char *, va_list); -extern int scanf(const char *, ...); -extern int sscanf(const char *, const char *, ...); -extern int fscanf(FILE *, const char *, ...); -extern int fgetc(FILE *); -extern int fputc(int, FILE *); -extern int fputs(const char *, FILE *); -extern int puts(const char *); -extern int fread(void *, size_t, size_t, FILE *); -extern int fwrite(const char *, int, int, FILE *); -extern int fseek(FILE *, long, int); -extern long ftell(FILE *); -extern int rewind(FILE *); -extern int fflush(FILE *); -extern int _flsbuf(unsigned char, FILE *); -extern int fclose(FILE *); -extern int remove(const char *); -extern int setvbuf(FILE *, char *, int, size_t); -extern int system(const char *); -extern FILE *popen(const char *, const char *); -extern int pclose(FILE *); - -/* stdlib.h */ -#define strtoul strtol - -extern int isatty(int fildes); -extern long strtol(const char *, char **, int); -extern int putenv(const char *); -extern void srand48(long); -extern long lrand48(void); -extern double drand48(void); - -/* string.h */ -extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *, const char *, size_t); -extern int strcoll(const char *, const char *); - -/* time.h */ -extern time_t mktime(struct tm *); -extern size_t strftime(char *, size_t, const char *, const struct tm *); -extern int gettimeofday(struct timeval *, struct timezone *); -extern int setitimer(int, struct itimerval *, struct itimerval *); -extern time_t time(time_t *); -extern time_t timegm(struct tm *); -extern struct tm *localtime(const time_t *); -extern struct tm *gmtime(const time_t *); - -/* unistd.h */ -extern int rename(const char *, const char *); -extern int ioctl(int, int, int *arg); -extern int connect(int, struct sockaddr *, int); -extern int readlink(const char *, char *, int); -extern int symlink(const char *, const char *); -extern int ftruncate(int, off_t); -extern int fchmod(int, mode_t); -extern int fchown(int, uid_t, gid_t); -extern int lstat(const char *, struct stat *); -extern int fstat(int, struct stat *); -extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); -extern int gethostname(char *, int); -extern char *getwd(char *); -extern int getpagesize(void); - -#endif /* SVR4 */ - -#endif /* pr_sunos4_h___ */
--- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C /* ** NSPR's version is used to determine the likelihood that the version you ** used to build your component is anywhere close to being compatible with ** what is in the underlying library. ** ** The format of the version string is ** "<major version>.<minor version>[.<patch level>] [<Beta>]" */ -#define PR_VERSION "4.9.3" +#define PR_VERSION "4.9.4 Beta" #define PR_VMAJOR 4 #define PR_VMINOR 9 -#define PR_VPATCH 3 -#define PR_BETA PR_FALSE +#define PR_VPATCH 4 +#define PR_BETA PR_TRUE /* ** PRVersionCheck ** ** The basic signature of the function that is called to provide version ** checking. The result will be a boolean that indicates the likelihood ** that the underling library will perform as the caller expects. **
--- a/nsprpub/pr/include/prtime.h +++ b/nsprpub/pr/include/prtime.h @@ -241,35 +241,22 @@ NSPR_API(PRStatus) PR_ParseTimeStringToE * if the time/date string can't be parsed. */ NSPR_API(PRStatus) PR_ParseTimeString ( const char *string, PRBool default_to_gmt, PRTime *result); -/* - * FIXME: should we also have a formatting function, such as asctime, ctime, - * and strftime in standard C library? But this would involve - * internationalization issues. Might want to provide a US English version. - */ - -/**********************************************************************/ -/*********************** OLD COMPATIBILITYFUNCTIONS *******************/ -/**********************************************************************/ -#ifndef NO_NSPR_10_SUPPORT - /* Format a time value into a buffer. Same semantics as strftime() */ NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt, const PRExplodedTime *tm); /* Format a time value into a buffer. Time is always in US English format, regardless * of locale setting. */ NSPR_API(PRUint32) PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize, const char* format, const PRExplodedTime* tm ); -#endif /* NO_NSPR_10_SUPPORT */ - PR_END_EXTERN_C #endif /* prtime_h___ */
--- a/nsprpub/pr/src/Makefile.in +++ b/nsprpub/pr/src/Makefile.in @@ -128,16 +128,17 @@ ifeq ($(OS_TARGET),Android) # Android has no libpthread.so in NDK OS_LIBS = -ldl else OS_LIBS = -lpthread -ldl endif else OS_LIBS = -ldl endif +OS_LIBS += -lrt endif ifeq ($(OS_ARCH),HP-UX) ifeq ($(USE_PTHREADS), 1) ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE))) OS_LIBS = -ldce else OS_LIBS = -lpthread -lrt
--- a/nsprpub/pr/src/io/prscanf.c +++ b/nsprpub/pr/src/io/prscanf.c @@ -11,19 +11,16 @@ * Acknowledgment: The implementation is inspired by the source code * in P.J. Plauger's "The Standard C Library," Prentice-Hall, 1992. */ #include <limits.h> #include <ctype.h> #include <string.h> #include <stdlib.h> -#ifdef SUNOS4 -#include "md/sunos4.h" /* for strtoul */ -#endif #include "prprf.h" #include "prdtoa.h" #include "prlog.h" #include "prerror.h" /* * A function that reads a character from 'stream'. * Returns the character read, or EOF if end of stream is reached.
--- a/nsprpub/pr/src/md/prosdep.c +++ b/nsprpub/pr/src/md/prosdep.c @@ -4,19 +4,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "prbit.h" #include "prsystem.h" #ifdef XP_UNIX #include <unistd.h> #endif -#ifdef SUNOS4 -#include "md/sunos4.h" -#endif #ifdef _WIN32 #include <windows.h> #endif #ifdef XP_BEOS #include <OS.h> #endif PRInt32 _pr_pageShift;
--- a/nsprpub/pr/src/md/unix/darwin.c +++ b/nsprpub/pr/src/md/unix/darwin.c @@ -1,19 +1,54 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "primpl.h" +#include <mach/mach_time.h> + void _MD_EarlyInit(void) { } +/* + * The multiplier (as a fraction) for converting the Mach absolute time + * unit to nanoseconds. + */ +static mach_timebase_info_data_t machTimebaseInfo; + +void _PR_Mach_IntervalInit(void) +{ + kern_return_t rv; + + rv = mach_timebase_info(&machTimebaseInfo); + PR_ASSERT(rv == KERN_SUCCESS); +} + +PRIntervalTime _PR_Mach_GetInterval(void) +{ + uint64_t time; + + /* + * mach_absolute_time returns the time in the Mach absolute time unit. + * Convert it to milliseconds. See Mac Technical Q&A QA1398. + */ + time = mach_absolute_time(); + time = time * machTimebaseInfo.numer / machTimebaseInfo.denom / + PR_NSEC_PER_MSEC; + return (PRIntervalTime)time; +} /* _PR_Mach_GetInterval */ + +PRIntervalTime _PR_Mach_TicksPerSecond(void) +{ + return 1000; +} + PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) { #if !defined(_PR_PTHREADS) if (isCurrent) { (void) setjmp(CONTEXT(t)); } *np = sizeof(CONTEXT(t)) / sizeof(PRWord); return (PRWord *) CONTEXT(t);
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/ncr.c +++ /dev/null @@ -1,363 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * NCR 3.0 - cloned from UnixWare by ruslan - */ -#include "primpl.h" - -#include <setjmp.h> - -void _MD_EarlyInit(void) -{ -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ - if (isCurrent) { - (void) setjmp(CONTEXT(t)); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -} - -#ifdef ALARMS_BREAK_TCP /* I don't think they do */ - -PRInt32 _MD_connect(PRInt32 osfd, const PRNetAddr *addr, PRInt32 addrlen, - PRIntervalTime timeout) -{ - PRInt32 rv; - - _MD_BLOCK_CLOCK_INTERRUPTS(); - rv = _connect(osfd,addr,addrlen); - _MD_UNBLOCK_CLOCK_INTERRUPTS(); -} - -PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen, - PRIntervalTime timeout) -{ - PRInt32 rv; - - _MD_BLOCK_CLOCK_INTERRUPTS(); - rv = _accept(osfd,addr,addrlen); - _MD_UNBLOCK_CLOCK_INTERRUPTS(); - return(rv); -} -#endif - -/* - * These are also implemented in pratom.c using NSPR locks. Any reason - * this might be better or worse? If you like this better, define - * _PR_HAVE_ATOMIC_OPS in include/md/unixware.h - */ -#ifdef _PR_HAVE_ATOMIC_OPS -/* Atomic operations */ -#include <stdio.h> -static FILE *_uw_semf; - -void -_MD_INIT_ATOMIC(void) -{ - /* Sigh. Sure wish SYSV semaphores weren't such a pain to use */ - if ((_uw_semf = tmpfile()) == NULL) - PR_ASSERT(0); - - return; -} - -void -_MD_ATOMIC_INCREMENT(PRInt32 *val) -{ - flockfile(_uw_semf); - (*val)++; - unflockfile(_uw_semf); -} - -void -_MD_ATOMIC_ADD(PRInt32 *ptr, PRInt32 val) -{ - flockfile(_uw_semf); - (*ptr) += val; - unflockfile(_uw_semf); -} - - -void -_MD_ATOMIC_DECREMENT(PRInt32 *val) -{ - flockfile(_uw_semf); - (*val)--; - unflockfile(_uw_semf); -} - -void -_MD_ATOMIC_SET(PRInt32 *val, PRInt32 newval) -{ - flockfile(_uw_semf); - *val = newval; - unflockfile(_uw_semf); -} -#endif - -void -_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) -{ - return; -} - -PRStatus -_MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -/* These functions should not be called for Unixware */ -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for Unixware."); -} - -PRStatus -_MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRUintn priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Unixware."); - return PR_FAILURE; -} - -/* - This is temp. replacement for localtime_r. Normally PR_ExplodeTime should - be used as to my understanding -*/ - -/* -** $$$$$ THEN WHY ARE WE DOING THIS? - AOF $$$$$ -*/ - -#define NEED_LOCALTIME_R -#define NEED_GMTIME_R -#define NEED_ASCTIME_R -#define NEED_STRTOK_R -#define NEED_CTIME_R - -#if defined (NEED_LOCALTIME_R) || defined (NEED_CTIME_R) || defined (NEED_ASCTIME_R) || defined (NEED_GMTIME_R) || defined (NEED_STRTOK_R) -#include "prlock.h" -#endif - -#if defined (NEED_LOCALTIME_R) - -static PRLock *localtime_r_monitor = NULL; - -struct tm *localtime_r (const time_t *clock, struct tm *result) -{ - struct tm *tmPtr; - int needLock = PR_Initialized(); /* We need to use a lock to protect - * against NSPR threads only when the - * NSPR thread system is activated. */ - - if (needLock) { - if (localtime_r_monitor == NULL) { - - localtime_r_monitor = PR_NewLock(); - } - PR_Lock(localtime_r_monitor); - } - - /* - * On Windows, localtime() returns a NULL pointer if 'clock' - * represents a time before midnight January 1, 1970. In - * that case, we also return a NULL pointer and the struct tm - * object pointed to by 'result' is not modified. - */ - - tmPtr = localtime(clock); - if (tmPtr) { - *result = *tmPtr; - } else { - result = NULL; - } - - if (needLock) PR_Unlock(localtime_r_monitor); - - return result; -} - -#endif - -#if defined (NEED_GMTIME_R) - -static PRLock *gmtime_r_monitor = NULL; - -struct tm *gmtime_r (const time_t *clock, struct tm *result) -{ - struct tm *tmPtr; - int needLock = PR_Initialized(); /* We need to use a lock to protect - * against NSPR threads only when the - * NSPR thread system is activated. */ - - if (needLock) { - if (gmtime_r_monitor == NULL) { - gmtime_r_monitor = PR_NewLock(); - } - PR_Lock(gmtime_r_monitor); - } - - tmPtr = gmtime(clock); - if (tmPtr) { - *result = *tmPtr; - } else { - result = NULL; - } - - if (needLock) PR_Unlock(gmtime_r_monitor); - - return result; -} - -#endif - -#if defined (NEED_CTIME_R) - -static PRLock *ctime_r_monitor = NULL; - -char *ctime_r (const time_t *clock, char *buf, int buflen) -{ - char *cbuf; - int needLock = PR_Initialized(); /* We need to use a lock to protect - * against NSPR threads only when the - * NSPR thread system is activated. */ - - if (needLock) { - - if (ctime_r_monitor == NULL) { - ctime_r_monitor = PR_NewLock(); - } - PR_Lock(ctime_r_monitor); - } - - cbuf = ctime (clock); - if (cbuf) { - strncpy (buf, cbuf, buflen - 1); - buf[buflen - 1] = 0; - } - - if (needLock) PR_Unlock(ctime_r_monitor); - - return cbuf; -} - -#endif - -#if defined (NEED_ASCTIME_R) - -static PRLock *asctime_r_monitor = NULL; - - -char *asctime_r (const struct tm *tm, char *buf, int buflen) -{ - char *cbuf; - int needLock = PR_Initialized(); /* We need to use a lock to protect - * against NSPR threads only when the - * NSPR thread system is activated. */ - - if (needLock) { - if (asctime_r_monitor == NULL) { - asctime_r_monitor = PR_NewLock(); - } - PR_Lock(asctime_r_monitor); - } - - cbuf = asctime (tm); - if (cbuf) { - strncpy (buf, cbuf, buflen - 1); - buf[buflen - 1] = 0; - } - - if (needLock) PR_Unlock(asctime_r_monitor); - - return cbuf; - -} -#endif - -#if defined (NEED_STRTOK_R) - -char * -strtok_r (s, delim, last) - register char *s; - register const char *delim; - register char **last; -{ - register char *spanp; - register int c, sc; - char *tok; - - - if (s == NULL && (s = *last) == NULL) - return (NULL); - - /* - * Skip (span) leading delimiters (s += strspn(s, delim), sort of). - */ -cont: - - c = *s++; - for (spanp = (char *)delim; (sc = *spanp++) != 0;) { - if (c == sc) - goto cont; - } - - if (c == 0) { /* no non-delimiter characters */ - *last = NULL; - return (NULL); - } - tok = s - 1; - - /* - * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). - * Note that delim must have one NUL; we stop if we see that, too. - */ - for (;;) { - c = *s++; - spanp = (char *)delim; - do { - if ((sc = *spanp++) == c) { - if (c == 0) - s = NULL; - - else - s[-1] = 0; - *last = s; - return (tok); - } - } while (sc != 0); - } - /* NOTREACHED */ -} - -#endif
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/nec.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "primpl.h" - -void _MD_EarlyInit(void) -{ -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ - if (isCurrent) { - (void) setjmp(CONTEXT(t)); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -} - -void -_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) -{ - return; -} - -PRStatus -_MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -/* These functions should not be called for NEC */ -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for NEC."); -} - -PRStatus -_MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEC."); - return PR_FAILURE; -}
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/nextstep.c +++ /dev/null @@ -1,252 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "primpl.h" - -#import <mach/mach.h> -#import <mach/mach_error.h> -#import <mach-o/dyld.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <sys/mman.h> -#include <syscall.h> - - - -/* These functions are hidden in NEXTSTEP, but beacuse they have syscall() -** entries I can wrap these into their corresponding missing function. -*/ -caddr_t -mmap(caddr_t addr, size_t len, int prot, int flags, - int fildes, off_t off) -{ - return (caddr_t) syscall (SYS_mmap, addr, len, prot, flags, fildes, off); -} - -int -munmap(caddr_t addr, size_t len) -{ - return syscall (SYS_munmap, addr, len); -} - -int -mprotect(caddr_t addr, size_t len, int prot) -{ - return syscall (SYS_mprotect, addr, len, prot); -} - - -/* If found the brk() symbol in the sahred libraries but no syscall() entry ... -** I don't know whether it will work ... -int brk(void *endds) -{ - return syscall (); -} -*/ - -void *sbrk(int incr) -{ - return (void *) syscall (SYS_sbrk, incr); -} - -/* These are my mach based versions, untested and probably bad ... -*/ -caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags, - int fildes, off_t off) -{ - kern_return_t ret_val; - - /* First map ... - */ - ret_val = map_fd ( fildes, /* fd */ - (vm_offset_t) off, /* offset */ - (vm_offset_t*)&addr, /* address */ - TRUE, /* find_space */ - (vm_size_t) len); /* size */ - - if (ret_val != KERN_SUCCESS) { - mach_error("Error calling map_fd() in mmap", ret_val ); - return (caddr_t)0; - } - - /* ... then protect (this is probably bad) - */ - ret_val = vm_protect( task_self(), /* target_task */ - (vm_address_t)addr, /* address */ - (vm_size_t) len, /* size */ - FALSE, /* set_maximum */ - (vm_prot_t) prot); /* new_protection */ - if (ret_val != KERN_SUCCESS) { - mach_error("vm_protect in mmap()", ret_val ); - return (caddr_t)0; - } - - return addr; -} - -int my_munmap(caddr_t addr, size_t len) -{ - kern_return_t ret_val; - - ret_val = vm_deallocate(task_self(), - (vm_address_t) addr, - (vm_size_t) len); - - if (ret_val != KERN_SUCCESS) { - mach_error("vm_deallocate in munmap()", ret_val); - return -1; - } - - return 0; -} - -int my_mprotect(caddr_t addr, size_t len, int prot) -{ - vm_prot_t mach_prot; - kern_return_t ret_val; - - switch (prot) { - case PROT_READ: mach_prot = VM_PROT_READ; break; - case PROT_WRITE: mach_prot = VM_PROT_WRITE; break; - case PROT_EXEC: mach_prot = VM_PROT_EXECUTE; break; - case PROT_NONE: mach_prot = VM_PROT_NONE; break; - } - - ret_val = vm_protect(task_self(), /* target_task */ - (vm_address_t)addr, /* address */ - (vm_size_t) len, /* size */ - FALSE, /* set_maximum */ - (vm_prot_t) prot); /* new_protection */ - - if (ret_val != KERN_SUCCESS) { - mach_error("vm_protect in mprotect()", ret_val); - return -1; - } - - return 0; -} - -char *strdup(const char *s1) -{ - int len = strlen (s1); - char *copy = (char*) malloc (len+1); - - if (copy == (char*)0) - return (char*)0; - - strcpy (copy, s1); - - return copy; -} - -/* Stub rld functions -*/ -extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile( - const char *pathName, - NSObjectFileImage *objectFileImage) -{ - return NSObjectFileImageFailure; -} - -extern void * NSAddressOfSymbol( - NSSymbol symbol) -{ - return NULL; -} - -extern NSModule NSLinkModule( - NSObjectFileImage objectFileImage, - const char *moduleName, /* can be NULL */ - enum bool bindNow) -{ - return NULL; -} - -extern NSSymbol NSLookupAndBindSymbol( - const char *symbolName) -{ - return NULL; -} - -extern enum bool NSUnLinkModule( - NSModule module, - enum bool keepMemoryMapped) -{ - return 0; -} - - - -void _MD_EarlyInit(void) -{ -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ -#ifndef _PR_PTHREADS - if (isCurrent) { - (void) sigsetjmp(CONTEXT(t), 1); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -#else - *np = 0; - return NULL; -#endif -} - -#ifndef _PR_PTHREADS - -void -_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) -{ - return; -} - -PRStatus -_MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -/* These functions should not be called for NEXTSTEP */ -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for NEXTSTEP."); -} - -PRStatus -_MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEXTSTEP."); - return PR_FAILURE; -} - -#endif
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/reliantunix.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * SINIX (ReliantUNIX) 5.4 - copied from unixware.c by chrisk 040497 - */ -#include "primpl.h" - -#include <ucontext.h> - -void _MD_EarlyInit(void) -{ -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ - if (isCurrent) { - (void) _GETCONTEXT(CONTEXT(t)); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -} - -#ifdef ALARMS_BREAK_TCP /* I don't think they do */ - -PRInt32 _MD_connect(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen, - PRIntervalTime timeout) -{ - PRInt32 rv; - - _MD_BLOCK_CLOCK_INTERRUPTS(); - rv = _connect(osfd,addr,addrlen); - _MD_UNBLOCK_CLOCK_INTERRUPTS(); -} - -PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen, - PRIntervalTime timeout) -{ - PRInt32 rv; - - _MD_BLOCK_CLOCK_INTERRUPTS(); - rv = _accept(osfd,addr,addrlen); - _MD_UNBLOCK_CLOCK_INTERRUPTS(); - return(rv); -} -#endif - -void -_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) -{ - return; -} - -PRStatus -_MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -/* These functions should not be called for SINIX */ -/* Why? Just copied it from UNIXWARE... flying-by-night, chrisk 040497 */ -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for SINIX."); -} - -PRStatus -_MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRUintn priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SINIX."); -#if defined(SNI) && !defined(__GNUC__) - /* make compiler happy */ - return (PRStatus)NULL; -#endif -}
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/sony.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "primpl.h" - -#include <signal.h> - -void _MD_EarlyInit(void) -{ -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ -#ifndef _PR_PTHREADS - if (isCurrent) { - (void) setjmp(CONTEXT(t), 1); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -#else - *np = 0; - return NULL; -#endif -} - -#ifndef _PR_PTHREADS -void -_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri) -{ - return; -} - -PRStatus -_MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -/* These functions should not be called for Sony */ -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for SONY."); -} - -PRStatus -_MD_CREATE_THREAD( - PRThread *thread, - void (*start) (void *), - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SONY."); - return PR_FAILURE; -} -#endif /* ! _PR_PTHREADS */
deleted file mode 100644 --- a/nsprpub/pr/src/md/unix/sunos4.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include <setjmp.h> -#include "primpl.h" - -void _MD_EarlyInit(void) -{ -} - -PRStatus _MD_CREATE_THREAD(PRThread *thread, - void (*start)(void *), - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize) -{ - PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SunOS 4.1.3."); - return PR_FAILURE; -} - -void _MD_SET_PRIORITY(_MDThread *md_thread, PRUintn newPri) -{ - PR_NOT_REACHED("_MD_SET_PRIORITY should not be called for user-level threads."); -} - -PRStatus -_MD_WAIT(PRThread *thread, PRIntervalTime ticks) -{ - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - _PR_MD_SWITCH_CONTEXT(thread); - return PR_SUCCESS; -} - -PRStatus -_MD_WAKEUP_WAITER(PRThread *thread) -{ - if (thread) { - PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE)); - } - return PR_SUCCESS; -} - -PRStatus _MD_InitializeThread(PRThread *thread) -{ - return PR_SUCCESS; -} - -void -_MD_YIELD(void) -{ - PR_NOT_REACHED("_MD_YIELD should not be called for SunOS 4.1.3."); -} - -PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) -{ - if (isCurrent) { - (void) setjmp(CONTEXT(t)); - } - *np = sizeof(CONTEXT(t)) / sizeof(PRWord); - return (PRWord *) CONTEXT(t); -}
--- a/nsprpub/pr/src/md/unix/unix.c +++ b/nsprpub/pr/src/md/unix/unix.c @@ -3012,31 +3012,61 @@ PR_Now(void) LL_I2L(s2us, PR_USEC_PER_SEC); LL_I2L(s, tv.tv_sec); LL_I2L(us, tv.tv_usec); LL_MUL(s, s, s2us); LL_ADD(s, s, us); return s; } +#if defined(_MD_INTERVAL_USE_GTOD) +/* + * This version of interval times is based on the time of day + * capability offered by the system. This isn't valid for two reasons: + * 1) The time of day is neither linear nor montonically increasing + * 2) The units here are milliseconds. That's not appropriate for our use. + */ PRIntervalTime _PR_UNIX_GetInterval() { struct timeval time; PRIntervalTime ticks; (void)GETTIMEOFDAY(&time); /* fallicy of course */ ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; /* that's in milliseconds */ ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC; /* so's that */ return ticks; -} /* _PR_SUNOS_GetInterval */ +} /* _PR_UNIX_GetInterval */ PRIntervalTime _PR_UNIX_TicksPerSecond() { return 1000; /* this needs some work :) */ } +#endif + +#if defined(HAVE_CLOCK_MONOTONIC) +PRIntervalTime _PR_UNIX_GetInterval2() +{ + struct timespec time; + PRIntervalTime ticks; + + if (clock_gettime(CLOCK_MONOTONIC, &time) != 0) { + fprintf(stderr, "clock_gettime failed: %d\n", errno); + abort(); + } + + ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; + ticks += (PRUint32)time.tv_nsec / PR_NSEC_PER_MSEC; + return ticks; +} + +PRIntervalTime _PR_UNIX_TicksPerSecond2() +{ + return 1000; +} +#endif #if !defined(_PR_PTHREADS) /* * Wait for I/O on multiple descriptors. * * Return 0 if timed out, return -1 if interrupted, * else return the number of ready descriptors. */
--- a/nsprpub/pr/src/misc/prerrortable.c +++ b/nsprpub/pr/src/misc/prerrortable.c @@ -20,19 +20,16 @@ used in advertising or publicity pertain of the software without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B. make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ #include <string.h> -#ifdef SUNOS4 -#include "md/sunos4.h" /* for strerror */ -#endif #include <assert.h> #include <errno.h> #include "prmem.h" #include "prerror.h" #define ERRCODE_RANGE 8 /* # of bits to shift table number */ #define BITS_PER_CHAR 6 /* # bits to shift per character in name */
--- a/nsprpub/pr/src/misc/prinrval.c +++ b/nsprpub/pr/src/misc/prinrval.c @@ -27,23 +27,16 @@ void _PR_InitClock(void) PRIntervalTime ticksPerSec = PR_TicksPerSecond(); PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN); PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX); } #endif /* DEBUG */ } -/* - * This version of interval times is based on the time of day - * capability offered by system. This isn't valid for two reasons: - * 1) The time of day is neither linear nor montonically increasing - * 2) The units here are milliseconds. That's not appropriate for our use. - */ - PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void) { if (!_pr_initialized) _PR_ImplicitInitialization(); return _PR_MD_GET_INTERVAL(); } /* PR_IntervalNow */ PR_EXTERN(PRUint32) PR_TicksPerSecond(void) {
--- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -15,47 +15,47 @@ */ #include "prinit.h" #include <stdio.h> #include <stdlib.h> /* - * This release (4.9.3) is backward compatible with the + * This release (4.9.4) 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.x, 4.9, 4.9.1, and 4.9.2 releases. It, of course, + * 4.8.x, 4.9, 4.9.1, 4.9.2, and 4.9.3 releases. It, of course, * is compatible with itself. */ static char *compatible_version[] = { "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3", "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1", "4.5", "4.5.1", "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5", "4.6.6", "4.6.7", "4.6.8", "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", "4.8.7", "4.8.8", "4.8.9", - "4.9", "4.9.1", "4.9.2", PR_VERSION + "4.9", "4.9.1", "4.9.2", "4.9.3", PR_VERSION }; /* * This release is not backward compatible with the old * NSPR 2.1 and 3.x releases. * * Any release is incompatible with future releases and * patches. */ static char *incompatible_version[] = { "2.1 19980529", "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.9.4", + "4.9.5", "4.10", "4.10.1", "10.0", "11.1", "12.14.20" }; int main(int argc, char **argv) { int idx; int num_compatible = sizeof(compatible_version) / sizeof(char *);