summaryrefslogtreecommitdiff
path: root/pr/src/md/unix/uxrng.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/md/unix/uxrng.c')
-rw-r--r--pr/src/md/unix/uxrng.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/pr/src/md/unix/uxrng.c b/pr/src/md/unix/uxrng.c
index 64358289..6add3bf1 100644
--- a/pr/src/md/unix/uxrng.c
+++ b/pr/src/md/unix/uxrng.c
@@ -64,6 +64,18 @@ GetHighResClock(void *buf, size_t maxbytes)
#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)
{
@@ -73,6 +85,7 @@ GetHighResClock(void *buf, size_t maxbytes)
cr16val = ret_cr16();
return(_pr_CopyLowBits(buf, maxbytes, &cr16val, sizeof(cr16val)));
}
+#endif
#elif defined(OSF1)
@@ -88,7 +101,11 @@ GetHighResClock(void *buf, size_t maxbytes)
{
unsigned long t;
+#ifdef __GNUC__
+ __asm__("rpcc %0" : "=r" (t));
+#else
t = asm("rpcc %v0");
+#endif
return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
}
@@ -210,7 +227,7 @@ static size_t GetHighResClock(void *buf, size_t maxbuf)
}
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;