Checking in changes to get 622 working on IPF NETSCAPE_6_2_2_BRANCH
authorjdunn%netscape.com
Mon, 08 Apr 2002 15:41:55 +0000
branchNETSCAPE_6_2_2_BRANCH
changeset 2327 2c114822677cd61d17b8f71b1b66006d5bc02a96
parent 2075 c27b6bc4f17b0984652760da086c1028d9215cb3
child 2328 5d6d873fe05b40886fea67db14a1f6c64629dc3e
push idunknown
push userunknown
push dateunknown
bugs136163
Checking in changes to get 622 working on IPF # 136163 r=martinl@netscape.com a=jdunn@netscape.com
pr/src/md/unix/uxrng.c
--- a/pr/src/md/unix/uxrng.c
+++ b/pr/src/md/unix/uxrng.c
@@ -59,25 +59,38 @@ GetHighResClock(void *buf, size_t maxbyt
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     return 0;
 }
 
 #elif defined(HPUX)
 
+#ifdef __ia64
+#include <ia64/sys/inline.h>
+
+static size_t
+GetHighResClock(void *buf, size_t maxbytes)
+{
+    PRUint64 t;
+
+    t = _Asm_mov_from_ar(_AREG44);
+    return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
+}
+#else
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     extern int ret_cr16();
     int cr16val;
 
     cr16val = ret_cr16();
     return(_pr_CopyLowBits(buf, maxbytes, &cr16val, sizeof(cr16val)));
 }
+#endif
 
 #elif defined(OSF1)
 
 #include <c_asm.h>
 
 /*
  * Use the "get the cycle counter" instruction on the alpha.
  * The low 32 bits completely turn over in less than a minute.
@@ -205,17 +218,17 @@ static size_t GetHighResClock(void *buf,
 
 	        raddr = phys_addr & ~pgoffmask;
 	        mfd = open("/dev/mmem", O_RDONLY);
 	        if (mfd < 0) {
     		    return 0;
 	        }
 	        iotimer_addr = (unsigned *)
 		    mmap(0, pgoffmask, PROT_READ, MAP_PRIVATE, mfd, (int)raddr);
-	        if (iotimer_addr == (void*)-1) {
+	        if (iotimer_addr == (unsigned*)-1) {
 	    	    close(mfd);
 		        iotimer_addr = NULL;
 		        return 0;
 	        }
 	        iotimer_addr = (unsigned*)
 		    ((__psint_t)iotimer_addr | (phys_addr & pgoffmask));
 	        /*
 	         * The file 'mfd' is purposefully not closed.
@@ -273,17 +286,17 @@ GetHighResClock(void *buf, size_t maxbyt
 #elif defined(NEC)
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     return 0;
 }
 #elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) \
-    || defined(QNX) || defined(RHAPSODY)
+    || defined(QNX) || defined(DARWIN)
 #include <sys/times.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     int ticks;
     struct tms buffer;