NSPR20 v3.0 beta landing from NSPRPUB_RELEASE_3_0_LANDING_BRANCH.

This commit is contained in:
wtc%netscape.com 1998-09-25 20:34:39 +00:00
Родитель 4e0029b225
Коммит b02b3a0afb
231 изменённых файлов: 21056 добавлений и 8821 удалений

Просмотреть файл

@ -26,8 +26,10 @@ include $(MOD_DEPTH)/config/UNIX.mk
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# There are three implementation strategies available on AIX:
@ -36,7 +38,7 @@ endif
ifeq ($(CLASSIC_NSPR),1)
PTHREADS_USER =
USE_PTHREADS =
IMPL_STRATEGY = _CLASSIC
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
ifeq ($(PTHREADS_USER),1)
@ -44,17 +46,10 @@ ifeq ($(PTHREADS_USER),1)
IMPL_STRATEGY = _PTH_USER
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
endif
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
IMPL_STRATEGY =
endif
ifeq ($(CLASSIC_NSPR),1)
CC = xlC
CCC = xlC
@ -67,17 +62,13 @@ CPU_ARCH = rs6000
RANLIB = ranlib
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = -qro -qroconst -DAIX -DSYSV
ifeq ($(CC),xlC_r)
OS_CFLAGS += -qarch=com
endif
ifeq ($(OS_RELEASE),4.1)
OS_CFLAGS += -DAIX4_1
OS_CFLAGS += -DAIX4_1 -D_PR_NO_LARGE_FILES
else
DSO_LDOPTS = -brtl -bM:SRE -bnoentry -bexpall
MKSHLIB = $(LD) $(DSO_LDOPTS)
@ -86,7 +77,14 @@ OS_CFLAGS += -DAIX4_3
endif
endif
endif # USE_AUTOCONF
ifeq (,$(filter-out 4.2 4.3,$(OS_RELEASE)))
# On these OS revisions, localtime_r() is declared if _THREAD_SAFE
# is defined.
ifneq ($(CLASSIC_NSPR),1)
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
OS_CFLAGS += -D_PR_HAVE_OFF64_T
endif
#
# Special link info for constructing AIX programs. On AIX we have to

Просмотреть файл

@ -32,11 +32,7 @@ OS_CFLAGS = -DBSDI -DHAVE_STRERROR -D__386BSD__ -DNEED_BSDREGEX -Di386
OS_LIBS = -lcompat -ldl
ifeq ($(OS_RELEASE),2.1)
OS_CFLAGS += -DBSDI_2
endif
ifdef USE_AUTOCONF
OS_CFLAGS =
OS_CFLAGS += -DBSDI_2 -D_PR_TIMESPEC_HAS_TS_SEC
endif
G++INCLUDES = -I/usr/include/g++

Просмотреть файл

@ -28,17 +28,14 @@ RANLIB = ranlib
OS_REL_CFLAGS = -mno-486 -Di386
CPU_ARCH = x86
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS)
else
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -D_PR_NEED_POLL
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
OS_LIBS = -lc_r
# XXX probably should define _THREAD_SAFE too.
DEFINES += -D_PR_NEED_FAKE_POLL
DEFINES += -D_THREAD_SAFE -D_PR_NEED_FAKE_POLL
else
IMPL_STRATEGY = _EMU
OS_LIBS = -lc
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif

Просмотреть файл

@ -24,13 +24,14 @@ include $(MOD_DEPTH)/config/UNIX.mk
DLL_SUFFIX = sl
ifdef NS_USE_GCC
CC = gcc
CCC = g++
OS_CFLAGS =
CC = gcc
CCC = g++
OS_CFLAGS =
COMPILER_TAG = _gcc
else
CC = cc -Ae
CCC = CC
OS_CFLAGS = +ESlit
CC = cc -Ae
CCC = CC -ext
OS_CFLAGS = +ESlit
endif
RANLIB = echo
@ -52,6 +53,14 @@ ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_NEED_H_ERRNO
endif
# Do we have localtime_r()? Does it return 'int' or 'struct tm *'?
ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
OS_CFLAGS += -DHAVE_INT_LOCALTIME_R
endif
ifeq (,$(filter-out B.10.30 B.11.00,$(OS_RELEASE)))
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
@ -72,12 +81,12 @@ endif
#
ifeq ($(basename $(OS_RELEASE)),A.09)
OS_CFLAGS += -DHPUX9
DEFAULT_IMPL_STRATEGY = _CLASSIC
DEFAULT_IMPL_STRATEGY = _EMU
endif
ifeq ($(OS_RELEASE),B.10.01)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _CLASSIC
DEFAULT_IMPL_STRATEGY = _EMU
endif
ifeq ($(OS_RELEASE),B.10.10)
@ -87,6 +96,9 @@ endif
ifeq ($(OS_RELEASE),B.10.20)
OS_CFLAGS += -DHPUX10 -DHPUX10_20
ifndef NS_USE_GCC
OS_CFLAGS += +DAportable +DS1.1
endif
DEFAULT_IMPL_STRATEGY = _PTH
endif
@ -96,7 +108,7 @@ endif
ifeq ($(OS_RELEASE),B.10.30)
ifndef NS_USE_GCC
CCC = /opt/aCC/bin/aCC
CCC = /opt/aCC/bin/aCC -ext
OS_CFLAGS += +DAportable +DS1.1
endif
OS_CFLAGS += -DHPUX10 -DHPUX10_30
@ -105,23 +117,30 @@ endif
# 11.00 is similar to 10.30.
ifeq ($(OS_RELEASE),B.11.00)
ifndef NS_USE_GCC
CCC = /opt/aCC/bin/aCC
OS_CFLAGS += +DAportable +DS1.1
endif
OS_CFLAGS += -DHPUX10 -DHPUX11
ifndef NS_USE_GCC
CCC = /opt/aCC/bin/aCC -ext
ifeq ($(USE_64), 1)
OS_CFLAGS += +DA2.0W +DChpux
COMPILER_TAG = _64
else
OS_CFLAGS += +DAportable +DS1.1
COMPILER_TAG = _32
endif
endif
OS_CFLAGS += -DHPUX10 -DHPUX11 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T
DEFAULT_IMPL_STRATEGY = _PTH
endif
ifeq ($(DEFAULT_IMPL_STRATEGY),_CLASSIC)
ifeq ($(DEFAULT_IMPL_STRATEGY),_EMU)
CLASSIC_NSPR = 1
endif
ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
ifeq ($(CLASSIC_NSPR),1)
USE_PTHREADS =
IMPL_STRATEGY = _CLASSIC
IMPL_STRATEGY = _EMU
endif
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS =
@ -129,18 +148,14 @@ IMPL_STRATEGY = _PTH_USER
endif
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
IMPL_STRATEGY =
endif
ifeq ($(CLASSIC_NSPR),1)
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
ifeq (,$(filter-out A.09 B.10,$(basename $(OS_RELEASE))))
DEFINES += -D_PR_NO_LARGE_FILES
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
@ -173,7 +188,3 @@ DSO_CFLAGS = +Z
endif
HAVE_PURIFY = 1
ifdef USE_AUTOCONF
OS_CFLAGS =
endif

Просмотреть файл

@ -22,50 +22,80 @@
include $(MOD_DEPTH)/config/UNIX.mk
#
# The default implementation strategy for Irix is classic nspr.
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# The default implementation strategy for Irix is pthreads.
# Classic nspr (user-level threads on top of sprocs) is also
# available.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _MxN
else
USE_PTHREADS = 1
USE_N32 = 1
IMPL_STRATEGY = _PTH
endif
ifdef NS_USE_GCC
CC = gcc
COMPILER_TAG = _gcc
AS = $(CC) -x assembler-with-cpp
ODD_CFLAGS = -Wall -Wno-format
ifdef BUILD_OPT
OPTIMIZER = -O6
endif
CC = gcc
COMPILER_TAG = _gcc
AS = $(CC) -x assembler-with-cpp -D_ASM -mips2
ODD_CFLAGS = -Wall -Wno-format
ifdef BUILD_OPT
OPTIMIZER = -O6
endif
else
CC = cc
CCC = CC
ODD_CFLAGS = -fullwarn -xansi
ifdef BUILD_OPT
CC = cc
CCC = CC
ODD_CFLAGS = -fullwarn -xansi
ifdef BUILD_OPT
ifneq ($(USE_N32),1)
OPTIMIZER = -O -Olimit 4000
else
OPTIMIZER = -O -OPT:Olimit=4000
endif
endif
ifeq ($(USE_N32),1)
OPTIMIZER = -O -OPT:Olimit=4000
else
OPTIMIZER = -O -Olimit 4000
endif
endif
# For 6.x machines, include this flag
ifeq ($(basename $(OS_RELEASE)),6)
ifeq ($(USE_N32),1)
ODD_CFLAGS += -n32 -exceptions -woff 1209,1642,3201
COMPILER_TAG = _n32
else
ODD_CFLAGS += -32 -multigot
endif
else
ODD_CFLAGS += -xgot
endif
#
# The default behavior is still -o32 generation, hence the explicit tests
# for -n32 and -64 and implicitly assuming -o32. If that changes, ...
#
ifeq ($(basename $(OS_RELEASE)),6)
ODD_CFLAGS += -multigot
SHLIB_LD_OPTS = -no_unresolved
ifeq ($(USE_N32),1)
ODD_CFLAGS += -n32 -woff 1209
COMPILER_TAG = _n32
LDOPTS += -n32
SHLIB_LD_OPTS += -n32
ifeq ($(OS_RELEASE), 6_2)
LDOPTS += -Wl,-woff,85
SHLIB_LD_OPTS += -woff 85
endif
else
ifeq ($(USE_64),1)
ODD_CFLAGS += -64
COMPILER_TAG = _64
else
ODD_CFLAGS += -32
COMPILER_TAG = _o32
endif
endif
else
ODD_CFLAGS += -xgot
endif
endif
ODD_CFLAGS += -DSVR4 -DIRIX
CPU_ARCH = mips
RANLIB = /bin/true
@ -78,30 +108,15 @@ ifeq ($(OS_RELEASE),5.3)
OS_CFLAGS += -DIRIX5_3
endif
ifeq ($(OS_RELEASE),6.2)
OS_CFLAGS += -DIRIX6_2
endif
ifeq ($(OS_RELEASE),6.3)
OS_CFLAGS += -DIRIX6_3
endif
ifndef NO_MDUPDATE
OS_CFLAGS += $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
else
OS_CFLAGS += $(NOMD_OS_CFLAGS)
endif
# catch unresolved symbols
ifeq ($(basename $(OS_RELEASE)),6)
SHLIB_LD_OPTS = -no_unresolved
ifeq ($(USE_N32),1)
SHLIB_LD_OPTS += -n32
else
SHLIB_LD_OPTS += -32
endif
endif
# -rdata_shared is an ld option that puts string constants and
# const data into the text segment, where they will be shared
# across processes and be read-only.
MKSHLIB = $(LD) $(SHLIB_LD_OPTS) -rdata_shared -shared -soname $(@:$(OBJDIR)/%.so=%.so)
HAVE_PURIFY = 1
@ -111,7 +126,3 @@ DSO_LDOPTS = -elf -shared -all
ifdef DSO_BACKEND
DSO_LDOPTS += -soname $(DSO_NAME)
endif
ifdef USE_AUTOCONF
OS_CFLAGS =
endif

Просмотреть файл

@ -26,13 +26,25 @@
include $(MOD_DEPTH)/config/UNIX.mk
#
# The default implementation strategy for Linux is classic nspr.
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
DEFINES += -D_REENTRANT
else
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# The default implementation strategy for Linux is pthreads.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
DEFINES += -D_REENTRANT
endif
ifeq (86,$(findstring 86,$(OS_TEST)))
@ -43,8 +55,8 @@ CPU_ARCH := arm
else
CPU_ARCH := $(OS_TEST)
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
CC = gcc
CCC = g++
@ -56,11 +68,7 @@ G++INCLUDES = -I/usr/include/g++
PLATFORM_FLAGS = -ansi -Wall -pipe -DLINUX -Dlinux
PORT_FLAGS = -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS) #-include $(MOD_DEPTH)/include/config.h
else
OS_CFLAGS = $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS)
endif
######################################################################
# Version-specific stuff

Просмотреть файл

@ -21,20 +21,58 @@ MOD_DEPTH = ..
include $(MOD_DEPTH)/config/config.mk
CSRCS = nsinstall.c pathsub.c
CSRCS = nsinstall.c now.c
PLSRCS = nfspwd.pl
ifneq ($(OS_ARCH),WINNT)
PROGRAM = $(OBJDIR)/nsinstall
TARGETS = $(PROGRAM) $(PLSRCS:.pl=)
ifeq ($(OS_ARCH), WINNT)
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
ifeq ($(OS_ARCH), IRIX)
ifeq ($(basename $(OS_RELEASE)),6)
ifeq ($(USE_N32),1)
XLDOPTS += -n32 -Wl,-woff,85
ifeq ($(OS_RELEASE), 6_2)
XLDOPTS += -Wl,-woff,85
endif
else
ifeq ($(USE_64),1)
XLDOPTS += -64
else
XLDOPTS += -32
endif
endif
endif
endif
ifeq ($(OS_ARCH), HP-UX)
ifeq ($(USE_64),1)
XLDOPTS += +DD64
endif
endif
include $(MOD_DEPTH)/config/rules.mk
PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
ifeq ($(OS_ARCH),WINNT)
TARGETS = $(PROGS)
else
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
TARGETS = $(PROGS) $(PLSRCS:.pl=)
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi
endef
export:: $(TARGETS)
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
$(CC) $(XCFLAGS) $< $(XLDOPTS) -o $@

Просмотреть файл

@ -31,9 +31,7 @@ export PATH:=$(PATH):/opt/ncc/bin
RANLIB = true
GCC_FLAGS_EXTRA = -pipe
ifndef USE_AUTOCONF
DEFINES += -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -D_PR_LOCAL_THREADS_ONLY
endif
ifdef NS_USE_NATIVE
CC = cc

Просмотреть файл

@ -36,11 +36,7 @@ MKSHLIB = $(LD) $(DSO_LDOPTS)
RANLIB = /bin/true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
endif
OS_LIBS = -lsocket -lnsl -ldl $(LDOPTIONS)
LDOPTIONS = -lc -L/usr/ucblib -lucb

Просмотреть файл

@ -39,11 +39,7 @@ G++INCLUDES =
PLATFORM_FLAGS = -Xa -fullwarn -DSONY
PORT_FLAGS = -DSYSV -DSVR4 -D__svr4 -D__svr4__ -D_PR_LOCAL_THREADS_ONLY -DHAVE_SVID_GETTOD
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS)
endif
######################################################################
# Version-specific stuff

Просмотреть файл

@ -32,11 +32,7 @@ else
CPU_ARCH = $(OS_TEST)
endif
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS)
else
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
endif
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r

Просмотреть файл

@ -46,22 +46,15 @@ endif
# Classic nspr is also available.
#
ifneq ($(OS_RELEASE),V3.2)
USE_PTHREADS = 1
ifeq ($(CLASSIC_NSPR), 1)
USE_PTHREADS =
IMPL_STRATEGY := _CLASSIC
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
endif
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
IMPL_STRATEGY =
endif
CC = cc $(NON_LD_FLAGS) -std1 -readonly_strings
# The C++ compiler cxx has -readonly_strings on by default.
CCC = cxx
@ -76,19 +69,15 @@ endif
NON_LD_FLAGS = -ieee_with_inexact
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = -DOSF1 -D_REENTRANT -taso
OS_CFLAGS = -DOSF1 -D_REENTRANT
ifeq ($(OS_RELEASE),V3.2)
OS_CFLAGS += -DOSF1V3
OS_CFLAGS += -DHAVE_INT_LOCALTIME_R
endif
ifeq (V4,$(findstring V4,$(OS_RELEASE)))
OS_CFLAGS += -DOSF1V4
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
endif # USE_AUTOCONF
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -pthread

63
nsprpub/config/OpenBSD.mk Normal file
Просмотреть файл

@ -0,0 +1,63 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# Config stuff for OpenBSD
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = ranlib
OS_REL_CFLAGS =
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH = x86
else
CPU_ARCH = $(OS_TEST)
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DOPENBSD
DHAVE_STRERROR -DHAVE_BSD_FLOCK
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r
# XXX probably should define _THREAD_SAFE too.
else
OS_LIBS = -lc
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
ARCH = openbsd
DSO_CFLAGS = -fPIC
DSO_LDFLAGS =
DSO_LDOPTS = -Bshareable
ifeq ($(OS_TEST),alpha)
DSO_LDOPTS = -shared
endif
ifeq ($(OS_TEST),mips)
DSO_LDOPTS = -shared
endif
ifeq ($(OS_TEST),pmax)
DSO_LDOPTS = -shared
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
G++INCLUDES = -I/usr/include/g++

Просмотреть файл

@ -21,19 +21,21 @@
include $(MOD_DEPTH)/config/UNIX.mk
CC = cc
CC = cc
ifeq ($(OS_RELEASE),5.0)
CCC = cc++
CCC = cc++
else
CCC = c++
CCC = c++
endif
RANLIB = ranlib
OS_REL_CFLAGS = -Dppc
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_REL_CFLAGS = -mno-486 -Di386
CPU_ARCH = i386
else
OS_REL_CFLAGS = -Dppc
CPU_ARCH = ppc
#OS_REL_CFLAGS = -mno-486 -Di386
#CPU_ARCH = x86
endif
# "Commons" are tentative definitions in a global scope, like this:
# int x;
@ -45,20 +47,16 @@ CPU_ARCH = ppc
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Rhapsody dynamic libraries.
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS)
else
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fno-common -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
endif
DEFINES += -D_PR_LOCAL_THREADS_ONLY -D_PR_NEED_FAKE_POLL
DEFINES += -D_PR_LOCAL_THREADS_ONLY
ARCH = rhapsody
# May override this with -bundle to create a loadable module.
DSO_LDOPTS = -dynamiclib
DSO_LDOPTS = -dynamiclib -compatibility_version 1 -current_version 1 -all_load
MKSHLIB = $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
DLL_SUFFIX = dylib
#G++INCLUDES = -I/usr/include/g++
G++INCLUDES = -I/usr/include/g++

Просмотреть файл

@ -33,12 +33,7 @@ DEFINES += -D_PR_LOCAL_THREADS_ONLY
# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
# -Dsco - Needed for /usr/include/X11/*
#
ifdef USE_AUTOCONF
OS_CFLAGS
else
OS_CFLAGS = -DSYSV -D_SVID3 -DHAVE_STRERROR -D_PR_NEED_H_ERRNO -DSCO -Dsco
endif
#OS_LIBS = -lpmapi -lsocket -lc
MKSHLIB = $(LD) $(DSO_LDOPTS)

Просмотреть файл

@ -70,11 +70,7 @@ RANLIB = /bin/true
NOMD_OS_CFLAGS = $(ODD_CFLAGS)
# we do not have -MDupdate ...
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = $(NOMD_OS_CFLAGS)
endif
OS_LIBS = -lsocket -lnsl -lresolv -ldl -lc
NOSUCHFILE = /no-such-file

Просмотреть файл

@ -20,7 +20,7 @@
# 4 and 5 are vastly different, so we use 2 different files.
#
ifeq ($(basename $(OS_RELEASE)),4.1)
include $(topsrcdir)/config/SunOS4.mk
include $(MOD_DEPTH)/config/SunOS4.mk
else
include $(topsrcdir)/config/SunOS5.mk
include $(MOD_DEPTH)/config/SunOS5.mk
endif

Просмотреть файл

@ -26,6 +26,7 @@ include $(MOD_DEPTH)/config/UNIX.mk
DLL_SUFFIX = so.1.0
CC = gcc
CCC = g++
COMPILER_TAG = _gcc
RANLIB = ranlib
@ -35,11 +36,7 @@ CPU_ARCH = sparc
DEFINES += -D_PR_LOCAL_THREADS_ONLY
# Purify doesn't like -MDupdate
NOMD_OS_CFLAGS = -Wall -Wno-format -DSUNOS4
ifdef USE_AUTOCONF
OS_CFLAGS = $(DSO_CFLAGS)
else
OS_CFLAGS = $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)

Просмотреть файл

@ -26,48 +26,36 @@ include $(MOD_DEPTH)/config/UNIX.mk
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
LOCAL_THREADS_ONLY = 1
endif
ifndef NS_USE_NATIVE
NS_USE_GCC = 1
endif
endif
#
# The default implementation strategy on Solaris is global threads only.
# Local threads only and pthreads are also available.
# The default implementation strategy on Solaris is pthreads.
# Global threads only and local threads only are also available.
#
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
ifeq ($(GLOBAL_THREADS_ONLY),1)
IMPL_STRATEGY = _NATIVE
DEFINES += -D_PR_GLOBAL_THREADS_ONLY
else
ifeq ($(LOCAL_THREADS_ONLY),1)
IMPL_STRATEGY = _LOCAL
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
DEFINES += -D_PR_GLOBAL_THREADS_ONLY
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
endif
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
IMPL_STRATEGY =
endif
ifdef NS_USE_GCC
CC = gcc -Wall
CCC = g++ -Wall
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
#COMPILER_TAG = _gcc
else
COMPILER_TAG = _gcc
endif
#ASFLAGS += -x assembler-with-cpp
ASFLAGS += -x assembler-with-cpp
ifdef NO_MDUPDATE
OS_CFLAGS = $(NOMD_OS_CFLAGS)
else
@ -97,7 +85,6 @@ OS_DEFINES = -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS
ifeq ($(OS_TEST),i86pc)
CPU_ARCH = x86
CPU_ARCH_TAG = _i86pc
OS_DEFINES += -Di386
# The default debug format, DWARF (-g), is not supported by gcc
# on i386-ANY-sysv4/solaris, but the stabs format is. It is
@ -111,21 +98,20 @@ endif
else
CPU_ARCH = sparc
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
ifeq (5.5,$(findstring 5.5,$(OS_RELEASE)))
OS_DEFINES += -DSOLARIS2_5
else
OS_DEFINES += -D_PR_HAVE_OFF64_T
endif
ifneq ($(LOCAL_THREADS_ONLY),1)
OS_DEFINES += -D_REENTRANT
OS_DEFINES += -D_REENTRANT -DHAVE_POINTER_LOCALTIME_R
endif
# Purify doesn't like -MDupdate
ifdef USE_AUTOCONF
NOMD_OS_CFLAGS = $(DSO_CFLAGS) #-DSOLARIS
else
NOMD_OS_CFLAGS = $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)

Просмотреть файл

@ -15,13 +15,13 @@
# Reserved.
#
PR_UNIXOS = 1
XP_DEFINE = -DXP_UNIX
OBJ_SUFFIX = o
LIB_SUFFIX = a
DLL_SUFFIX = so
AR = ar cr $@
ifndef USE_AUTOCONF
ifdef BUILD_OPT
OPTIMIZER = -O
DEFINES = -UDEBUG -DNDEBUG
@ -33,8 +33,11 @@ OBJDIR_TAG = _DBG
endif
# Name of the binary code directories
ifdef MOZILLA_CLIENT
OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(OBJDIR_TAG).OBJ
else
OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
endif # !USE_AUTOCONF
endif
MKDEPEND_DIR = $(DEPTH)/config/mkdepend
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend

Просмотреть файл

@ -33,11 +33,7 @@ CCC = $(NSDEPTH)/build/hcpp
RANLIB = true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
ifdef USE_AUTOCONF
OS_CFLAGS =
else
OS_CFLAGS = -DSVR4 -DSYSV -DUNIXWARE
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G

Просмотреть файл

@ -29,22 +29,6 @@ ifdef PR_CLIENT_BUILD_WINDOWS
SHELL = $(MOZ_TOOLS_FLIPPED)/bin/shmsdos.exe
endif
#
# On NT, we use static thread local storage by default because it
# gives us better performance. However, we can't use static TLS
# on Alpha NT because the Alpha version of MSVC does not seem to
# support the -GT flag, which is necessary to make static TLS safe
# for fibers.
#
# On Win95, we use the TlsXXX() functions by default because that
# allows us to load the NSPR DLL at run time using LoadLibrary().
#
ifeq ($(OS_TARGET),WINNT)
ifneq ($(CPU_ARCH),ALPHA)
USE_STATIC_TLS = 1
endif
endif
CC = cl
CCC = cl
LINK = link
@ -96,35 +80,36 @@ OPTIMIZER = -Od -Z7
DEFINES = -DDEBUG -D_DEBUG -UNDEBUG
DLLFLAGS = -DEBUG -DEBUGTYPE:CV -OUT:"$@"
ifeq ($(MOZ_BITS),32)
ifdef GLOWCODE
ifdef MOZ_DEBUG
DLLFLAGS = -DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"
endif
endif
endif
OBJDIR_TAG = _DBG
LDFLAGS = -DEBUG -DEBUGTYPE:CV
endif
DEFINES += -DWIN32
#
# On Win95, we use the TlsXXX() interface by default because that
# allows us to load the NSPR DLL dynamically at run time.
# If you want to use static thread-local storage (TLS) for better
# performance, build the NSPR library with USE_STATIC_TLS=1.
#
ifeq ($(USE_STATIC_TLS),1)
DEFINES += -D_PR_USE_STATIC_TLS
endif
#
# NSPR uses fibers on NT. Therefore, if we use static local
# storage (i.e., __declspec(thread) variables), we need the -GT
# NSPR uses both fibers and static thread-local storage
# (i.e., __declspec(thread) variables) on NT. We need the -GT
# flag to turn off certain compiler optimizations so that fibers
# can use static TLS safely.
#
# Also, we optimize for Pentium (-G5) on NT.
#
ifeq ($(OS_TARGET),WINNT)
ifeq ($(USE_STATIC_TLS),1)
OS_CFLAGS += -GT
endif
ifeq ($(CPU_ARCH),x86)
OS_CFLAGS += -G5
endif

Просмотреть файл

@ -16,18 +16,14 @@
# Reserved.
#
ifndef topsrcdir
topsrcdir = $(MOD_DEPTH)
endif
# Configuration information for building in the NSPR source module
# Define an include-at-most-once-flag
NSPR_CONFIG_MK = 1
include $(topsrcdir)/config/module.df
include $(MOD_DEPTH)/config/module.df
include $(topsrcdir)/config/arch.mk
include $(MOD_DEPTH)/config/arch.mk
ifndef NSDEPTH
NSDEPTH = $(MOD_DEPTH)/..
@ -46,29 +42,15 @@ NFSPWD = $(MOD_DEPTH)/config/nfspwd
LIBNSPR = $(DIST)/lib/libnspr.$(LIB_SUFFIX)
PURELIBNSPR = $(DIST)/lib/libpurenspr.$(LIB_SUFFIX)
CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
$(XCFLAGS)
CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
CCCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
# For purify
NOMD_CFLAGS = $(OPTIMIZER) $(NOMD_OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
$(XCFLAGS)
NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
ifdef USE_AUTOCONF
OPTIMIZER = $(ACCFLAGS)
DEFINES += -UDEBUG -DNDEBUG -DTRIMMED
endif
ifdef MOZ_DEBUG
ifdef USE_AUTOCONF
OPTIMIZER = $(ACCFLAGS)
else
OPTIMIZER = -g
endif
JAVA_OPTIMIZER = -g
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell $(WHOAMI)) -DTRACING
XBCFLAGS = -FR$*
endif
include $(topsrcdir)/config/$(OS_TARGET).mk
include $(MOD_DEPTH)/config/$(OS_TARGET).mk
# Figure out where the binary code lives.
BUILD = $(OBJDIR_NAME)
@ -79,18 +61,8 @@ MOZ_INCL = $(NSDEPTH)/dist/public/win16
MOZ_DIST = $(NSDEPTH)/dist/WIN16D_D.OBJ
endif
ifdef USE_AUTOCONF
EMACS = $(ACEMACS)
PERL = $(ACPERL)
RANLIB = $(ACRANLIB)
UNZIP_PROG = $(ACUNZIP)
WHOAMI = $(ACWHOAMI)
ZIP_PROG = $(ACZIP)
DEPENDENCIES = .md
else
VPATH = $(OBJDIR)
DEPENDENCIES = $(OBJDIR)/.md
endif
ifdef BUILD_DEBUG_GC
DEFINES += -DDEBUG_GC

57
nsprpub/config/now.c Normal file
Просмотреть файл

@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#if defined(XP_UNIX)
#include <sys/time.h>
#elif defined(WIN32)
#include <sys/timeb.h>
#else
#error "Architecture not supported"
#endif
int main(int argc, char **argv)
{
#if defined(XP_UNIX)
long long now;
struct timeval tv;
gettimeofday(&tv, NULL);
now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
#if defined(OSF1)
return fprintf(stdout, "%ld", now);
#else
return fprintf(stdout, "%lld", now);
#endif
#elif defined(WIN32)
__int64 now;
struct timeb b;
ftime(&b);
now = b.time;
now *= 1000000;
now += (1000 * b.millitm);
return fprintf(stdout, "%I64d", now);
#else
#error "Architecture not supported"
#endif
} /* main */
/* now.c */

Просмотреть файл

@ -24,21 +24,26 @@
#include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <utime.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#ifdef USE_REENTRANT_LIBC
#include "libc_r.h"
#endif /* USE_REENTRANT_LIBC */
#include "pathsub.h"
#define HAVE_LCHOWN
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(linux) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(RHAPSODY)
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(RHAPSODY)
#undef HAVE_LCHOWN
#endif
@ -50,7 +55,7 @@
#define GETCWD_CAN_MALLOC
#endif
#ifdef linux
#ifdef LINUX
#include <getopt.h>
#endif
@ -70,7 +75,7 @@ usage(void)
fprintf(stderr,
"usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n"
" %*s [-DdltR] file [file ...] directory\n",
program, strlen(program), "");
program, (int)strlen(program), "");
exit(2);
}
@ -79,8 +84,7 @@ mkdirs(char *path, mode_t mode)
{
char *cp;
struct stat sb;
int res;
while (*path == '/' && path[1] == '/')
path++;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
@ -93,11 +97,7 @@ mkdirs(char *path, mode_t mode)
}
*cp = '/';
}
res = mkdir(path, mode);
if ((res != 0) && (errno == EEXIST))
return 0;
else
return res;
return mkdir(path, mode);
}
static uid_t
@ -340,3 +340,191 @@ main(int argc, char **argv)
free(todir);
return 0;
}
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
char *program;
void
fail(char *format, ...)
{
int error;
va_list ap;
#ifdef USE_REENTRANT_LIBC
R_STRERROR_INIT_R();
#endif
error = errno;
fprintf(stderr, "%s: ", program);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
if (error)
#ifdef USE_REENTRANT_LIBC
R_STRERROR_R(errno);
fprintf(stderr, ": %s", r_strerror_r);
#else
fprintf(stderr, ": %s", strerror(errno));
#endif
putc('\n', stderr);
exit(1);
}
char *
getcomponent(char *path, char *name)
{
if (*path == '\0')
return 0;
if (*path == '/') {
*name++ = '/';
} else {
do {
*name++ = *path++;
} while (*path != '/' && *path != '\0');
}
*name = '\0';
while (*path == '/')
path++;
return path;
}
#ifdef UNIXWARE
/* Sigh. The static buffer in Unixware's readdir is too small. */
struct dirent * readdir(DIR *d)
{
static struct dirent *buf = NULL;
#define MAX_PATH_LEN 1024
if(buf == NULL)
buf = (struct dirent *) malloc(sizeof(struct dirent) + MAX_PATH_LEN)
;
return(readdir_r(d, buf));
}
#endif
char *
ino2name(ino_t ino, char *dir)
{
DIR *dp;
struct dirent *ep;
char *name;
dp = opendir("..");
if (!dp)
fail("cannot read parent directory");
for (;;) {
if (!(ep = readdir(dp)))
fail("cannot find current directory");
if (ep->d_ino == ino)
break;
}
name = xstrdup(ep->d_name);
closedir(dp);
return name;
}
void *
xmalloc(size_t size)
{
void *p = malloc(size);
if (!p)
fail("cannot allocate %u bytes", size);
return p;
}
char *
xstrdup(char *s)
{
return strcpy((char*)xmalloc(strlen(s) + 1), s);
}
char *
xbasename(char *path)
{
char *cp;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (!cp) return path;
return cp + 1;
}
void
xchdir(char *dir)
{
if (chdir(dir) < 0)
fail("cannot change directory to %s", dir);
}
int
relatepaths(char *from, char *to, char *outpath)
{
char *cp, *cp2;
int len;
char buf[NAME_MAX];
assert(*from == '/' && *to == '/');
for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++)
if (*cp == '\0')
break;
while (cp[-1] != '/')
cp--, cp2--;
if (cp - 1 == to) {
/* closest common ancestor is /, so use full pathname */
len = strlen(strcpy(outpath, to));
if (outpath[len] != '/') {
outpath[len++] = '/';
outpath[len] = '\0';
}
} else {
len = 0;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
strcpy(outpath + len, "../");
len += 3;
}
while ((cp = getcomponent(cp, buf)) != 0) {
sprintf(outpath + len, "%s/", buf);
len += strlen(outpath + len);
}
}
return len;
}
void
reversepath(char *inpath, char *name, int len, char *outpath)
{
char *cp, *cp2;
char buf[NAME_MAX];
struct stat sb;
cp = strcpy(outpath + PATH_MAX - (len + 1), name);
cp2 = inpath;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
if (strcmp(buf, ".") == 0)
continue;
if (strcmp(buf, "..") == 0) {
if (stat(".", &sb) < 0)
fail("cannot stat current directory");
name = ino2name(sb.st_ino, "..");
len = strlen(name);
cp -= len + 1;
strcpy(cp, name);
cp[len] = '/';
free(name);
xchdir("..");
} else {
cp -= 3;
strncpy(cp, "../", 3);
xchdir(buf);
}
}
strcpy(outpath, cp);
}

Просмотреть файл

Просмотреть файл

@ -47,12 +47,9 @@
# ($OBJDIR automatically prepended to it)
#
################################################################################
ifndef topsrcdir
topsrcdir = $(MOD_DEPTH)
endif
ifndef NSPR_CONFIG_MK
include $(topsrcdir)/config/config.mk
include $(MOD_DEPTH)/config/config.mk
endif
#
@ -90,8 +87,10 @@ LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
else
ifdef MKSHLIB
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
endif
endif
ifdef HAVE_PURIFY
ifdef DSO_BACKEND
PURE_LIBRARY = $(OBJDIR)/purelib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
@ -151,10 +150,6 @@ ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
$(NOSUCHFILE) \
so_locations
ifdef USE_AUTOCONF
ALL_TRASH := $(filter-out $(OBJDIR), $(ALL_TRASH))
endif
ifdef DIRS
LOOP_OVER_DIRS = \
@for d in $(DIRS); do \
@ -187,11 +182,7 @@ clean::
+$(LOOP_OVER_DIRS)
clobber::
ifdef USE_AUTOCONF
rm -rf $(OBJS) $(TARGETS) $(GARBAGE) so_locations $(NOSUCHFILE)
else
rm -rf $(OBJS) $(TARGETS) $(OBJDIR) $(GARBAGE) so_locations $(NOSUCHFILE)
endif
+$(LOOP_OVER_DIRS)
realclean clobber_all::
@ -326,9 +317,9 @@ endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH), WINNT)
$(CCC) -Fo$@ -c $(CFLAGS) $<
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
else
$(CCC) -o $@ -c $(CFLAGS) $<
$(CCC) -o $@ -c $(CCCFLAGS) $<
endif
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
@ -346,18 +337,18 @@ else
$(CC) -Fo$@ -c $(CFLAGS) $*.c
endif
else
$(CC) -o $@ -c $(CFLAGS) $<
$(CC) -o $@ -c $(CFLAGS) $*.c
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
@$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) -c $<
$(AS) -o $@ $(ASFLAGS) -c $*.s
%.i: %.c
$(CC) -C -E $(CFLAGS) $< > $*.i
%: %.pl
rm -f $@; cp $< $@; chmod +x $@
rm -f $@; cp $*.pl $@; chmod +x $@
################################################################################
# Special gmake rules.
@ -375,3 +366,12 @@ $(OBJDIR)/%.$(OBJ_SUFFIX): %.s
# name already exists.
#
.PHONY: all alltags clean export install libs realclean release
#
# List the target pattern of an implicit rule as a dependency of the
# special target .PRECIOUS to preserve intermediate files made by
# implicit rules whose target patterns match that file's name.
# (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4,
# p. 107.)
#
.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)

Просмотреть файл

@ -23,7 +23,7 @@ export NSPR20=1
include $(MOD_DEPTH)/config/config.mk
DIRS = ds libc msgc
DIRS = ds libc
include $(MOD_DEPTH)/config/rules.mk

Просмотреть файл

@ -106,7 +106,9 @@ include $(MOD_DEPTH)/config/rules.mk
export:: $(TARGETS)
$(INSTALL) -m 444 $(HEADERS) $(DIST)/include
$(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
ifdef SHARED_LIBRARY
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(HEADERS) $(MOZ_INCL)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib

Просмотреть файл

@ -192,7 +192,7 @@ PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event)
int i, entryCount = self->monitor->entryCount;
event->synchronousResult = (void*)PR_TRUE;
PR_PostEvent(self, event);
PL_PostEvent(self, event);
/* We need to temporarily give up our event queue monitor if
we're holding it, otherwise, the thread we're going to wait
for notification from won't be able to enter it to process
@ -330,7 +330,7 @@ PL_RevokeEvents(PLEventQueue* self, void* owner)
{
PRCList* qp = self->queue.next;
while (qp != &self->queue) {
PREvent* event = PR_EVENT_PTR(qp);
PLEvent* event = PR_EVENT_PTR(qp);
qp = qp->next;
PR_ASSERT(event->owner != owner);
}

Просмотреть файл

@ -60,7 +60,7 @@ DefaultFreeTable(void *pool, void *item)
#pragma unused (pool)
#endif
PR_DELETE(item);
PR_Free(item);
}
static PLHashEntry * PR_CALLBACK
@ -81,7 +81,7 @@ DefaultFreeEntry(void *pool, PLHashEntry *he, PRUintn flag)
#endif
if (flag == HT_FREE_ENTRY)
PR_DELETE(he);
PR_Free(he);
}
static PLHashAllocOps defaultHashAllocOps = {
@ -92,10 +92,10 @@ static PLHashAllocOps defaultHashAllocOps = {
PR_IMPLEMENT(PLHashTable *)
PL_NewHashTable(PRUint32 n, PLHashFunction keyHash,
PLHashComparator keyCompare, PLHashComparator valueCompare,
PLHashAllocOps *allocOps, void *allocPriv)
const PLHashAllocOps *allocOps, void *allocPriv)
{
PLHashTable *ht;
PRUint32 nb;
PRSize nb;
if (n <= MINBUCKETS) {
n = MINBUCKETSLOG2;
@ -113,7 +113,7 @@ PL_NewHashTable(PRUint32 n, PLHashFunction keyHash,
memset(ht, 0, sizeof *ht);
ht->shift = PL_HASH_BITS - n;
n = 1 << n;
#if defined(XP_PC) && !defined(_WIN32)
#if defined(WIN16)
if (n > 16000) {
(*allocOps->freeTable)(allocPriv, ht);
return 0;
@ -140,7 +140,7 @@ PL_HashTableDestroy(PLHashTable *ht)
{
PRUint32 i, n;
PLHashEntry *he, *next;
PLHashAllocOps *allocOps = ht->allocOps;
const PLHashAllocOps *allocOps = ht->allocOps;
void *allocPriv = ht->allocPriv;
n = NBUCKETS(ht);
@ -201,7 +201,7 @@ PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep,
{
PRUint32 i, n;
PLHashEntry *he, *next, **oldbuckets;
PRUint32 nb;
PRSize nb;
/* Grow the table if it is overloaded */
n = NBUCKETS(ht);
@ -211,7 +211,7 @@ PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep,
#endif
ht->shift--;
oldbuckets = ht->buckets;
#if defined(XP_PC) && !defined(_WIN32)
#if defined(WIN16)
if (2 * n > 16000)
return 0;
#endif /* WIN16 */
@ -280,7 +280,7 @@ PL_HashTableRawRemove(PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he)
{
PRUint32 i, n;
PLHashEntry *next, **oldbuckets;
PRUint32 nb;
PRSize nb;
*hep = he->next;
(*ht->allocOps->freeEntry)(ht->allocPriv, he, HT_FREE_ENTRY);

Просмотреть файл

@ -21,7 +21,6 @@
/*
* API to portable hash table code.
*/
#include <stddef.h>
#include <stdio.h>
#include "prtypes.h"
@ -30,10 +29,10 @@ PR_BEGIN_EXTERN_C
typedef struct PLHashEntry PLHashEntry;
typedef struct PLHashTable PLHashTable;
typedef PRUint32 PLHashNumber;
#define PL_HASH_BITS 32
#define PL_HASH_BITS 32 /* Number of bits in PLHashNumber */
typedef PLHashNumber (PR_CALLBACK *PLHashFunction)(const void *key);
typedef PRIntn (PR_CALLBACK *PLHashComparator)(const void *v1, const void *v2);
typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg);
typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn index, void *arg);
/* Flag bits in PLHashEnumerator's return value */
#define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */
@ -65,7 +64,7 @@ struct PLHashTable {
PLHashFunction keyHash; /* key hash function */
PLHashComparator keyCompare; /* key comparison function */
PLHashComparator valueCompare; /* value comparison function */
PLHashAllocOps *allocOps; /* allocation operations */
const PLHashAllocOps *allocOps; /* allocation operations */
void *allocPriv; /* allocation private data */
#ifdef HASHMETER
PRUint32 nlookups; /* total number of lookups */
@ -80,13 +79,38 @@ struct PLHashTable {
* If allocOps is null, use default allocator ops built on top of malloc().
*/
PR_EXTERN(PLHashTable *)
PL_NewHashTable(PRUint32 n, PLHashFunction keyHash,
PL_NewHashTable(PRUint32 numBuckets, PLHashFunction keyHash,
PLHashComparator keyCompare, PLHashComparator valueCompare,
PLHashAllocOps *allocOps, void *allocPriv);
const PLHashAllocOps *allocOps, void *allocPriv);
PR_EXTERN(void)
PL_HashTableDestroy(PLHashTable *ht);
/* Higher level access methods */
PR_EXTERN(PLHashEntry *)
PL_HashTableAdd(PLHashTable *ht, const void *key, void *value);
PR_EXTERN(PRBool)
PL_HashTableRemove(PLHashTable *ht, const void *key);
PR_EXTERN(void *)
PL_HashTableLookup(PLHashTable *ht, const void *key);
PR_EXTERN(PRIntn)
PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg);
/* General-purpose C string hash function. */
PR_EXTERN(PLHashNumber)
PL_HashString(const void *key);
/* Compare strings using strcmp(), return true if equal. */
PR_EXTERN(PRIntn)
PL_CompareStrings(const void *v1, const void *v2);
/* Stub function just returns v1 == v2 */
PR_EXTERN(PRIntn)
PL_CompareValues(const void *v1, const void *v2);
/* Low level access methods */
PR_EXTERN(PLHashEntry **)
PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key);
@ -98,34 +122,10 @@ PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep, PLHashNumber keyHash,
PR_EXTERN(void)
PL_HashTableRawRemove(PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he);
/* Higher level access methods */
PR_EXTERN(PLHashEntry *)
PL_HashTableAdd(PLHashTable *ht, const void *key, void *value);
PR_EXTERN(PRBool)
PL_HashTableRemove(PLHashTable *ht, const void *key);
PR_EXTERN(PRIntn)
PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg);
PR_EXTERN(void *)
PL_HashTableLookup(PLHashTable *ht, const void *key);
/* This can be trivially implemented using PL_HashTableEnumerateEntries. */
PR_EXTERN(PRIntn)
PL_HashTableDump(PLHashTable *ht, PLHashEnumerator dump, FILE *fp);
/* General-purpose C string hash function. */
PR_EXTERN(PLHashNumber)
PL_HashString(const void *key);
/* Compare strings using strcmp(), return true if equal. */
PR_EXTERN(int)
PL_CompareStrings(const void *v1, const void *v2);
/* Stub function just returns v1 == v2 */
PR_EXTERN(PRIntn)
PL_CompareValues(const void *v1, const void *v2);
PR_END_EXTERN_C
#endif /* plhash_h___ */

Просмотреть файл

@ -31,6 +31,7 @@ endif
INCLUDES = -I$(DIST)/include
CSRCS =\
plvrsion.c \
strlen.c \
strcpy.c \
strdup.c \
@ -95,6 +96,43 @@ endif
include $(MOD_DEPTH)/config/rules.mk
#
# Version information generation (begin)
#
RM = rm
ECHO = echo
INCLUDES = -I$(DIST)/include
TINC = $(OBJDIR)/_pl_bld.h
PROD = libplc$(MOD_VERSION).$(DLL_SUFFIX)
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
SH_DATE = $(shell date)
SH_NOW = $(shell $(NOW))
ifeq ($(OS_ARCH), WINNT)
SUF = i64
SH_QUOTE =
else
SUF = LL
SH_QUOTE = "
endif
$(TINC):
@$(MAKE_OBJDIR)
@$(ECHO) $(SH_QUOTE)#define _BUILD_STRING \"$(SH_DATE)\"$(SH_QUOTE) > $(TINC)
@$(ECHO) $(SH_QUOTE)#define _BUILD_TIME $(SH_NOW)$(SUF)$(SH_QUOTE) >> $(TINC)
@$(ECHO) $(SH_QUOTE)#define _PRODUCTION \"$(PROD)\"$(SH_QUOTE) >> $(TINC)
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): $(TINC)
ifeq ($(OS_ARCH), WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
endif
#
# Version information generation (end)
#
#
# The Client build wants the shared libraries in $(DIST)/bin,
# so we also install them there.
@ -102,7 +140,9 @@ include $(MOD_DEPTH)/config/rules.mk
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
ifdef SHARED_LIBRARY
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin

Просмотреть файл

@ -100,6 +100,10 @@ static const char *tags[] =
"PR_ALREADY_INITIATED_ERROR",
"PR_GROUP_EMPTY_ERROR",
"PR_INVALID_STATE_ERROR",
"PR_NETWORK_DOWN_ERROR",
"PR_SOCKET_SHUTDOWN_ERROR",
"PR_CONNECT_ABORTED_ERROR",
"PR_HOST_UNREACHABLE_ERROR",
"PR_MAX_ERROR"
};

Просмотреть файл

@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "prinit.h"
#include "prvrsion.h"
/************************************************************************/
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
#if !defined(_BUILD_TIME)
#define _BUILD_TIME 0
#endif
#if !defined(_BUILD_STRING)
#define _BUILD_STRING ""
#endif
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
static PRVersionDescription prVersionDescription_libplc21 =
{
/* version */ 2, /* this is the only one supported */
/* buildTime */ _BUILD_TIME, /* usecs since midnight 1/1/1970 GMT */
/* buildTimeString */ _BUILD_STRING, /* ditto, but human readable */
/* vMajor */ PR_VMAJOR, /* NSPR's version number */
/* vMinor */ PR_VMINOR, /* and minor version */
/* vPatch */ PR_VPATCH, /* and patch */
/* beta */ PR_BETA, /* beta build boolean */
#if defined(DEBUG)
/* debug */ PR_TRUE, /* a debug build */
#else
/* debug */ PR_FALSE, /* an optomized build */
#endif
/* special */ PR_FALSE, /* they're all special, but ... */
/* filename */ _PRODUCTION, /* the produced library name */
/* description */ "Portable runtime", /* what we are */
/* security */ "N/A", /* not applicable here */
/* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
/* comment */ "http://www.mozilla.org/NPL/",
/* specialString */ ""
};
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
return &prVersionDescription_libplc21;
} /* versionEntryPointType */
/* prvrsion.c */

Просмотреть файл

@ -75,7 +75,7 @@ extern RootFinder *_pr_rootFinders;
typedef struct CollectorTypeStr {
GCType gctype;
uint32 flags;
PRUint32 flags;
} CollectorType;
#define GC_MAX_TYPES 256

Просмотреть файл

@ -65,8 +65,8 @@ typedef PRInt32 (*PRWalkFun)(void GCPTR* obj, void* data);
*/
typedef struct GCType {
/*
** Scan an object that is in the GC heap and call PR_LiveObject on
** all of the pointers in it. If this slot is null then the object
** Scan an object that is in the GC heap and call GCInfo.livePointer
** on all of the pointers in it. If this slot is null then the object
** won't be scanned (i.e. it has no embedded pointers).
*/
void (PR_CALLBACK *scan)(void GCPTR *obj);
@ -353,7 +353,7 @@ PR_EXTERN(PRBool) PR_GC_In_Heap(void GCPTR *object);
/*
** Simple bounds check to see if a pointer is anywhere near the GC heap.
** Used to avoid calls to PR_ProcessRoot and PR_LiveObject by object
** Used to avoid calls to PR_ProcessRoot and GCInfo.livePointer by object
** scanning code.
*/
#if !defined(XP_PC) || defined(_WIN32)

Просмотреть файл

@ -105,7 +105,9 @@ include $(MOD_DEPTH)/config/rules.mk
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
ifdef SHARED_LIBRARY
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin

Просмотреть файл

@ -733,7 +733,10 @@ void ScanScanQ(GCScanQ *iscan)
next = &nextQ;
while (scan->queued) {
_GCTRACE(GC_MARK, ("continue scanQ @ 0x%x (%d)", scan, scan->queued));
/* Set pointer to current scanQ so that pr_liveObject can find it */
/*
* Set pointer to current scanQ so that _pr_gcData.livePointer
* can find it.
*/
pScanQ = next;
next->queued = 0;
@ -1890,7 +1893,7 @@ pr_ConservativeWalkPointer(void* ptr, PRWalkFun walkRootPointer, void* data)
return walkRootPointer(p, data);
}
static int32 PR_CALLBACK
static PRInt32 PR_CALLBACK
pr_ConservativeWalkBlock(void **base, PRInt32 count,
PRWalkFun walkRootPointer, void* data)
{
@ -2083,7 +2086,7 @@ PR_DumpMemory(PRBool detailed)
/******************************************************************************/
static int32 PR_CALLBACK
static PRInt32 PR_CALLBACK
pr_DumpRootPointer(PRWord* p, void* data)
{
#ifdef XP_MAC
@ -2247,7 +2250,7 @@ PRWord* pr_traceObj; /* set this in the debugger, then execute PR_TraceRoot() */
static PRInt32 PR_CALLBACK
pr_TraceRootObject(void* obj, void* data);
static int32 PR_CALLBACK
static PRInt32 PR_CALLBACK
pr_TraceRootPointer(PRWord *p, void* data)
{
PRInt32 printTrace = 0;
@ -3094,6 +3097,12 @@ PR_AllocSimpleMemory(PRWord requestedBytes, PRInt32 tix)
PR_ASSERT( bytes < MAX_ALLOC_SIZE );
#endif
/* Java can ask for objects bigger than 4M, but it won't get them */
/*
* This check was added because there is a fundamental limit of
* the size field maintained by the gc code. Going over the 4M
* limit caused some bits to roll over into another bit field,
* violating the max segment size and causing a bug.
*/
if (bytes >= MAX_ALLOC_SIZE) {
return NULL;
}
@ -3183,7 +3192,7 @@ PR_AllocSimpleMemory(PRWord requestedBytes, PRInt32 tix)
{
PRInt64 now = PR_Now();
double delta;
int32 bin;
PRInt32 bin;
GCBlockEnd* end = (GCBlockEnd*)((char*)p + OBJ_BYTES(p[0]) - sizeof(GCBlockEnd));
end->allocTime = allocTime;

Просмотреть файл

@ -31,7 +31,7 @@
#if defined(SOLARIS)
#define _MD_MMAP_FLAGS MAP_SHARED
#elif defined(OSF1) || defined(RELIANTUNIX)
#elif defined(RELIANTUNIX)
#define _MD_MMAP_FLAGS MAP_PRIVATE|MAP_FIXED
#else
#define _MD_MMAP_FLAGS MAP_PRIVATE

Просмотреть файл

@ -105,7 +105,7 @@ endif
endif
ifeq ($(OS_ARCH), HP-UX)
LDOPTS += -Wl,+s,+b,$(PWD)/$(DIST)/lib
LDOPTS += -z -Wl,+s,+b,$(PWD)/$(DIST)/lib
endif
# AIX

Просмотреть файл

@ -23,59 +23,66 @@ include $(MOD_DEPTH)/config/config.mk
# Disable optimization of the nspr on SunOS4.1.3
ifeq ($(OS_ARCH),SunOS)
ifeq ($(OS_RELEASE),4.1.3_U1)
OPTIMIZER =
endif
ifeq ($(OS_RELEASE),4.1.3_U1)
OPTIMIZER =
endif
endif
ifeq ($(OS_ARCH), IRIX)
CFLAGS += -KPIC
ifneq ($(OS_RELEASE),5.3)
CFLAGS += -exceptions
CFLAGS += -KPIC
ifneq ($(OS_RELEASE),5.3)
CFLAGS += -exceptions
endif
endif
ifeq ($(OS_ARCH),HP-UX)
ifeq (($USE_64),1)
CCCFLAGS += +DA2.0W
endif
endif
INCLUDES = -I$(DIST)/include -I../../../include
HEADERS = *.h
CXXSRCS = \
prstrms.cpp \
CXXSRCS = \
prstrms.cpp \
$(NULL)
OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
ifeq ($(OS_ARCH), WINNT)
ifeq (,$(filter-out WIN16 OS2,$(OS_TARGET)))
EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).lib
else
DLLBASE=/BASE:0x30000000
RES=$(OBJDIR)/prstrms.res
RESNAME=$(MOD_DEPTH)/pr/src/nspr.rc
OS_LIBS = user32.lib
EXTRA_LIBS = $(DIST)/lib/libnspr$(MOD_VERSION).lib
endif
else
ifeq ($(OS_ARCH), AIX)
ifeq ($(OS_RELEASE), 4.1)
ifeq ($(CLASSIC_NSPR),1)
OS_LIBS += -lC -lc
ifeq (,$(filter-out WIN16 OS2,$(OS_TARGET)))
EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).lib
else
OS_LIBS += -lC_r -lc_r
DLLBASE=/BASE:0x30000000
RES=$(OBJDIR)/prstrms.res
RESNAME=$(MOD_DEPTH)/pr/src/nspr.rc
OS_LIBS = user32.lib
EXTRA_LIBS = $(DIST)/lib/libnspr$(MOD_VERSION).lib
endif
else
ifeq ($(CLASSIC_NSPR),1)
MKSHLIB = /usr/lpp/xlC/bin/makeC++SharedLib -p 0
else
MKSHLIB = /usr/lpp/xlC/bin/makeC++SharedLib_r -p 0
endif
OS_LIBS += -ldl
endif
endif
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
EXTRA_LIBS = -L$(DIST)/lib -lnspr$(MOD_VERSION)_shr
else
EXTRA_LIBS = -L$(DIST)/lib -lnspr$(MOD_VERSION)
endif
ifeq ($(OS_ARCH), AIX)
ifeq ($(OS_RELEASE), 4.1)
ifeq ($(CLASSIC_NSPR),1)
OS_LIBS += -lC -lc
else
OS_LIBS += -lC_r -lc_r
endif
else
ifeq ($(CLASSIC_NSPR),1)
MKSHLIB = /usr/lpp/xlC/bin/makeC++SharedLib -p 0
else
MKSHLIB = /usr/lpp/xlC/bin/makeC++SharedLib_r -p 0
endif
OS_LIBS += -ldl
endif
endif
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
EXTRA_LIBS = -L$(DIST)/lib -lnspr$(MOD_VERSION)_shr
else
EXTRA_LIBS = -L$(DIST)/lib -lnspr$(MOD_VERSION)
endif
endif
# On NCR and SCOOS, we can't link with extra libraries when
@ -83,14 +90,14 @@ endif
# complain, but we would run into weird problems at run-time.
# Therefore on these platforms, we link just the object files.
ifeq ($(OS_ARCH),NCR)
EXTRA_LIBS =
EXTRA_LIBS =
endif
ifeq ($(OS_ARCH),SCOOS)
EXTRA_LIBS =
EXTRA_LIBS =
endif
ifeq ($(OS_ARCH), UNIXWARE)
OS_LIBS += -lC
OS_LIBS += -lC
endif
LIBRARY_NAME = prstrms

Двоичные данные
nsprpub/macbuild/NSPR20PPC.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -7,6 +7,7 @@ pratom.h
prbit.h
prclist.h
prcmon.h
prcountr.h
prcvar.h
prdtoa.h
prenv.h
@ -23,13 +24,16 @@ prmem.h
prmon.h
prmwait.h
prnetdb.h
prolock.h
prpdce.h
prprf.h
prproces.h
prsystem.h
prthread.h
prtime.h
prtrace.h
prtypes.h
prvrsion.h
prwin16.h
obsolete/protypes.h
@ -39,6 +43,3 @@ obsolete/probslet.h
private/prpriv.h
private/pprio.h
private/pprthred.h
md/prosdep.h
md/_macos.h

Просмотреть файл

@ -24,7 +24,11 @@ HEADERS = $(wildcard *.h)
include $(MOD_DEPTH)/config/rules.mk
ifeq ($(OS_ARCH),IRIX)
MDCPUCFG_H = _irix.cfg
ifeq ($(USE_64), 1)
MDCPUCFG_H = _irix64.cfg
else
MDCPUCFG_H = _irix32.cfg
endif
endif
ifeq ($(OS_ARCH),WINNT)
@ -55,12 +59,20 @@ ifeq ($(OS_ARCH),FreeBSD)
MDCPUCFG_H = _freebsd.cfg
endif
ifeq ($(OS_ARCH),OpenBSD)
MDCPUCFG_H = _openbsd.cfg
endif
ifeq ($(OS_ARCH),NetBSD)
MDCPUCFG_H = _netbsd.cfg
endif
ifeq ($(OS_ARCH),HP-UX)
MDCPUCFG_H = _hpux.cfg
ifeq ($(USE_64), 1)
MDCPUCFG_H = _hpux64.cfg
else
MDCPUCFG_H = _hpux32.cfg
endif
endif
ifeq ($(OS_ARCH),Linux)

Просмотреть файл

@ -54,15 +54,31 @@
#define HAVE_DLL
#define USE_DLFCN
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
/* Timer operations */
#define AIX_TIMERS
#if defined(AIX_TIMERS)
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
#endif /* defined(AIX_TIMERS) */
/* The atomic operations */
#include <sys/atomic_op.h>
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) ((PRInt32)fetch_and_add((atomic_p)val, 1) + 1)
#define _MD_ATOMIC_ADD(ptr, val) ((PRInt32)fetch_and_add((atomic_p)ptr, val) + val)
#define _MD_ATOMIC_DECREMENT(val) ((PRInt32)fetch_and_add((atomic_p)val, -1) - 1)
#define _MD_ATOMIC_SET(val, newval) _AIX_AtomicSet(val, newval)
@ -138,6 +154,42 @@ 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;
};

Просмотреть файл

@ -37,6 +37,8 @@
#define HAVE_BSD_FLOCK
#define NEED_TIME_R
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_NO_LARGE_FILES
#if defined(BSDI_2)
#define PROT_NONE 0x0
@ -110,6 +112,42 @@ 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;
};

Просмотреть файл

@ -27,8 +27,14 @@
#define RHAPOSDY
#endif
#if defined(i386)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1
#else
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#endif
#define HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS 1
@ -53,6 +59,7 @@
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_DWORD 64
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
@ -117,3 +124,4 @@
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

Просмотреть файл

@ -38,24 +38,23 @@
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#define HAVE_WEAK_MALLOC_SYMBOLS
/* do this until I figure out the rhapsody dll stuff. */
#define HAVE_DLL
#define USE_RLD
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_TIMESPEC_HAS_TS_SEC
#define _PR_NO_LARGE_FILES
#define USE_SETJMP
#ifndef _PR_PTHREADS
#if !defined(_PR_PTHREADS)
#include <setjmp.h>
#define PR_CONTEXT_TYPE jmp_buf
#define CONTEXT(_th) ((_th)->md.context)
#define _MD_GET_SP(_th) (_th)->md.context[0]
#define PR_NUM_GCREGS _JBLEN
#define CONTEXT(_th) ((_th)->md.context)
#define _MD_GET_SP(_th) (((struct sigcontext *) (_th)->md.context)->sc_onstack)
#define PR_NUM_GCREGS _JBLEN
/*
** Initialize a thread context to run "_main()" when started
@ -66,7 +65,7 @@
if (setjmp(CONTEXT(_thread))) { \
_main(); \
} \
_MD_GET_SP(_thread) = (int) ((_sp) - 64); \
_MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
@ -113,6 +112,42 @@ 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;
};
@ -149,14 +184,14 @@ 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_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_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,

Просмотреть файл

@ -71,9 +71,6 @@
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define _PR_USE_POLL
#define _PR_POLL_AVAILABLE
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE

Просмотреть файл

@ -44,6 +44,8 @@
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define _PR_NEED_STRCASECMP
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define USE_SETJMP

Просмотреть файл

@ -37,6 +37,8 @@
#define HAVE_DLL
#define USE_DLFCN
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_NO_LARGE_FILES
#define USE_SETJMP
@ -106,6 +108,42 @@ 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;
};

Просмотреть файл

Просмотреть файл

@ -43,6 +43,9 @@
#ifndef HAVE_STRERROR
#define HAVE_STRERROR
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
#undef _PR_HAVE_ATOMIC_OPS
@ -117,6 +120,42 @@ 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;
};
@ -150,8 +189,16 @@ struct _MDCPU {
#define _MD_FINAL_INIT _PR_UnixInit
#endif
#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
#endif
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
@ -160,8 +207,6 @@ struct _MDCPU {
#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)
extern void _MD_hpux_install_sigfpe_handler(void);
#ifdef HPUX11
extern void _MD_hpux_map_sendfile_error(int err);
#if !defined(_PR_PTHREADS)

Просмотреть файл

@ -0,0 +1,121 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef HPUX
#define HPUX
#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_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 8
#define PR_ALIGN_OF_POINTER 4
#define HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#define 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___ */

Просмотреть файл

@ -0,0 +1,122 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef HPUX
#define HPUX
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define IS_64
#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 8
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 8
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_WORD_LOG2 3
#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 64
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 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 6
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 6
#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 8
#define HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#define 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___ */

Просмотреть файл

Просмотреть файл

@ -19,6 +19,13 @@
#ifndef nspr_irix_defs_h___
#define nspr_irix_defs_h___
#define _PR_HAVE_ATOMIC_CAS
/*
* MipsPro assembler defines _LANGUAGE_ASSEMBLY
*/
#ifndef _LANGUAGE_ASSEMBLY
#include "prclist.h"
#include "prthread.h"
#include <sys/ucontext.h>
@ -46,6 +53,11 @@
#define HAVE_DLL
#define USE_DLFCN
#define _PR_HAVE_ATOMIC_OPS
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ST_ATIM
#define _PR_HAVE_OFF64_T
#define HAVE_POINTER_LOCALTIME_R
/* Initialization entry points */
PR_EXTERN(void) _MD_EarlyInit(void);
@ -57,11 +69,11 @@ PR_EXTERN(void) _MD_IrixInit(void);
#define _MD_INIT_IO()
/* Timer operations */
PR_EXTERN(PRIntervalTime) _MD_GetInterval(void);
#define _MD_GET_INTERVAL _MD_GetInterval
PR_EXTERN(PRIntervalTime) _MD_IrixGetInterval(void);
#define _MD_GET_INTERVAL _MD_IrixGetInterval
PR_EXTERN(PRIntervalTime) _MD_IntervalPerSec(void);
#define _MD_INTERVAL_PER_SEC _MD_IntervalPerSec
PR_EXTERN(PRIntervalTime) _MD_IrixIntervalPerSec(void);
#define _MD_INTERVAL_PER_SEC _MD_IrixIntervalPerSec
/* GC operations */
PR_EXTERN(void *) _MD_GetSP(PRThread *thread);
@ -71,6 +83,7 @@ PR_EXTERN(void *) _MD_GetSP(PRThread *thread);
#include <mutex.h>
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) add_then_test((unsigned long*)val, 1)
#define _MD_ATOMIC_ADD(ptr, val) add_then_test((unsigned long*)ptr, (unsigned long)val)
#define _MD_ATOMIC_DECREMENT(val) add_then_test((unsigned long*)val, 0xffffffff)
#define _MD_ATOMIC_SET(val, newval) test_and_set((unsigned long*)val, newval)
@ -107,8 +120,8 @@ struct sproc_private_data {
extern char *_nspr_sproc_private;
#define _PR_PRDA() ((struct sproc_private_data *) _nspr_sproc_private)
#define _MD_CURRENT_THREAD() (_PR_PRDA()->me)
#define _MD_SET_CURRENT_THREAD(_thread) _PR_PRDA()->me = (_thread)
#define _MD_THIS_THREAD() (_PR_PRDA()->me)
#define _MD_LAST_THREAD() (_PR_PRDA()->last)
#define _MD_SET_LAST_THREAD(_thread) _PR_PRDA()->last = (_thread)
#define _MD_CURRENT_CPU() (_PR_PRDA()->cpu)
@ -120,13 +133,16 @@ extern char *_nspr_sproc_private;
#define _MD_GET_SPROC_PID() (_PR_PRDA()->sproc_pid)
PR_EXTERN(struct PRThread*) _MD_get_attached_thread(void);
PR_EXTERN(struct PRThread*) _MD_get_current_thread(void);
#define _MD_GET_ATTACHED_THREAD() _MD_get_attached_thread()
#define _MD_CURRENT_THREAD() _MD_get_current_thread()
#define _MD_CHECK_FOR_EXIT() { \
if (_pr_irix_exit_now) { \
if (_pr_irix_exit_now) { \
_PR_POST_SEM(_pr_irix_exit_sem); \
exit(0); \
} \
_MD_Wakeup_CPUs(); \
_exit(0); \
} \
}
#define _MD_ATTACH_THREAD(threadp)
@ -137,23 +153,26 @@ PR_EXTERN(struct PRThread*) _MD_get_attached_thread(void);
extern struct _PRCPU *_pr_primordialCPU;
extern usema_t *_pr_irix_exit_sem;
extern PRInt32 _pr_irix_exit_now;
extern int _pr_irix_primoridal_cpu_fd[];
extern PRInt32 _pr_irix_process_exit;
extern PRInt32 _pr_irix_process_exit_code;
/* Thread operations */
#define _PR_LOCK_HEAP() { \
PRIntn _is; \
if (_pr_primordialCPU) { \
if (_PR_MD_CURRENT_THREAD() && \
if (_MD_GET_ATTACHED_THREAD() && \
!_PR_IS_NATIVE_THREAD( \
_PR_MD_CURRENT_THREAD())) \
_MD_GET_ATTACHED_THREAD())) \
_PR_INTSOFF(_is); \
_PR_LOCK(_pr_heapLock); \
}
#define _PR_UNLOCK_HEAP() if (_pr_primordialCPU) { \
_PR_UNLOCK(_pr_heapLock); \
if (_PR_MD_CURRENT_THREAD() && \
if (_MD_GET_ATTACHED_THREAD() && \
!_PR_IS_NATIVE_THREAD( \
_PR_MD_CURRENT_THREAD())) \
_MD_GET_ATTACHED_THREAD())) \
_PR_INTSON(_is); \
} \
}
@ -179,7 +198,7 @@ struct _MDLock {
#define _PR_LOCK(lock) { \
PRIntn _is; \
PRThread *me = _PR_MD_CURRENT_THREAD(); \
PRThread *me = _MD_GET_ATTACHED_THREAD(); \
if (me && !_PR_IS_NATIVE_THREAD(me)) \
_PR_INTSOFF(_is); \
ussetlock(lock); \
@ -189,7 +208,7 @@ struct _MDLock {
#define _PR_UNLOCK(lock) { \
PRIntn _is; \
PRThread *me = _PR_MD_CURRENT_THREAD(); \
PRThread *me = _MD_GET_ATTACHED_THREAD(); \
if (me && !_PR_IS_NATIVE_THREAD(me)) \
_PR_INTSOFF(_is); \
usunsetlock(lock); \
@ -216,9 +235,6 @@ struct _MDThread {
PRInt32 id;
PRInt32 suspending_id;
int errcode;
PRStatus *creation_status; /* points to the variable in which
* a newly created child thread is
* to store its creation status */
};
struct _MDThreadStack {
@ -237,6 +253,43 @@ 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 {
PRInt32 id;
PRInt32 suspending_id;
@ -290,9 +343,13 @@ struct _MDCPU {
longjmp(jb, 1); \
PR_END_MACRO
PR_EXTERN(PRStatus) _MD_InitThread(struct PRThread *thread, PRBool wakeup_parent);
PR_EXTERN(PRStatus) _MD_InitThread(struct PRThread *thread,
PRBool wakeup_parent);
PR_EXTERN(PRStatus) _MD_InitAttachedThread(struct PRThread *thread,
PRBool wakeup_parent);
#define _MD_INIT_THREAD(thread) _MD_InitThread(thread, PR_TRUE)
#define _MD_INIT_ATTACHED_THREAD(thread) _MD_InitThread(thread, PR_FALSE)
#define _MD_INIT_ATTACHED_THREAD(thread) \
_MD_InitAttachedThread(thread, PR_FALSE)
PR_EXTERN(void) _MD_ExitThread(struct PRThread *thread);
#define _MD_EXIT_THREAD _MD_ExitThread
@ -329,6 +386,9 @@ PR_EXTERN(void) _MD_CleanThread(struct PRThread *thread);
PR_EXTERN(PRStatus) _MD_wait(struct PRThread *, PRIntervalTime timeout);
#define _MD_WAIT _MD_wait
PR_EXTERN(void) _PR_MD_primordial_cpu();
PR_EXTERN(void) _PR_MD_WAKEUP_PRIMORDIAL_CPU();
PR_EXTERN(PRStatus) _MD_WakeupWaiter(struct PRThread *);
#define _MD_WAKEUP_WAITER _MD_WakeupWaiter
@ -353,6 +413,8 @@ PR_EXTERN(PRStatus) _MD_CreateThread(
extern void _MD_CleanupBeforeExit(void);
#define _MD_CLEANUP_BEFORE_EXIT _MD_CleanupBeforeExit
PR_EXTERN(void) _PR_MD_PRE_CLEANUP(PRThread *me);
/* The following defines the unwrapped versions of select() and poll(). */
extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
@ -375,4 +437,6 @@ PR_EXTERN(void) _MD_InitRunningCPU(struct _PRCPU *cpu);
#endif /* defined(_PR_PTHREADS) */
#endif /* _LANGUAGE_ASSEMBLY */
#endif /* nspr_irix_defs_h___ */

Просмотреть файл

@ -0,0 +1,128 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef _SGI_MP_SOURCE
#define _SGI_MP_SOURCE
#endif
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef IRIX
#define IRIX
#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_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#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_ALIGN_OF_WORD 4
#define HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS
#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___ */

Просмотреть файл

@ -0,0 +1,127 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef _SGI_MP_SOURCE
#define _SGI_MP_SOURCE
#endif
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef IRIX
#define IRIX
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define IS_64
#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 8
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 8
#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 64
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 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 6
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 6
#define PR_BYTES_PER_WORD_LOG2 3
#define PR_BYTES_PER_DWORD_LOG2 3
#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_ALIGN_OF_WORD 4
#define HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#define 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___ */

Просмотреть файл

@ -64,6 +64,14 @@
#endif
#define USE_SETJMP
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
#if defined(__alpha)
#define _PR_HAVE_LARGE_OFF_T
#else
#define _PR_NO_LARGE_FILES
#endif
#ifdef _PR_PTHREADS
@ -282,6 +290,42 @@ 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;
};
@ -334,7 +378,7 @@ extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_SELECT __select
#ifdef _PR_POLL_AVAILABLE
#include <poll.h>
#include <sys/poll.h>
extern int __syscall_poll(struct pollfd *ufds, unsigned long int nfds,
int timeout);
#define _MD_POLL __syscall_poll

Просмотреть файл

@ -103,6 +103,7 @@ struct _MDFileDesc {
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
/*
** CPU Related definitions
@ -462,11 +463,13 @@ typedef short PROSFD;
// Errors not found in the Mac StdCLib
#define EACCES 13 // Permission denied
#define ENOENT -43 // No such file or directory
#define EMFILE 24 // Too many open files
#define _OS_INVALID_FD_VALUE -1
#define STDERR_FILENO 2
#if !defined(MAC_NSPR_STANDALONE)
#define MAC_PATH_SEPARATOR ':'
#define PATH_SEPARATOR ':'
#define PATH_SEPARATOR_STR ":"
#define DIRECTORY_SEPARATOR '/'
@ -476,6 +479,10 @@ typedef short PROSFD;
#define UNIX_THIS_DIRECTORY_STR "./"
#define UNIX_PARENT_DIRECTORY_STR "../"
#define MAX_PATH 512
#define MAX_MAC_FILENAME 31
#define MAXPATHLEN MAX_PATH
// Alias a few names
#define getenv PR_GetEnv
@ -527,6 +534,10 @@ extern void dprintf(const char *format, ...);
extern PRUint8 CallCacheFlushers(size_t blockSize);
#endif
enum {
kPrivateNSPREventType = 13
};
#if defined(MAC_NSPR_STANDALONE)
extern void* reallocSmaller(void* block, size_t newSize);
#endif
@ -535,7 +546,7 @@ extern void* reallocSmaller(void* block, size_t newSize);
/*
** PR_GetSystemInfo related definitions
*/
#define _PR_SI_SYSNAME "Mac OS"
#define _PR_SI_SYSNAME "MacOS"
#define _PR_SI_ARCHITECTURE "PowerPC"
/*

Просмотреть файл

@ -71,8 +71,7 @@
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -45,6 +45,9 @@
#define HAVE_WEAK_IO_SYMBOLS
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#undef HAVE_STACK_GROWING_UP
#define HAVE_NETCONFIG
#define NEED_STRFTIME_LOCK
@ -124,6 +127,42 @@ 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;
};

Просмотреть файл

@ -108,6 +108,42 @@ 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;
};

Просмотреть файл

@ -134,6 +134,42 @@ 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;
};

Просмотреть файл

@ -119,6 +119,42 @@ 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 {
jmp_buf jb;
pthread_t pthread;

Просмотреть файл

@ -0,0 +1,262 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef OPENBSD
#define OPENBSD
#endif
#if defined(__i386__) || defined(__arm32__)
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define 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
#elif defined(__sparc__)
#undef IS_LITTLE_ENDIAN 1
#define IS_BIG_ENDIAN 1
#define HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#define 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
#elif defined(__alpha__)
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define IS_64
#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 8
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 8
#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 64
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 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 6
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 6
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 8
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 8
#define PR_BYTES_PER_WORD_LOG2 3
#define PR_BYTES_PER_DWORD_LOG2 3
#elif defined(__powerpc__) || defined(__m68k__)
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#else
#error Must define constants for type sizes here.
#endif
#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___ */

Просмотреть файл

@ -0,0 +1,171 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nspr_openbsd_defs_h___
#define nspr_openbsd_defs_h___
#include <sys/syscall.h>
#define PR_LINKER_ARCH "openbsd"
#define _PR_SI_SYSNAME "OpenBSD"
#if defined(__i386__)
#define _PR_SI_ARCHITECTURE "x86"
#elif defined(__alpha__)
#define _PR_SI_ARCHITECTURE "alpha"
#elif defined(__m68k__)
#define _PR_SI_ARCHITECTURE "m68k"
#elif defined(__powerpc__)
#define _PR_SI_ARCHITECTURE "powerpc"
#elif defined(__sparc__)
#define _PR_SI_ARCHITECTURE "sparc"
#elif defined(__arm32__)
#define _PR_SI_ARCHITECTURE "arm32"
#endif
#define PR_DLL_SUFFIX ".so.1.0"
#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_DLL
#define USE_DLFCN
#define _PR_HAVE_SOCKADDR_LEN
#define USE_SETJMP
#ifndef _PR_PTHREADS
#include <setjmp.h>
#define PR_CONTEXT_TYPE sigjmp_buf
#define CONTEXT(_th) ((_th)->md.context)
#if defined(__i386__) || defined(__sparc__) || defined(__m68k__) || defined(__powerpc__)
#define JB_SP_INDEX 2
#elif defined(__alpha__)
#define JB_SP_INDEX 34
#elif defined(__arm32__)
/*
* On the arm32, the jmpbuf regs underwent a namechange after NetBSD 1.3
*/
#ifdef JMPBUF_REG_R13
#define JB_SP_INDEX JMPBUF_REG_R13
#else
#define JB_SP_INDEX _JB_REG_R13
#endif
#else
#error "Need to define SP index in jmp_buf here"
#endif
#define _MD_GET_SP(_th) (_th)->md.context[JB_SP_INDEX]
#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 (sigsetjmp(CONTEXT(_thread), 1)) { \
_main(); \
} \
_MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!sigsetjmp(CONTEXT(_thread), 1)) { \
(_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); \
siglongjmp(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;
};
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_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)
#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
/*
* 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_openbsd_defs_h___ */

Просмотреть файл

@ -245,6 +245,7 @@ extern PRInt32 _MD_CloseSocket(PRInt32 osfd);
#define _MD_INIT_ATOMIC _PR_MD_INIT_ATOMIC
#define _MD_ATOMIC_INCREMENT(x) _PR_MD_ATOMIC_INCREMENT(x)
#define _MD_ATOMIC_ADD(x,y) _PR_MD_ATOMIC_ADD(x,y)
#define _MD_ATOMIC_DECREMENT(x) _PR_MD_ATOMIC_DECREMENT(x)
#define _MD_ATOMIC_SET(x,y) _PR_MD_ATOMIC_SET(x, y)
@ -340,6 +341,7 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen,
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT _PR_MD_EARLY_INIT

Просмотреть файл

@ -75,8 +75,7 @@
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 8
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -28,15 +28,10 @@
#define _PR_SI_ARCHITECTURE "alpha"
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 131072L
/*
* OSF1 needs the MAP_FIXED flag to ensure that mmap returns a pointer
* with the upper 32 bits zero. This is because Java sticks a pointer
* into an int.
*/
#define _MD_MMAP_FLAGS MAP_PRIVATE|MAP_FIXED
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 131072L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#undef HAVE_WEAK_IO_SYMBOLS
@ -47,6 +42,13 @@
#define NEED_TIME_R
#define USE_DLFCN
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
#define _PR_HAVE_LARGE_OFF_T
#define USE_SETJMP
#include <setjmp.h>
@ -116,6 +118,42 @@ 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;
};
@ -159,15 +197,13 @@ extern int __poll(struct pollfd filedes[], unsigned int nfds, int timeout);
/*
* Atomic operations
*/
/* builtins.h is not available for OSF1 V3.2. */
#ifndef OSF1V3
#ifdef _PR_HAVE_ATOMIC_OPS
#include <machine/builtins.h>
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) (__ATOMIC_INCREMENT_LONG(val) + 1)
#define _MD_ATOMIC_ADD(ptr, val) (__ATOMIC_ADD_LONG(ptr, val) + val)
#define _MD_ATOMIC_DECREMENT(val) (__ATOMIC_DECREMENT_LONG(val) - 1)
#define _MD_ATOMIC_SET(val, newval) __ATOMIC_EXCH_LONG(val, newval)
#endif /* OSF1V3 */
#endif /* _PR_HAVE_ATOMIC_OPS */
#endif /* nspr_osf1_defs_h___ */

Просмотреть файл

@ -25,6 +25,7 @@
#define _PR_MD_BLOCK_CLOCK_INTERRUPTS()
#define _PR_MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _PR_MD_DISABLE_CLOCK_INTERRUPTS()
#define _PR_MD_ENABLE_CLOCK_INTERRUPTS()
/* In good standards fashion, the DCE threads (based on posix-4) are not
* quite the same as newer posix implementations. These are mostly name
@ -70,7 +71,7 @@
#define PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
|| defined(HPUX) || defined(LINUX) || defined(FREEBSD) \
|| defined(NETBSD)
|| defined(NETBSD) || defined(OPENBSD)
#define PTHREAD_ZERO_THR_HANDLE(t) (t) = 0
#define PTHREAD_THR_HANDLE_IS_ZERO(t) (t) == 0
#define PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
@ -100,21 +101,6 @@
#error "Cannot determine pthread strategy"
#endif
/*
* See if we have the privilege to set the scheduling policy and
* priority of threads. Returns 0 if privilege is available.
* Returns EPERM otherwise.
*/
#ifdef AIX
#define PT_PRIVCHECK() privcheck(SET_PROC_RAC)
#elif defined(HPUX) && !defined(_PR_DCETHREADS)
PR_EXTERN(PRIntn) pt_hpux_privcheck(void);
#define PT_PRIVCHECK() pt_hpux_privcheck()
#else
#define PT_PRIVCHECK() 0
#endif /* AIX */
#if defined(_PR_DCETHREADS)
#define PTHREAD_EXPLICIT_SCHED PTHREAD_DEFAULT_SCHED
#endif
@ -136,7 +122,7 @@ PR_EXTERN(PRIntn) pt_hpux_privcheck(void);
*/
#if defined(_PR_DCETHREADS) || defined(FREEBSD) \
|| (defined(LINUX) && defined(__alpha)) \
|| defined(NETBSD)
|| defined(NETBSD) || defined(OPENBSD)
#define PT_NO_ATFORK
#endif
@ -144,7 +130,7 @@ PR_EXTERN(PRIntn) pt_hpux_privcheck(void);
* These platforms don't have sigtimedwait()
*/
#if (defined(AIX) && !defined(AIX4_3)) || defined(LINUX) \
|| defined(FREEBSD) || defined(NETBSD)
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
#define PT_NO_SIGTIMEDWAIT
#endif
@ -186,20 +172,26 @@ PR_EXTERN(PRIntn) pt_hpux_privcheck(void);
*/
#define PT_PRIO_MIN 1
#define PT_PRIO_MAX 127
#elif defined(FREEBSD) || defined(NETBSD) /* XXX */
#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) /* XXX */
#define PT_PRIO_MIN 0
#define PT_PRIO_MAX 126
#else
#error "pthreads is not supported for this architecture"
#endif
/* Needed for garbage collection -- Look at PR_Suspend/PR_Resume implementation */
#if defined(OSF1)
#define PTHREAD_YIELD() pthread_yield_np()
#elif defined(HPUX10_30) || defined(HPUX11)
#define PTHREAD_YIELD() sched_yield()
#elif defined(HPUX)
/*
* The PTHREAD_YIELD function is called from a signal handler.
* Needed for garbage collection -- Look at PR_Suspend/PR_Resume
* implementation.
*/
#if defined(_PR_DCETHREADS)
#define PTHREAD_YIELD() pthread_yield()
#elif defined(OSF1)
/*
* sched_yield can't be called from a signal handler. Must use
* the _np version.
*/
#define PTHREAD_YIELD() pthread_yield_np()
#elif defined(AIX)
extern int (*_PT_aix_yield_fcn)();
#define PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
@ -211,12 +203,9 @@ extern int (*_PT_aix_yield_fcn)();
onemillisec.tv_nsec = 1000000L; \
nanosleep(&onemillisec,NULL); \
PR_END_MACRO
#elif defined(SOLARIS)
#define PTHREAD_YIELD() sched_yield()
#elif defined(LINUX)
#elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)
#define PTHREAD_YIELD() sched_yield()
#elif defined(FREEBSD) || defined(NETBSD)
#define PTHREAD_YIELD() pthread_yield()
#else
#error "Need to define PTHREAD_YIELD for this platform"
#endif

Просмотреть файл

@ -76,8 +76,7 @@
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -47,6 +47,8 @@
#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
/*
* Mike Patnode indicated that it is possibly safe now to use context-switching
@ -109,6 +111,42 @@ 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;
};

Просмотреть файл

@ -27,8 +27,14 @@
#define RHAPOSDY
#endif
#if defined(i386)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1
#else
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#endif
#define HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS 1
@ -53,6 +59,7 @@
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_DWORD 64
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
@ -117,3 +124,4 @@
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

Просмотреть файл

@ -38,24 +38,23 @@
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#define HAVE_WEAK_MALLOC_SYMBOLS
/* do this until I figure out the rhapsody dll stuff. */
#define HAVE_DLL
#define USE_RLD
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_TIMESPEC_HAS_TS_SEC
#define _PR_NO_LARGE_FILES
#define USE_SETJMP
#ifndef _PR_PTHREADS
#if !defined(_PR_PTHREADS)
#include <setjmp.h>
#define PR_CONTEXT_TYPE jmp_buf
#define CONTEXT(_th) ((_th)->md.context)
#define _MD_GET_SP(_th) (_th)->md.context[0]
#define PR_NUM_GCREGS _JBLEN
#define CONTEXT(_th) ((_th)->md.context)
#define _MD_GET_SP(_th) (((struct sigcontext *) (_th)->md.context)->sc_onstack)
#define PR_NUM_GCREGS _JBLEN
/*
** Initialize a thread context to run "_main()" when started
@ -66,7 +65,7 @@
if (setjmp(CONTEXT(_thread))) { \
_main(); \
} \
_MD_GET_SP(_thread) = (int) ((_sp) - 64); \
_MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
@ -113,6 +112,42 @@ 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;
};
@ -149,14 +184,14 @@ 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_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_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,

Просмотреть файл

@ -71,8 +71,7 @@
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -45,6 +45,9 @@
#define HAVE_WEAK_IO_SYMBOLS
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
@ -113,6 +116,42 @@ 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;
};

Просмотреть файл

@ -48,8 +48,14 @@
#undef _PR_HAVE_ATOMIC_OPS
#else
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ST_ATIM
#include "prinrval.h"
PR_EXTERN(PRIntervalTime) _MD_Solaris_GetInterval(void);
#define _MD_GET_INTERVAL _MD_Solaris_GetInterval
PR_EXTERN(PRIntervalTime) _MD_Solaris_TicksPerSecond(void);
@ -64,6 +70,9 @@ PR_EXTERN(PRIntervalTime) _MD_Solaris_TicksPerSecond(void);
PR_EXTERN(PRInt32) _MD_AtomicIncrement(PRInt32 *val);
#define _MD_ATOMIC_INCREMENT _MD_AtomicIncrement
PR_EXTERN(PRInt32) _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val);
#define _MD_ATOMIC_ADD _MD_AtomicAdd
PR_EXTERN(PRInt32) _MD_AtomicDecrement(PRInt32 *val);
#define _MD_ATOMIC_DECREMENT _MD_AtomicDecrement
@ -285,6 +294,43 @@ struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field, common to all Unix platforms
*/
#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;
};
@ -566,6 +612,42 @@ 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;
};

Просмотреть файл

@ -103,6 +103,42 @@ 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;
};

Просмотреть файл

@ -52,6 +52,8 @@
#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
@ -145,6 +147,42 @@ 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;
};

Просмотреть файл

@ -138,6 +138,9 @@ PR_EXTERN(void) _MD_unix_map_select_error(int err);
PR_EXTERN(void) _MD_unix_map_poll_error(int err);
#define _PR_MD_MAP_POLL_ERROR _MD_unix_map_poll_error
PR_EXTERN(void) _MD_unix_map_poll_revents_error(int err);
#define _PR_MD_MAP_POLL_REVENTS_ERROR _MD_unix_map_poll_revents_error
PR_EXTERN(void) _MD_unix_map_flock_error(int err);
#define _PR_MD_MAP_FLOCK_ERROR _MD_unix_map_flock_error

Просмотреть файл

@ -37,26 +37,27 @@
#include <stddef.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include "prio.h"
#include "prmem.h"
#include "prclist.h"
/* To pick up fd_set */
#if defined(HPUX)
/*
* For select(), fd_set, and struct timeval.
*
* In The Single UNIX(R) Specification, Version 2,
* the header file for select() is <sys/time.h>.
*
* fd_set is defined in <sys/types.h>. Usually
* <sys/time.h> includes <sys/types.h>, but on some
* older systems <sys/time.h> does not include
* <sys/types.h>, so we include it explicitly.
*/
#include <sys/time.h>
#elif defined(OSF1) || defined(AIX) || defined(SOLARIS) || defined(IRIX) \
|| defined(UNIXWARE) || defined(NCR) || defined(SNI) || defined(NEC) \
|| defined(BSDI) || defined(SONY)
#include <sys/types.h>
#if defined(AIX) /* Only pre-4.2 AIX needs it, but for simplicity... */
#include <sys/select.h>
#elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD) \
|| defined(NETBSD) || defined(RHAPSODY) || defined(DGUX)
#include <sys/types.h>
#elif defined(LINUX)
#include <sys/time.h>
#include <sys/types.h>
#else
#error Find out what include file defines fd_set on this platform
#endif
#define PR_DIRECTORY_SEPARATOR '/'
@ -64,7 +65,6 @@
#define PR_PATH_SEPARATOR ':'
#define PR_PATH_SEPARATOR_STR ":"
#define GCPTR
typedef int (*FARPROC)();
/*
@ -73,6 +73,26 @@ typedef int (*FARPROC)();
#define _PR_INTERRUPT_CHECK_INTERVAL_SECS 5
extern PRIntervalTime intr_timeout_ticks;
/*
* The bit flags for the in_flags and out_flags fields
* of _PR_UnixPollDesc
*/
#ifdef _PR_USE_POLL
#define _PR_UNIX_POLL_READ POLLIN
#define _PR_UNIX_POLL_WRITE POLLOUT
#define _PR_UNIX_POLL_EXCEPT POLLPRI
#define _PR_UNIX_POLL_ERR POLLERR
#define _PR_UNIX_POLL_NVAL POLLNVAL
#define _PR_UNIX_POLL_HUP POLLHUP
#else /* _PR_USE_POLL */
#define _PR_UNIX_POLL_READ 0x1
#define _PR_UNIX_POLL_WRITE 0x2
#define _PR_UNIX_POLL_EXCEPT 0x4
#define _PR_UNIX_POLL_ERR 0x8
#define _PR_UNIX_POLL_NVAL 0x10
#define _PR_UNIX_POLL_HUP 0x20
#endif /* _PR_USE_POLL */
typedef struct _PRUnixPollDesc {
PRInt32 osfd;
PRInt16 in_flags;
@ -92,8 +112,10 @@ typedef struct PRPollQueue {
((PRPollQueue*) ((char*) (_qp) - offsetof(PRPollQueue,links)))
extern PRInt32 _PR_WaitForFD(PRInt32 osfd, PRUintn how,
PRIntervalTime timeout);
extern PRInt32 _PR_WaitForMultipleFDs(
_PRUnixPollDesc *unixpds,
PRInt32 pdcnt,
PRIntervalTime timeout);
extern void _PR_Unblock_IO_Wait(struct PRThread *thr);
#if defined(_PR_LOCAL_THREADS_ONLY) || defined(_PR_GLOBAL_THREADS_ONLY)
@ -113,45 +135,9 @@ struct _MDDir {
DIR *d;
};
/*
* md-specific cpu structure field, common to all Unix platforms
*/
#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 */
};
struct _PRCPU;
extern void _MD_unix_init_running_cpu(struct _PRCPU *cpu);
#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
/*
** Make a redzone at both ends of the stack segment. Disallow access
** to those pages of memory. It's ok if the mprotect call's don't
@ -248,6 +234,7 @@ extern PRStatus _MD_KillUnixProcess(struct PRProcess *process);
#define _MD_START_INTERRUPTS _MD_StartInterrupts
#define _MD_STOP_INTERRUPTS _MD_StopInterrupts
#define _MD_DISABLE_CLOCK_INTERRUPTS _MD_DisableClockInterrupts
#define _MD_ENABLE_CLOCK_INTERRUPTS _MD_EnableClockInterrupts
#define _MD_BLOCK_CLOCK_INTERRUPTS _MD_BlockClockInterrupts
#define _MD_UNBLOCK_CLOCK_INTERRUPTS _MD_UnblockClockInterrupts
@ -291,7 +278,9 @@ extern void _MD_FreeSegment(PRSegment *seg);
/************************************************************************/
#if !defined(HPUX_LW_TIMER)
#define _MD_INTERVAL_INIT()
#endif
#define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000)
#define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000)
@ -304,11 +293,6 @@ extern void _MD_FreeSegment(PRSegment *seg);
extern PRInt32 _MD_AvailableSocket(PRInt32 osfd);
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
extern void _MD_InitSegs(void);
extern void _MD_StartInterrupts(void);
extern void _MD_StopInterrupts(void);
@ -327,7 +311,7 @@ extern PRInt32 _MD_getfileinfo64(const char *fn, PRFileInfo64 *info);
extern PRInt32 _MD_getopenfileinfo(const PRFileDesc *fd, PRFileInfo *info);
extern PRInt32 _MD_getopenfileinfo64(const PRFileDesc *fd, PRFileInfo64 *info);
extern PRInt32 _MD_rename(const char *from, const char *to);
extern PRInt32 _MD_access(const char *name, PRIntn how);
extern PRInt32 _MD_access(const char *name, PRAccessHow how);
extern PRInt32 _MD_mkdir(const char *name, PRIntn mode);
extern PRInt32 _MD_rmdir(const char *name);
extern PRInt32 _MD_accept_read(PRInt32 sock, PRInt32 *newSock,
@ -516,4 +500,72 @@ extern int poll(struct pollfd *, unsigned long, int);
#endif /* _PR_NEED_FAKE_POLL */
/*
** A vector of the UNIX I/O calls we use. These are here to smooth over
** the rough edges needed for large files. All of NSPR's implmentaions
** go through this vector using syntax of the form
** result = _md_iovector.xxx64(args);
*/
#if defined(SOLARIS2_5)
/*
** Special case: Solaris 2.5.1
** Solaris starts to have 64-bit file I/O in 2.6. We build on Solaris
** 2.5.1 so that we can use the same binaries on both Solaris 2.5.1 and
** 2.6. At run time, we detect whether 64-bit file I/O is available by
** looking up the 64-bit file function symbols in libc. At build time,
** we need to define the 64-bit file I/O datatypes that are compatible
** with their definitions on Solaris 2.6.
*/
typedef PRInt64 off64_t;
typedef PRUint64 ino64_t;
typedef PRUint64 blkcnt64_t;
struct stat64 {
dev_t st_dev;
long st_pad1[3];
ino64_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
long t_pad2[2];
off64_t st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
long st_blksize;
blkcnt64_t st_blocks;
char st_fstype[_ST_FSTYPSZ];
long st_pad4[8];
};
typedef struct stat64 _MDStat64;
#elif defined(_PR_HAVE_OFF64_T)
typedef struct stat64 _MDStat64;
#elif defined(_PR_HAVE_LARGE_OFF_T) || defined(_PR_NO_LARGE_FILES)
typedef struct stat _MDStat64;
#else
#error "I don't know yet"
#endif
typedef PRIntn (*_MD_Fstat64)(PRIntn osfd, _MDStat64 *buf);
typedef PRIntn (*_MD_Open64)(const char *path, int oflag, ...);
typedef PRIntn (*_MD_Stat64)(const char *path, _MDStat64 *buf);
typedef PRInt64 (*_MD_Lseek64)(PRIntn osfd, PRInt64, PRIntn whence);
typedef PRIntn (*_MD_Lockf64)(PRIntn osfd, PRIntn function, PRInt64 size);
typedef void* (*_MD_Mmap64)(
void *addr, PRSize len, PRIntn prot, PRIntn flags,
PRIntn fildes, PRInt64 offset);
struct _MD_IOVector
{
_MD_Open64 _open64;
_MD_Mmap64 _mmap64;
_MD_Stat64 _stat64;
_MD_Fstat64 _fstat64;
_MD_Lockf64 _lockf64;
_MD_Lseek64 _lseek64;
};
extern struct _MD_IOVector _md_iovector;
#endif /* prunixos_h___ */

Просмотреть файл

@ -71,8 +71,7 @@
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define _PR_USE_POLL
#define _PR_POLL_AVAILABLE
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -36,6 +36,8 @@
#ifndef HAVE_WEAK_IO_SYMBOLS
#define HAVE_WEAK_IO_SYMBOLS
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#undef HAVE_STACK_GROWING_UP
#define HAVE_NETCONFIG
@ -114,6 +116,42 @@ 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;
};

Просмотреть файл

@ -296,6 +296,7 @@ extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(x) (*x++)
#define _MD_ATOMIC_ADD(ptr, val) ((*x) += val)
#define _MD_ATOMIC_DECREMENT(x) (*x--)
#define _MD_ATOMIC_SET(x,y) (*x, y)
@ -388,6 +389,7 @@ PR_EXTERN(void) _MD_INIT_RUNNING_CPU(struct _PRCPU *cpu );
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT _PR_MD_EARLY_INIT

Просмотреть файл

@ -222,13 +222,17 @@ extern PRInt32 _MD_CloseSocket(PRInt32 osfd);
#define _MD_SETSOCKOPT _PR_MD_SETSOCKOPT
#define _MD_SELECT select
#define _MD_FSYNC _PR_MD_FSYNC
#define READ_FD 1
#define WRITE_FD 2
#define _MD_INIT_ATOMIC()
#if defined(_M_IX86) || defined(_X86_)
#define _MD_ATOMIC_INCREMENT _PR_MD_ATOMIC_INCREMENT
#define _MD_ATOMIC_ADD _PR_MD_ATOMIC_ADD
#define _MD_ATOMIC_DECREMENT _PR_MD_ATOMIC_DECREMENT
#else /* non-x86 processors */
#define _MD_ATOMIC_INCREMENT(x) InterlockedIncrement((PLONG)x)
#define _MD_ATOMIC_ADD(ptr,val) (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val)
#define _MD_ATOMIC_DECREMENT(x) InterlockedDecrement((PLONG)x)
#endif /* x86 */
#define _MD_ATOMIC_SET(x,y) InterlockedExchange((PLONG)x, (LONG)y)
@ -325,6 +329,7 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen,
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT _PR_MD_EARLY_INIT
@ -368,9 +373,11 @@ extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
/* --- Native-Thread Specific Definitions ------------------------------- */
extern struct PRThread * _MD_CURRENT_THREAD(void);
#ifdef _PR_USE_STATIC_TLS
extern __declspec(thread) struct PRThread *_pr_currentThread;
#define _MD_CURRENT_THREAD() _pr_currentThread
#define _MD_GET_ATTACHED_THREAD() _pr_currentThread
#define _MD_SET_CURRENT_THREAD(_thread) (_pr_currentThread = (_thread))
extern __declspec(thread) struct PRThread *_pr_thread_last_run;
@ -382,7 +389,7 @@ extern __declspec(thread) struct _PRCPU *_pr_currentCPU;
#define _MD_SET_CURRENT_CPU(_cpu) (_pr_currentCPU = 0)
#else /* _PR_USE_STATIC_TLS */
extern DWORD _pr_currentThreadIndex;
#define _MD_CURRENT_THREAD() ((PRThread *) TlsGetValue(_pr_currentThreadIndex))
#define _MD_GET_ATTACHED_THREAD() ((PRThread *) TlsGetValue(_pr_currentThreadIndex))
#define _MD_SET_CURRENT_THREAD(_thread) TlsSetValue(_pr_currentThreadIndex, (_thread))
extern DWORD _pr_lastThreadIndex;

Просмотреть файл

@ -34,6 +34,7 @@
#include <errno.h>
#include "prio.h"
#include "prclist.h"
/*
* Internal configuration macros
@ -49,6 +50,7 @@
#define HAVE_SOCKET_REUSEADDR
#define HAVE_SOCKET_KEEPALIVE
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
/* --- Common User-Thread/Native-Thread Definitions --------------------- */
@ -72,9 +74,39 @@ struct _MDCPU {
int unused;
};
enum _MDIOModel {
_MD_BlockingIO = 0x38,
_MD_MultiWaitIO = 0x49
};
typedef struct _MDOverlapped {
OVERLAPPED overlapped; /* Used for async I/O */
enum _MDIOModel ioModel; /* The I/O model to implement
* using overlapped I/O.
*/
union {
struct _MDThread *mdThread; /* For blocking I/O, this structure
* is embedded in the _MDThread
* structure.
*/
struct {
PRCList links; /* for group->io_ready list */
struct PRRecvWait *desc; /* For multiwait I/O, this structure
* is associated with a PRRecvWait
* structure.
*/
struct PRWaitGroup *group;
struct TimerEvent *timer;
DWORD error;
} mw;
} data;
} _MDOverlapped;
struct _MDThread {
/* The overlapped structure must be first! */
OVERLAPPED overlapped; /* Used for async IO for this thread */
struct _MDOverlapped overlapped; /* Used for async IO for this thread */
void *acceptex_buf; /* Used for AcceptEx() */
TRANSMIT_FILE_BUFFERS *xmit_bufs; /* Used for TransmitFile() */
HANDLE blocked_sema; /* Threads block on this when waiting
@ -168,6 +200,7 @@ struct _MDProcess {
/* --- IO stuff --- */
extern PRInt32 _md_Associate(HANDLE);
extern PRInt32 _PR_MD_CLOSE(PRInt32 osfd, PRBool socket);
#define _MD_OPEN _PR_MD_OPEN
@ -213,9 +246,11 @@ extern PRInt32 _PR_MD_CLOSE(PRInt32 osfd, PRBool socket);
#define _MD_INIT_ATOMIC()
#if defined(_M_IX86) || defined(_X86_)
#define _MD_ATOMIC_INCREMENT _PR_MD_ATOMIC_INCREMENT
#define _MD_ATOMIC_ADD _PR_MD_ATOMIC_ADD
#define _MD_ATOMIC_DECREMENT _PR_MD_ATOMIC_DECREMENT
#else /* non-x86 processors */
#define _MD_ATOMIC_INCREMENT(x) InterlockedIncrement((PLONG)x)
#define _MD_ATOMIC_ADD(ptr,val) (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val)
#define _MD_ATOMIC_DECREMENT(x) InterlockedDecrement((PLONG)x)
#endif /* x86 */
#define _MD_ATOMIC_SET(x,y) InterlockedExchange((PLONG)x, (LONG)y)
@ -321,6 +356,7 @@ extern struct _MDLock _pr_ioq_lock;
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT _PR_MD_EARLY_INIT
@ -370,43 +406,73 @@ extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);
/* --- Native-Thread Specific Definitions ------------------------------- */
#ifdef _PR_USE_STATIC_TLS
extern BOOL _pr_use_static_tls;
extern __declspec(thread) struct PRThread *_pr_current_fiber;
#define _MD_CURRENT_THREAD() _pr_current_fiber
#define _MD_SET_CURRENT_THREAD(_thread) (_pr_current_fiber = (_thread))
extern DWORD _pr_currentFiberIndex;
#define _MD_GET_ATTACHED_THREAD() \
(_pr_use_static_tls ? _pr_current_fiber \
: (PRThread *) TlsGetValue(_pr_currentFiberIndex))
extern struct PRThread * _MD_CURRENT_THREAD(void);
#define _MD_SET_CURRENT_THREAD(_thread) \
PR_BEGIN_MACRO \
if (_pr_use_static_tls) { \
_pr_current_fiber = (_thread); \
} else { \
TlsSetValue(_pr_currentFiberIndex, (_thread)); \
} \
PR_END_MACRO
extern __declspec(thread) struct PRThread *_pr_fiber_last_run;
#define _MD_LAST_THREAD() _pr_fiber_last_run
#define _MD_SET_LAST_THREAD(_thread) (_pr_fiber_last_run = (_thread))
extern DWORD _pr_lastFiberIndex;
#define _MD_LAST_THREAD() \
(_pr_use_static_tls ? _pr_fiber_last_run \
: (PRThread *) TlsGetValue(_pr_lastFiberIndex))
#define _MD_SET_LAST_THREAD(_thread) \
PR_BEGIN_MACRO \
if (_pr_use_static_tls) { \
_pr_fiber_last_run = (_thread); \
} else { \
TlsSetValue(_pr_lastFiberIndex, (_thread)); \
} \
PR_END_MACRO
extern __declspec(thread) struct _PRCPU *_pr_current_cpu;
#define _MD_CURRENT_CPU() _pr_current_cpu
#define _MD_SET_CURRENT_CPU(_cpu) (_pr_current_cpu = (_cpu))
extern DWORD _pr_currentCPUIndex;
#define _MD_CURRENT_CPU() \
(_pr_use_static_tls ? _pr_current_cpu \
: (struct _PRCPU *) TlsGetValue(_pr_currentCPUIndex))
#define _MD_SET_CURRENT_CPU(_cpu) \
PR_BEGIN_MACRO \
if (_pr_use_static_tls) { \
_pr_current_cpu = (_cpu); \
} else { \
TlsSetValue(_pr_currentCPUIndex, (_cpu)); \
} \
PR_END_MACRO
extern __declspec(thread) PRUintn _pr_ints_off;
#define _MD_SET_INTSOFF(_val) (_pr_ints_off = (_val))
#define _MD_GET_INTSOFF() _pr_ints_off
#else /* _PR_USE_STATIC_TLS */
extern DWORD _pr_currentFiberIndex;
#define _MD_CURRENT_THREAD() ((PRThread *) TlsGetValue(_pr_currentFiberIndex))
#define _MD_SET_CURRENT_THREAD(_thread) TlsSetValue(_pr_currentFiberIndex, (_thread))
extern DWORD _pr_lastFiberIndex;
#define _MD_LAST_THREAD() ((PRThread *) TlsGetValue(_pr_lastFiberIndex))
#define _MD_SET_LAST_THREAD(_thread) TlsSetValue(_pr_lastFiberIndex, (_thread))
extern DWORD _pr_currentCPUIndex;
#define _MD_CURRENT_CPU() ((struct _PRCPU *) TlsGetValue(_pr_currentCPUIndex))
#define _MD_SET_CURRENT_CPU(_cpu) TlsSetValue(_pr_currentCPUIndex, (_cpu))
extern DWORD _pr_intsOffIndex;
#define _MD_SET_INTSOFF(_val) TlsSetValue(_pr_intsOffIndex, (LPVOID) (_val))
#define _MD_GET_INTSOFF() ((PRUintn) TlsGetValue(_pr_intsOffIndex))
#endif /* _PR_USE_STATIC_TLS */
#define _MD_GET_INTSOFF() \
(_pr_use_static_tls ? _pr_ints_off \
: (PRUintn) TlsGetValue(_pr_intsOffIndex))
#define _MD_SET_INTSOFF(_val) \
PR_BEGIN_MACRO \
if (_pr_use_static_tls) { \
_pr_ints_off = (_val); \
} else { \
TlsSetValue(_pr_intsOffIndex, (LPVOID) (_val)); \
} \
PR_END_MACRO
/* --- Initialization stuff --- */
#define _MD_INIT_LOCKS()

Просмотреть файл

@ -50,9 +50,6 @@ PR_BEGIN_EXTERN_C
#elif defined(XP_UNIX)
#include "md/_unixos.h"
#include "md/_unix_errors.h"
#if defined(AIX)
#include "md/_aix.h"
@ -62,6 +59,9 @@ PR_BEGIN_EXTERN_C
#elif defined(NETBSD)
#include "md/_netbsd.h"
#elif defined(OPENBSD)
#include "md/_openbsd.h"
#elif defined(BSDI)
#include "md/_bsdi.h"
@ -112,6 +112,9 @@ PR_BEGIN_EXTERN_C
#endif
#include "md/_unixos.h"
#include "md/_unix_errors.h"
#else
#error "The platform is not Unix, Windows, or Mac"

Просмотреть файл

@ -37,6 +37,7 @@
#include "prlong.h"
#include "prmem.h"
#include "prmon.h"
#include "prmwait.h"
#include "prnetdb.h"
#include "prprf.h"
#include "prproces.h"

Просмотреть файл

@ -46,6 +46,7 @@
#include "prtypes.h"
#include "prinrval.h"
PR_BEGIN_EXTERN_C
/**********************************************************************/

Просмотреть файл

@ -26,6 +26,7 @@
#if !defined(PROTYPES_H)
#define PROTYPES_H
/* SVR4 typedef of uint is commonly found on UNIX machines. */
#ifdef XP_UNIX
#include <sys/types.h>

Просмотреть файл

@ -25,6 +25,7 @@
#define pratom_h___
#include "prtypes.h"
#include "prlock.h"
PR_BEGIN_EXTERN_C
@ -35,7 +36,7 @@ PR_BEGIN_EXTERN_C
** INPUTS:
** val: a pointer to the value to increment
** RETURN:
** the returned value has the same sign as the result
** the returned value is the result of the increment
*/
PR_EXTERN(PRInt32) PR_AtomicIncrement(PRInt32 *val);
@ -46,7 +47,7 @@ PR_EXTERN(PRInt32) PR_AtomicIncrement(PRInt32 *val);
** INPUTS:
** val: a pointer to the value to decrement
** RETURN:
** the returned value has the same sign as the result
** the returned value is the result of the decrement
*/
PR_EXTERN(PRInt32) PR_AtomicDecrement(PRInt32 *val);
@ -55,13 +56,96 @@ PR_EXTERN(PRInt32) PR_AtomicDecrement(PRInt32 *val);
** DESCRIPTION:
** Atomically set a 32 bit value.
** INPUTS:
** val: A pointer to a 32 bit value to bet set
** val: A pointer to a 32 bit value to be set
** newval: The newvalue to assign to val
** RETURN:
** Returns the prior value
*/
PR_EXTERN(PRInt32) PR_AtomicSet(PRInt32 *val, PRInt32 newval);
/*
** FUNCTION: PR_AtomicAdd
** DESCRIPTION:
** Atomically add a 32 bit value.
** INPUTS:
** ptr: a pointer to the value to increment
** val: value to be added
** RETURN:
** the returned value is the result of the addition
*/
PR_EXTERN(PRInt32) PR_AtomicAdd(PRInt32 *ptr, PRInt32 val);
/*
** LIFO linked-list (stack)
*/
typedef struct PRStackElemStr PRStackElem;
struct PRStackElemStr {
PRStackElem *prstk_elem_next; /* next pointer MUST be at offset 0;
assembly language code relies on this */
};
typedef struct PRStackStr PRStack;
struct PRStackStr {
PRStackElem prstk_head; /* head MUST be at offset 0; assembly
language code relies on this
*/
PRLock *prstk_lock;
char *prstk_name;
};
/*
** FUNCTION: PR_CreateStack
** DESCRIPTION:
** Create a stack, a LIFO linked list
** INPUTS:
** stack_name: a pointer to string containing the name of the stack
** RETURN:
** A pointer to the created stack, if successful, else NULL.
*/
PR_EXTERN(PRStack *) PR_CreateStack(const char *stack_name);
/*
** FUNCTION: PR_StackPush
** DESCRIPTION:
** Push an element on the top of the stack
** INPUTS:
** stack: pointer to the stack
** stack_elem: pointer to the stack element
** RETURN:
** None
*/
PR_EXTERN(void) PR_StackPush(PRStack *stack, PRStackElem *stack_elem);
/*
** FUNCTION: PR_StackPop
** DESCRIPTION:
** Remove the element on the top of the stack
** INPUTS:
** stack: pointer to the stack
** RETURN:
** A pointer to the stack element removed from the top of the stack,
** if non-empty,
** else NULL
*/
PR_EXTERN(PRStackElem *) PR_StackPop(PRStack *stack);
/*
** FUNCTION: PR_DestroyStack
** DESCRIPTION:
** Destroy the stack
** INPUTS:
** stack: pointer to the stack
** RETURN:
** PR_SUCCESS - if successfully deleted
** PR_FAILURE - if the stack is not empty
** PR_GetError will return
** PR_INVALID_STATE_ERROR - stack is not empty
*/
PR_EXTERN(PRStatus) PR_DestroyStack(PRStack *stack);
PR_END_EXTERN_C
#endif /* pratom_h___ */

Просмотреть файл

@ -20,6 +20,7 @@
#define prbit_h___
#include "prtypes.h"
PR_BEGIN_EXTERN_C
/*
** A prbitmap_t is a long integer that can be used for bitmaps
@ -87,4 +88,5 @@ PR_EXTERN(PRIntn) PR_FloorLog2(PRUint32 i);
(_log2) += 1; \
PR_END_MACRO
PR_END_EXTERN_C
#endif /* prbit_h___ */

Просмотреть файл

@ -0,0 +1,512 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef prcountr_h___
#define prcountr_h___
/*----------------------------------------------------------------------------
** prcountr.h -- NSPR Instrumentation counters
**
** The NSPR Counter Feature provides a means to "count
** something." Counters can be dynamically defined, incremented,
** decremented, set, and deleted under application program
** control.
**
** The Counter Feature is intended to be used as instrumentation,
** not as operational data. If you need a counter for operational
** data, use native integral types.
**
** Counters are 32bit unsigned intergers. On overflow, a counter
** will wrap. No exception is recognized or reported.
**
** A counter can be dynamically created using a two level naming
** convention. A "handle" is returned when the counter is
** created. The counter can subsequently be addressed by its
** handle. An API is provided to get an existing counter's handle
** given the names with which it was originally created.
** Similarly, a counter's name can be retrieved given its handle.
**
** The counter naming convention is a two-level hierarchy. The
** QName is the higher level of the hierarchy; RName is the
** lower level. RNames can be thought of as existing within a
** QName. The same RName can exist within multiple QNames. QNames
** are unique. The NSPR Counter is not a near-zero overhead
** feature. Application designers should be aware of
** serialization issues when using the Counter API. Creating a
** counter locks a large asset, potentially causing a stall. This
** suggest that applications should create counters at component
** initialization, for example, and not create and destroy them
** willy-nilly. ... You have been warned.
**
** Incrementing and Adding to counters uses atomic operations.
** The performance of these operations will vary from platform
** to platform. On platforms where atomic operations are not
** supported the overhead may be substantial.
**
** When traversing the counter database with FindNext functions,
** the instantaneous values of any given counter is that at the
** moment of extraction. The state of the entire counter database
** may not be viewed as atomic.
**
** The counter interface may be disabled (No-Op'd) at compile
** time. When DEBUG is defined at compile time, the Counter
** Feature is compiled into NSPR and applications invoking it.
** When DEBUG is not defined, the counter macros compile to
** nothing. To force the Counter Feature to be compiled into an
** optimized build, define FORCE_NSPR_COUNTERS at compile time
** for both NSPR and the application intending to use it.
**
** Application designers should use the macro form of the Counter
** Feature methods to minimize performance impact in optimized
** builds. The macros normally compile to nothing on optimized
** builds.
**
** Application designers should be aware of the effects of
** debug and optimized build differences when using result of the
** Counter Feature macros in expressions.
**
** The Counter Feature is thread-safe and SMP safe.
**
** /lth. 09-Jun-1998.
*/
#include "prtypes.h"
PR_BEGIN_EXTERN_C
/*
** Opaque counter handle type.
** ... don't even think of looking in here.
**
*/
typedef void * PRCounterHandle;
#define PRCOUNTER_NAME_MAX 31
#define PRCOUNTER_DESC_MAX 255
#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
/* -----------------------------------------------------------------------
** FUNCTION: PR_DEFINE_COUNTER() -- Define a PRCounterHandle
**
** DESCRIPTION: PR_DEFINE_COUNTER() is used to define a counter
** handle.
**
*/
#define PR_DEFINE_COUNTER(name) PRCounterHandle name
/* -----------------------------------------------------------------------
** FUNCTION: PR_INIT_COUNTER_HANDLE() -- Set the value of a PRCounterHandle
**
** DESCRIPTION:
** PR_INIT_COUNTER_HANDLE() sets the value of a PRCounterHandle
** to value.
**
*/
#define PR_INIT_COUNTER_HANDLE(handle,value)\
(handle) = (PRCounterHandle)(value)
/* -----------------------------------------------------------------------
** FUNCTION: PR_CreateCounter() -- Create a counter
**
** DESCRIPTION: PR_CreateCounter() creates a counter object and
** initializes it to zero.
**
** The macro form takes as its first argument the name of the
** PRCounterHandle to receive the handle returned from
** PR_CreateCounter().
**
** INPUTS:
** qName: The QName for the counter object. The maximum length
** of qName is defined by PRCOUNTER_NAME_MAX
**
** rName: The RName for the counter object. The maximum length
** of qName is defined by PRCOUNTER_NAME_MAX
**
** descrioption: The description of the counter object. The
** maximum length of description is defined by
** PRCOUNTER_DESC_MAX.
**
** OUTPUTS:
**
** RETURNS:
** PRCounterHandle.
**
** RESTRICTIONS:
**
*/
#define PR_CREATE_COUNTER(handle,qName,rName,description)\
(handle) = PR_CreateCounter((qName),(rName),(description))
PR_EXTERN(PRCounterHandle)
PR_CreateCounter(
const char *qName,
const char *rName,
const char *description
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_DestroyCounter() -- Destroy a counter object.
**
** DESCRIPTION: PR_DestroyCounter() removes a counter and
** unregisters its handle from the counter database.
**
** INPUTS:
** handle: the PRCounterHandle of the counter to be destroyed.
**
** OUTPUTS:
** The counter is destroyed.
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_DESTROY_COUNTER(handle) PR_DestroyCounter((handle))
PR_EXTERN(void)
PR_DestroyCounter(
PRCounterHandle handle
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_GetCounterHandleFromName() -- Retreive a
** counter's handle give its name.
**
** DESCRIPTION: PR_GetCounterHandleFromName() retreives a
** counter's handle from the counter database, given the name
** the counter was originally created with.
**
** INPUTS:
** qName: Counter's original QName.
** rName: Counter's original RName.
**
** OUTPUTS:
**
** RETURNS:
** PRCounterHandle or PRCounterError.
**
** RESTRICTIONS:
**
*/
#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)\
(handle) = PR_GetCounterHandleFromName((qName),(rName))
PR_EXTERN(PRCounterHandle)
PR_GetCounterHandleFromName(
const char *qName,
const char *rName
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_GetCounterNameFromHandle() -- Retreive a
** counter's name, given its handle.
**
** DESCRIPTION: PR_GetCounterNameFromHandle() retreives a
** counter's name given its handle.
**
** INPUTS:
** qName: Where to store a pointer to qName.
** rName: Where to store a pointer to rName.
** description: Where to store a pointer to description.
**
** OUTPUTS: Pointers to the Counter Feature's copies of the names
** used when the counters were created.
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description)\
PR_GetCounterNameFromHandle((handle),(qName),(rName),(description))
PR_EXTERN(void)
PR_GetCounterNameFromHandle(
PRCounterHandle handle,
const char **qName,
const char **rName,
const char **description
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_IncrementCounter() -- Add one to the referenced
** counter.
**
** DESCRIPTION: Add one to the referenced counter.
**
** INPUTS:
** handle: The PRCounterHandle of the counter to be incremented
**
** OUTPUTS: The counter is incrementd.
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_INCREMENT_COUNTER(handle) PR_IncrementCounter(handle)
PR_EXTERN(void)
PR_IncrementCounter(
PRCounterHandle handle
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_DecrementCounter() -- Subtract one from the
** referenced counter
**
** DESCRIPTION: Subtract one from the referenced counter.
**
** INPUTS:
** handle: The PRCounterHandle of the coutner to be
** decremented.
**
** OUTPUTS: the counter is decremented.
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_DECREMENT_COUNTER(handle) PR_DecrementCounter(handle)
PR_EXTERN(void)
PR_DecrementCounter(
PRCounterHandle handle
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_AddToCounter() -- Add a value to a counter.
**
** DESCRIPTION: Add value to the counter referenced by handle.
**
** INPUTS:
** handle: the PRCounterHandle of the counter to be added to.
**
** value: the value to be added to the counter.
**
** OUTPUTS: new value for counter.
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_ADD_TO_COUNTER(handle,value)\
PR_AddToCounter((handle),(value))
PR_EXTERN(void)
PR_AddToCounter(
PRCounterHandle handle,
PRUint32 value
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_SubtractFromCounter() -- A value is subtracted
** from a counter.
**
** DESCRIPTION:
** Subtract a value from a counter.
**
** INPUTS:
** handle: the PRCounterHandle of the counter to be subtracted
** from.
**
** value: the value to be subtracted from the counter.
**
** OUTPUTS: new value for counter
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_SUBTRACT_FROM_COUNTER(handle,value)\
PR_SubtractFromCounter((handle),(value))
PR_EXTERN(void)
PR_SubtractFromCounter(
PRCounterHandle handle,
PRUint32 value
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_GetCounter() -- Retreive the value of a counter
**
** DESCRIPTION:
** Retreive the value of a counter.
**
** INPUTS:
** handle: the PR_CounterHandle of the counter to be retreived
**
** OUTPUTS:
**
** RETURNS: The value of the referenced counter
**
** RESTRICTIONS:
**
*/
#define PR_GET_COUNTER(counter,handle)\
(counter) = PR_GetCounter((handle))
PR_EXTERN(PRUint32)
PR_GetCounter(
PRCounterHandle handle
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_SetCounter() -- Replace the content of counter
** with value.
**
** DESCRIPTION: The contents of the referenced counter are
** replaced by value.
**
** INPUTS:
** handle: the PRCounterHandle of the counter whose contents
** are to be replaced.
**
** value: the new value of the counter.
**
** OUTPUTS:
**
** RETURNS: void
**
** RESTRICTIONS:
**
*/
#define PR_SET_COUNTER(handle,value) PR_SetCounter((handle),(value))
PR_EXTERN(void)
PR_SetCounter(
PRCounterHandle handle,
PRUint32 value
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_FindNextCounterQname() -- Retreive the next QName counter
** handle iterator
**
** DESCRIPTION:
** PR_FindNextCounterQname() retreives the first or next Qname
** the counter data base, depending on the value of handle. When
** handle is NULL, the function attempts to retreive the first
** QName handle in the database. When handle is a handle previosly
** retreived QName handle, then the function attempts to retreive
** the next QName handle.
**
** INPUTS:
** handle: PRCounterHandle or NULL.
**
** OUTPUTS: returned
**
** RETURNS: PRCounterHandle or NULL when no more QName counter
** handles are present.
**
** RESTRICTIONS:
** A concurrent PR_CreateCounter() or PR_DestroyCounter() may
** cause unpredictable results.
**
** A PRCounterHandle returned from this function may only be used
** in another PR_FindNextCounterQname() function call; other
** operations may cause unpredictable results.
**
*/
#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
(next) = PR_FindNextCounterQname((handle))
PR_EXTERN(PRCounterHandle)
PR_FindNextCounterQname(
PRCounterHandle handle
);
/* -----------------------------------------------------------------------
** FUNCTION: PR_FindNextCounterRname() -- Retreive the next RName counter
** handle iterator
**
** DESCRIPTION:
** PR_FindNextCounterRname() retreives the first or next RNname
** handle from the counter data base, depending on the
** value of handle. When handle is NULL, the function attempts to
** retreive the first RName handle in the database. When handle is
** a handle previosly retreived RName handle, then the function
** attempts to retreive the next RName handle.
**
** INPUTS:
** handle: PRCounterHandle or NULL.
** qhandle: PRCounterHandle of a previously aquired via
** PR_FIND_NEXT_QNAME_HANDLE()
**
** OUTPUTS: returned
**
** RETURNS: PRCounterHandle or NULL when no more RName counter
** handles are present.
**
** RESTRICTIONS:
** A concurrent PR_CreateCounter() or PR_DestroyCounter() may
** cause unpredictable results.
**
** A PRCounterHandle returned from this function may only be used
** in another PR_FindNextCounterRname() function call; other
** operations may cause unpredictable results.
**
*/
#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)\
(next) = PR_FindNextCounterRname((rhandle),(qhandle))
PR_EXTERN(PRCounterHandle)
PR_FindNextCounterRname(
PRCounterHandle rhandle,
PRCounterHandle qhandle
);
#else /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
/*
** When counters are not compiled in, provide macros that
** evaluate to No-Ops.
**
*/
#define PR_DEFINE_COUNTER(name) PRCounterHandle name
#define PR_INIT_COUNTER_HANDLE(handle,value)
#define PR_CREATE_COUNTER(handle,qName,rName,description)
#define PR_DESTROY_COUNTER(handle)
#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)
#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description )
#define PR_INCREMENT_COUNTER(handle)
#define PR_DECREMENT_COUNTER(handle)
#define PR_ADD_TO_COUNTER(handle,value)
#define PR_SUBTRACT_FROM_COUNTER(handle,value)
#define PR_GET_COUNTER(counter,handle) 0
#define PR_SET_COUNTER(handle,value)
#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)
#endif /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
PR_END_EXTERN_C
#endif /* prcountr_h___ */

Просмотреть файл

@ -21,12 +21,6 @@
#include "prtypes.h"
/*******************************************************************************/
/*******************************************************************************/
/****************** THESE FUNCTIONS MAY NOT BE THREAD SAFE *********************/
/*******************************************************************************/
/*******************************************************************************/
PR_BEGIN_EXTERN_C
/*

Просмотреть файл

@ -25,7 +25,7 @@ PR_BEGIN_EXTERN_C
typedef PRInt32 PRErrorCode;
#define PR_NSPR_ERROR_BASE -2600
#define PR_NSPR_ERROR_BASE -6000
#define PR_OUT_OF_MEMORY_ERROR PR_NSPR_ERROR_BASE + 0
/* Insufficient memory to perform request */
@ -147,7 +147,11 @@ typedef PRInt32 PRErrorCode;
#define PR_ALREADY_INITIATED_ERROR PR_NSPR_ERROR_BASE + 67
#define PR_GROUP_EMPTY_ERROR PR_NSPR_ERROR_BASE + 68
#define PR_INVALID_STATE_ERROR PR_NSPR_ERROR_BASE + 69
#define PR_MAX_ERROR PR_NSPR_ERROR_BASE + 70
#define PR_NETWORK_DOWN_ERROR PR_NSPR_ERROR_BASE + 70
#define PR_SOCKET_SHUTDOWN_ERROR PR_NSPR_ERROR_BASE + 71
#define PR_CONNECT_ABORTED_ERROR PR_NSPR_ERROR_BASE + 72
#define PR_HOST_UNREACHABLE_ERROR PR_NSPR_ERROR_BASE + 73
#define PR_MAX_ERROR PR_NSPR_ERROR_BASE + 74
/* Place holder for the end of the list */
/*

Просмотреть файл

@ -44,7 +44,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version> <build date>"
*/
#define PR_VERSION "2.1 yyyymmdd"
#define PR_VERSION "3.0 yyyymmdd"
#define PR_VMAJOR 3
#define PR_VMINOR 0
#define PR_VPATCH 0
#define PR_BETA PR_TRUE
/*
** PRVersionCheck
@ -81,8 +85,7 @@ PR_EXTERN(PRBool) PR_VersionCheck(const char *importedVersion);
/*
** Initialize the runtime. Attach a thread object to the currently
** executing native thread of type "type" (as if PR_AttachThread were
** called).
** executing native thread of type "type".
**
** The specificaiton of 'maxPTDs' is ignored.
*/
@ -141,6 +144,12 @@ PR_EXTERN(PRStatus) PR_Cleanup(void);
*/
PR_EXTERN(void) PR_DisableClockInterrupts(void);
/*
** Enables Interrupts
** Enables timer signals used for pre-emptive scheduling.
*/
PR_EXTERN(void) PR_EnableClockInterrupts(void);
/*
** Block Interrupts
** Blocks the timer signal used for pre-emptive scheduling
@ -158,6 +167,13 @@ PR_EXTERN(void) PR_UnblockClockInterrupts(void);
*/
PR_EXTERN(void) PR_SetConcurrency(PRUintn numCPUs);
/*
** Control the method and size of the file descriptor (PRFileDesc*)
** cache used by the runtime. Setting 'high' to zero is for performance,
** any other value probably for debugging (see memo on FD caching).
*/
PR_EXTERN(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high);
/*
* Cause an immediate, nongraceful, forced termination of the process.
* It takes a PRIntn argument, which is the exit status code of the

Просмотреть файл

@ -1408,8 +1408,7 @@ PR_EXTERN(PRInt32) PR_TransmitFile(
** void *buf
** A pointer to a buffer to receive data sent by the client. This
** buffer must be large enough to receive <amount> bytes of data
** and two PRNetAddr structures (thus allowing the runtime to align
** the addresses as needed).
** and two PRNetAddr structures, plus an extra 32 bytes.
** PRInt32 amount
** The number of bytes of client data to receive. Does not include
** the size of the PRNetAddr structures. If 0, no data will be read
@ -1425,7 +1424,8 @@ PR_EXTERN(PRInt32) PR_TransmitFile(
** will only be valid if the function return does not indicate failure.
** PRNetAddr **peerAddr,
** The address of the remote socket. This parameter will only be
** valid if the function return does not indicate failure.
** valid if the function return does not indicate failure. The
** returned address is not guaranteed to be properly aligned.
**
** RETURNS:
** The number of bytes read from the client or -1 on failure. The reason
@ -1570,12 +1570,9 @@ struct PRPollDesc {
/*
** Bit values for PRPollDesc.in_flags or PRPollDesc.out_flags. Binary-or
** these together to produce the desired poll request.
**
** On Unix platforms where the poll() system call is available,
** the various PR_POLL_XXX flags are mapped to the native poll flags.
*/
#if defined(XP_UNIX) && defined(_PR_POLL_AVAILABLE)
#if defined(_PR_POLL_BACKCOMPAT)
#include <poll.h>
#define PR_POLL_READ POLLIN
@ -1583,16 +1580,18 @@ struct PRPollDesc {
#define PR_POLL_EXCEPT POLLPRI
#define PR_POLL_ERR POLLERR /* only in out_flags */
#define PR_POLL_NVAL POLLNVAL /* only in out_flags when fd is bad */
#define PR_POLL_HUP POLLHUP /* only in out_flags */
#else /* XP_UNIX, _PR_POLL_AVAILABLE */
#else /* _PR_POLL_BACKCOMPAT */
#define PR_POLL_READ 0x1
#define PR_POLL_WRITE 0x2
#define PR_POLL_EXCEPT 0x4
#define PR_POLL_ERR 0x8 /* only in out_flags */
#define PR_POLL_NVAL 0x10 /* only in out_flags when fd is bad */
#define PR_POLL_HUP 0x20 /* only in out_flags */
#endif /* XP_UNIX, _PR_POLL_AVAILABLE */
#endif /* _PR_POLL_BACKCOMPAT */
/*
*************************************************************************
@ -1632,6 +1631,55 @@ struct PRPollDesc {
PR_EXTERN(PRInt32) PR_Poll(
PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout);
/*
**************************************************************************
**
** Pollable events
**
** A pollable event is a special kind of file descriptor.
** The only I/O operation you can perform on a pollable event
** is to poll it with the PR_POLL_READ flag. You can't
** read from or write to a pollable event.
**
** The purpose of a pollable event is to combine event waiting
** with I/O waiting in a single PR_Poll call. Pollable events
** are implemented using a pipe or a pair of TCP sockets
** connected via the loopback address, therefore setting and
** waiting for pollable events are expensive operating system
** calls. Do not use pollable events for general thread
** synchronization. Use condition variables instead.
**
** A pollable event has two states: set and unset. Events
** are not queued, so there is no notion of an event count.
** A pollable event is either set or unset.
**
** A new pollable event is created by a PR_NewPollableEvent
** call and is initially in the unset state.
**
** PR_WaitForPollableEvent blocks the calling thread until
** the pollable event is set, and then it atomically unsets
** the pollable event before it returns.
**
** To set a pollable event, call PR_SetPollableEvent.
**
** One can call PR_Poll with the PR_POLL_READ flag on a pollable
** event. When the pollable event is set, PR_Poll returns with
** the PR_POLL_READ flag set in the out_flags.
**
** To close a pollable event, call PR_DestroyPollableEvent
** (not PR_Close).
**
**************************************************************************
*/
PR_EXTERN(PRFileDesc *) PR_NewPollableEvent(void);
PR_EXTERN(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event);
PR_EXTERN(PRStatus) PR_SetPollableEvent(PRFileDesc *event);
PR_EXTERN(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event);
PR_END_EXTERN_C
#endif /* prio_h___ */

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше