summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2000-05-02 01:47:19 +0000
committerwtc%netscape.com <devnull@localhost>2000-05-02 01:47:19 +0000
commita8306875aa2e6b81f5319578056cf2b40425097e (patch)
treed87bba50e6f030c65854c96df3928ac464a5cd0d
parent5706b19cfb6844f0bd7e08fe971cc9aa2c24f844 (diff)
downloadnspr-hg-a8306875aa2e6b81f5319578056cf2b40425097e.tar.gz
Bugzilla bug #30902: use true atomic implementation of the NSPR atomic
routines on Linux on Intel x86. Modified files: _linux.h, pr/src/md/unix/Makefile, pr/src/md/unix/Makefile.in, pr/src/md/unix/objs.mk Added file: os_Linux_x86.s (NSPRPUB_CLIENT_BRANCH)
-rw-r--r--pr/include/md/_linux.h13
-rw-r--r--pr/src/md/unix/Makefile6
-rw-r--r--pr/src/md/unix/Makefile.in6
-rw-r--r--pr/src/md/unix/objs.mk6
4 files changed, 31 insertions, 0 deletions
diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
index e3a5233f..96905cf2 100644
--- a/pr/include/md/_linux.h
+++ b/pr/include/md/_linux.h
@@ -59,6 +59,19 @@
#define HAVE_DLL
#define USE_DLFCN
+#if defined(__i386__)
+#define _PR_HAVE_ATOMIC_OPS
+#define _MD_INIT_ATOMIC()
+extern PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val);
+#define _MD_ATOMIC_INCREMENT _PR_x86_AtomicIncrement
+extern PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val);
+#define _MD_ATOMIC_DECREMENT _PR_x86_AtomicDecrement
+extern PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val);
+#define _MD_ATOMIC_ADD _PR_x86_AtomicAdd
+extern PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval);
+#define _MD_ATOMIC_SET _PR_x86_AtomicSet
+#endif
+
#define USE_SETJMP
#if defined(__GLIBC__) && __GLIBC__ >= 2
#define _PR_POLL_AVAILABLE
diff --git a/pr/src/md/unix/Makefile b/pr/src/md/unix/Makefile
index de8baadd..97248fb5 100644
--- a/pr/src/md/unix/Makefile
+++ b/pr/src/md/unix/Makefile
@@ -237,6 +237,12 @@ ifeq ($(OS_ARCH),SunOS)
endif
endif
+ifeq ($(OS_ARCH),Linux)
+ ifeq ($(CPU_ARCH),x86)
+ ASFILES = os_Linux_x86.s
+ endif
+endif
+
ifeq ($(OS_ARCH), SINIX)
ifeq ($(CPU_ARCH),mips)
ASFILES = os_ReliantUNIX.s
diff --git a/pr/src/md/unix/Makefile.in b/pr/src/md/unix/Makefile.in
index 9fb73bf8..6951873e 100644
--- a/pr/src/md/unix/Makefile.in
+++ b/pr/src/md/unix/Makefile.in
@@ -248,6 +248,12 @@ ifeq ($(OS_ARCH),SunOS)
endif
endif
+ifeq ($(OS_ARCH),Linux)
+ ifeq ($(CPU_ARCH),x86)
+ ASFILES = os_Linux_x86.s
+ endif
+endif
+
ifeq ($(OS_ARCH), SINIX)
ifeq ($(CPU_ARCH),mips)
ASFILES = os_ReliantUNIX.s
diff --git a/pr/src/md/unix/objs.mk b/pr/src/md/unix/objs.mk
index d8196c81..d2aa9cb4 100644
--- a/pr/src/md/unix/objs.mk
+++ b/pr/src/md/unix/objs.mk
@@ -235,6 +235,12 @@ ifeq ($(OS_ARCH),SunOS)
endif
endif
+ifeq ($(OS_ARCH),Linux)
+ ifeq ($(CPU_ARCH),x86)
+ ASFILES = os_Linux_x86.s
+ endif
+endif
+
ifeq ($(OS_ARCH), SINIX)
ifeq ($(CPU_ARCH),mips)
ASFILES = os_ReliantUNIX.s