diff options
author | wtc%netscape.com <devnull@localhost> | 1998-10-07 00:34:51 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1998-10-07 00:34:51 +0000 |
commit | 7c0117c12f7f6b68192f136c1c201ad32b6fddf3 (patch) | |
tree | d925a6ce75d3dd551bad9385f5ca11fd66a9b9d2 | |
parent | 542913410672d391ea29cc91b8864ccfab2cfba2 (diff) | |
download | nspr-hg-7c0117c12f7f6b68192f136c1c201ad32b6fddf3.tar.gz |
Restored libultrasparc.so. Our prior attempt to eliminate this
library doesn't work.
Modified files: Makefile, objs.mk, os_SunOS_ultrasparc.s, solaris.c.
-rw-r--r-- | pr/src/md/unix/Makefile | 12 | ||||
-rw-r--r-- | pr/src/md/unix/objs.mk | 8 | ||||
-rw-r--r-- | pr/src/md/unix/os_SunOS_ultrasparc.s | 16 | ||||
-rw-r--r-- | pr/src/md/unix/solaris.c | 93 |
4 files changed, 38 insertions, 91 deletions
diff --git a/pr/src/md/unix/Makefile b/pr/src/md/unix/Makefile index 0ab98fdc..7d36371c 100644 --- a/pr/src/md/unix/Makefile +++ b/pr/src/md/unix/Makefile @@ -195,7 +195,7 @@ ifeq ($(OS_ARCH),SunOS) else ifneq ($(OS_RELEASE),4.1.3_U1) ifneq ($(LOCAL_THREADS_ONLY),1) - ASFILES += os_$(OS_ARCH).s + ASFILES = os_$(OS_ARCH).s endif endif endif @@ -226,10 +226,12 @@ endif ifeq ($(OS_ARCH),SunOS) ifneq ($(OS_RELEASE),4.1.3_U1) ifeq ($(OS_TEST),sun4u) + LIBRARY_NAME = $(ULTRASPARC_LIBRARY) + LIBRARY_VERSION = $(MOD_VERSION) ULTRASPARC_ASFILES = os_$(OS_ARCH)_ultrasparc.s - ASFILES += $(ULTRASPARC_ASFILES) - CFLAGS += -D_PR_ULTRASPARC ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX))) + TARGETS += $(ULTRASPARC_ASOBJS) $(SHARED_LIBRARY) + RELEASE_LIBS = $(SHARED_LIBRARY) endif endif endif @@ -250,6 +252,10 @@ export:: $(TARGETS) ifeq ($(OS_ARCH),SunOS) ifneq ($(OS_RELEASE),4.1.3_U1) ifeq ($(OS_TEST),sun4u) +$(SHARED_LIBRARY): $(ULTRASPARC_ASOBJS) + $(LD) -G -z text -o $@ $(ULTRASPARC_ASOBJS) + $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/lib + $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES) /usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $< endif diff --git a/pr/src/md/unix/objs.mk b/pr/src/md/unix/objs.mk index 7c74f98a..1d321324 100644 --- a/pr/src/md/unix/objs.mk +++ b/pr/src/md/unix/objs.mk @@ -194,14 +194,6 @@ ifeq ($(OS_ARCH),SunOS) endif endif -ifeq ($(OS_ARCH),SunOS) - ifneq ($(OS_RELEASE),4.1.3_U1) - ifeq ($(OS_TEST),sun4u) - ASFILES += os_$(OS_ARCH)_ultrasparc.s - endif - endif -endif - ifeq ($(OS_ARCH), SINIX) ASFILES = os_ReliantUNIX.s endif diff --git a/pr/src/md/unix/os_SunOS_ultrasparc.s b/pr/src/md/unix/os_SunOS_ultrasparc.s index c3faf106..8dd70636 100644 --- a/pr/src/md/unix/os_SunOS_ultrasparc.s +++ b/pr/src/md/unix/os_SunOS_ultrasparc.s @@ -49,7 +49,7 @@ ! %o3 [local] - work register ! ----------------------- - ENTRY(_pr_md_ultrasparc_inc) ! standard assembler/ELF prologue + ENTRY(PR_AtomicIncrement) ! standard assembler/ELF prologue retryAI: ld [%o0], %o2 ! set o2 to the current value @@ -62,7 +62,7 @@ retryAI: retl ! return back to the caller mov %o1, %o0 ! set the return code to the new value - SET_SIZE(_pr_md_ultrasparc_inc) ! standard assembler/ELF epilogue + SET_SIZE(PR_AtomicIncrement) ! standard assembler/ELF epilogue ! ! end @@ -93,7 +93,7 @@ retryAI: ! %o3 [local] - work register ! ----------------------- - ENTRY(_pr_md_ultrasparc_dec) ! standard assembler/ELF prologue + ENTRY(PR_AtomicDecrement) ! standard assembler/ELF prologue retryAD: ld [%o0], %o2 ! set o2 to the current value @@ -106,7 +106,7 @@ retryAD: retl ! return back to the caller mov %o1, %o0 ! set the return code to the new value - SET_SIZE(_pr_md_ultrasparc_dec) ! standard assembler/ELF epilogue + SET_SIZE(PR_AtomicDecrement) ! standard assembler/ELF epilogue ! ! end @@ -136,7 +136,7 @@ retryAD: ! %o3 [local] - work register ! ----------------------- - ENTRY(_pr_md_ultrasparc_set) ! standard assembler/ELF prologue + ENTRY(PR_AtomicSet) ! standard assembler/ELF prologue retryAS: ld [%o0], %o2 ! set o2 to the current value @@ -148,7 +148,7 @@ retryAS: retl ! return back to the caller mov %o3, %o0 ! set the return code to the prev value - SET_SIZE(_pr_md_ultrasparc_set) ! standard assembler/ELF epilogue + SET_SIZE(PR_AtomicSet) ! standard assembler/ELF epilogue ! ! end @@ -164,7 +164,7 @@ retryAS: ! usage : newval = PR_AtomicAdd(address, val) ! return: the value after addition ! - ENTRY(_pr_md_ultrasparc_add) ! standard assembler/ELF prologue + ENTRY(PR_AtomicAdd) ! standard assembler/ELF prologue retryAA: ld [%o0], %o2 ! set o2 to the current value @@ -177,7 +177,7 @@ retryAA: retl ! return back to the caller mov %o4, %o0 ! set the return code to the new value - SET_SIZE(_pr_md_ultrasparc_add) ! standard assembler/ELF epilogue + SET_SIZE(PR_AtomicAdd) ! standard assembler/ELF epilogue ! ! end diff --git a/pr/src/md/unix/solaris.c b/pr/src/md/unix/solaris.c index 9edb6b5b..882cbca4 100644 --- a/pr/src/md/unix/solaris.c +++ b/pr/src/md/unix/solaris.c @@ -19,7 +19,6 @@ #undef _FILE_OFFSET_BITS #include "primpl.h" -#include <sys/systeminfo.h> extern PRBool suspendAllOn; @@ -59,24 +58,8 @@ PRIntervalTime _MD_Solaris_GetInterval(void) } #ifdef _PR_PTHREADS - -static PRInt32 _md_ultrasparc = 0; - void _MD_EarlyInit(void) { -#define MACHINE_NAME_LEN 32 -#define ULTRASPARC "sun4u" -char machine[MACHINE_NAME_LEN]; -int rv; - - rv = sysinfo(SI_MACHINE, machine, MACHINE_NAME_LEN); - /* - * detect an ultrasparc (Sparc V9) system - */ - if ((rv > 0) && (rv <= MACHINE_NAME_LEN)) { - if (!strncmp(machine,ULTRASPARC, strlen(ULTRASPARC))) - _md_ultrasparc = 1; - } } PRWord *_MD_HomeGCRegisters(PRThread *t, PRIntn isCurrent, PRIntn *np) @@ -107,22 +90,13 @@ PRInt32 _MD_AtomicIncrement(PRInt32 *val) { PRInt32 rv; + if (mutex_lock(&_solaris_atomic) != 0) + PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - if (_md_ultrasparc) { - rv = _pr_md_ultrasparc_inc(val); - } else { -#endif - if (mutex_lock(&_solaris_atomic) != 0) - PR_ASSERT(0); - - rv = ++(*val); + rv = ++(*val); - if (mutex_unlock(&_solaris_atomic) != 0)\ - PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - } -#endif + if (mutex_unlock(&_solaris_atomic) != 0)\ + PR_ASSERT(0); return rv; } @@ -131,22 +105,13 @@ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val) { PRInt32 rv; + if (mutex_lock(&_solaris_atomic) != 0) + PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - if (_md_ultrasparc) { - rv = _pr_md_ultrasparc_add(ptr, val); - } else { -#endif - if (mutex_lock(&_solaris_atomic) != 0) - PR_ASSERT(0); - - rv = ((*ptr) += val); + rv = ((*ptr) += val); - if (mutex_unlock(&_solaris_atomic) != 0)\ - PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - } -#endif + if (mutex_unlock(&_solaris_atomic) != 0)\ + PR_ASSERT(0); return rv; } @@ -155,22 +120,14 @@ PRInt32 _MD_AtomicDecrement(PRInt32 *val) { PRInt32 rv; + if (mutex_lock(&_solaris_atomic) != 0) + PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - if (_md_ultrasparc) { - rv = _pr_md_ultrasparc_dec(val); - } else { -#endif - if (mutex_lock(&_solaris_atomic) != 0) - PR_ASSERT(0); + rv = --(*val); - rv = --(*val); + if (mutex_unlock(&_solaris_atomic) != 0)\ + PR_ASSERT(0); - if (mutex_unlock(&_solaris_atomic) != 0)\ - PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - } -#endif return rv; } @@ -178,23 +135,15 @@ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval) { PRInt32 rv; + if (mutex_lock(&_solaris_atomic) != 0) + PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - if (_md_ultrasparc) { - rv = _pr_md_ultrasparc_set(val, newval); - } else { -#endif - if (mutex_lock(&_solaris_atomic) != 0) - PR_ASSERT(0); + rv = *val; + *val = newval; - rv = *val; - *val = newval; + if (mutex_unlock(&_solaris_atomic) != 0)\ + PR_ASSERT(0); - if (mutex_unlock(&_solaris_atomic) != 0)\ - PR_ASSERT(0); -#ifdef _PR_ULTRASPARC - } -#endif return rv; } #endif /* _PR_HAVE_ATOMIC_OPS */ |