summaryrefslogtreecommitdiff
path: root/src/clock.cpp
diff options
context:
space:
mode:
authorNeale Ferguson <neale@sinenomine.net>2011-01-12 09:22:25 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-01-12 09:22:25 +0100
commit70513871082462c957e46986040ebe7b10d64557 (patch)
treee3ac79e6604f3b8b679df7deca54e7e0bbf8cf9c /src/clock.cpp
parent725ebce13ca7871002063c4a254bf532d35ee878 (diff)
Support dynamic generation of C preprocessor definitions for PGM rather than hardcoding them.
Signed-off-by: Neale Ferguson <neale@sinenomine.net>
Diffstat (limited to 'src/clock.cpp')
-rw-r--r--src/clock.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/clock.cpp b/src/clock.cpp
index e18a715..e95b5f6 100644
--- a/src/clock.cpp
+++ b/src/clock.cpp
@@ -106,6 +106,11 @@ uint64_t zmq::clock_t::rdtsc ()
} tsc;
asm("rdtsc" : "=a" (tsc.u32val [0]), "=d" (tsc.u32val [1]));
return tsc.u64val;
+#elif defined(__s390__)
+ uint64_t tsc;
+ asm("\tstck\t%0\n" : "=Q" (tsc) : : "cc");
+ tsc >>= 12; /* convert to microseconds just to be consistent */
+ return(tsc);
#else
return 0;
#endif