Bugzilla Bug 298674: checked in the remaining changes for the RISC OS port.
authorwtchang%redhat.com
Thu, 21 Jul 2005 18:22:54 +0000
changeset 3422 3cf16ebfb3a5fdfda9bd255980c95ae0ca316037
parent 3421 0dbd22f1c10aed86d4b53a11e30b2ec53b12b197
child 3423 6329fead4be42a58b754330e292052b1ecd23070
push idunknown
push userunknown
push dateunknown
bugs298674
Bugzilla Bug 298674: checked in the remaining changes for the RISC OS port. The patch is contributed by Peter Naulls <peter@chocky.org>. r=wtc Modified Files: _pth.h _riscos.cfg _riscos.h prmem.c prsystem.c
pr/include/md/_pth.h
pr/include/md/_riscos.cfg
pr/include/md/_riscos.h
pr/src/malloc/prmem.c
pr/src/misc/prsystem.c
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -289,15 +289,15 @@ extern int (*_PT_aix_yield_fcn)();
     PR_BEGIN_MACRO               				\
 		struct timespec onemillisec = {0};		\
 		onemillisec.tv_nsec = 1000000L;			\
         nanosleep(&onemillisec,NULL);			\
     PR_END_MACRO
 #elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
 	|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
 	|| defined(BSDI) || defined(NTO) || defined(DARWIN) \
-	|| defined(UNIXWARE)
+	|| defined(UNIXWARE) || defined(RISCOS)
 #define _PT_PTHREAD_YIELD()            	sched_yield()
 #else
 #error "Need to define _PT_PTHREAD_YIELD for this platform"
 #endif
 
 #endif /* nspr_pth_defs_h_ */
--- a/pr/include/md/_riscos.cfg
+++ b/pr/include/md/_riscos.cfg
@@ -75,16 +75,25 @@
 #define PR_BITS_PER_SHORT_LOG2  4
 #define PR_BITS_PER_INT_LOG2    5
 #define PR_BITS_PER_INT64_LOG2  6
 #define PR_BITS_PER_LONG_LOG2   5
 #define PR_BITS_PER_FLOAT_LOG2  5
 #define PR_BITS_PER_DOUBLE_LOG2 6
 #define PR_BITS_PER_WORD_LOG2   5
 
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  4
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD    4
+
 #define PR_BYTES_PER_WORD_LOG2   2
 #define PR_BYTES_PER_DWORD_LOG2  3
 #define PR_WORDS_PER_DWORD_LOG2  1
 
 #ifndef NO_NSPR_10_SUPPORT
 
 #define BYTES_PER_BYTE		PR_BYTES_PER_BYTE
 #define BYTES_PER_SHORT 	PR_BYTES_PER_SHORT
--- a/pr/include/md/_riscos.h
+++ b/pr/include/md/_riscos.h
@@ -49,28 +49,24 @@
 #define _PR_POLL_AVAILABLE
 #define _PR_USE_POLL
 #define _PR_HAVE_SOCKADDR_LEN
 #undef HAVE_BSD_FLOCK
 #define _PR_NO_LARGE_FILES
 #define _PR_STAT_HAS_ONLY_ST_ATIME
 #define _PR_HAVE_POSIX_SEMAPHORES
 
-#define uint unsigned int
-
-#undef atoll
-
 #include <sys/select.h>
 #include <sys/poll.h>
 #include <kernel.h>
 
 
 #undef  HAVE_STACK_GROWING_UP
-#undef	HAVE_DLL
-#undef	USE_DLFCN
+#undef  HAVE_DLL
+#undef  USE_DLFCN
 #define NEED_STRFTIME_LOCK
 #define NEED_TIME_R
 #define PT_NO_SIGTIMEDWAIT
 
 #ifndef HAVE_STRERROR
 #define HAVE_STRERROR
 #endif
 
--- a/pr/src/malloc/prmem.c
+++ b/pr/src/malloc/prmem.c
@@ -167,16 +167,17 @@ pr_FindSymbolInProg(const char *name)
 
 #else /* !defined(HAVE_DLL) */
 
 static void *
 pr_FindSymbolInProg(const char *name)
 {
     /* can't be implemented */
     return NULL;
+}
 
 #endif /* HAVE_DLL */
 
 void
 _PR_InitZones(void)
 {
     int i, j;
     char *envp;
--- a/pr/src/misc/prsystem.c
+++ b/pr/src/misc/prsystem.c
@@ -250,16 +250,18 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProc
 #elif defined(HPUX)
     numCpus = mpctl( MPC_GETNUMSPUS, 0, 0 );
     if ( numCpus < 1 )  {
         numCpus = -1; /* set to -1 for return value on error */
         _PR_MD_MAP_DEFAULT_ERROR( _MD_ERRNO() );
     }
 #elif defined(IRIX)
     numCpus = sysconf( _SC_NPROC_ONLN );
+#elif defined(RISCOS)
+    numCpus = 1;
 #elif defined(XP_UNIX)
     numCpus = sysconf( _SC_NPROCESSORS_ONLN );
 #else
 #error "An implementation is required"
 #endif
     return(numCpus);
 } /* end PR_GetNumberOfProcessors() */