about summary refs log tree commit diff
path: root/sysdeps/x86_64/hp-timing.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-06-25 13:58:59 -0700
committerRichard Henderson <rth@twiddle.net>2014-07-03 08:38:30 -0700
commit86e1a7ff92df1589a3a0e0dd44ef2d861e307620 (patch)
tree4d4d60aeed7a88a42ac04f5e0867fc76b832d84f /sysdeps/x86_64/hp-timing.h
parent428dd03f5a7291d19f0c45fc314da9356ee22d63 (diff)
downloadglibc-86e1a7ff92df1589a3a0e0dd44ef2d861e307620.tar.gz
glibc-86e1a7ff92df1589a3a0e0dd44ef2d861e307620.tar.xz
glibc-86e1a7ff92df1589a3a0e0dd44ef2d861e307620.zip
Unify hp-timing implementations
Provide an hp-timing-common.h for ports to use.
Diffstat (limited to 'sysdeps/x86_64/hp-timing.h')
-rw-r--r--sysdeps/x86_64/hp-timing.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/sysdeps/x86_64/hp-timing.h b/sysdeps/x86_64/hp-timing.h
index e132dacab6..89501fc3f4 100644
--- a/sysdeps/x86_64/hp-timing.h
+++ b/sysdeps/x86_64/hp-timing.h
@@ -17,15 +17,23 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef _HP_TIMING_H
+#define _HP_TIMING_H	1
 
-/* We can use some of the i686 implementation without changes.  */
-# include <sysdeps/i386/i686/hp-timing.h>
+/* We always assume having the timestamp register.  */
+#define HP_TIMING_AVAIL		(1)
+
+/* We indeed have inlined functions.  */
+#define HP_TIMING_INLINE	(1)
+
+/* We use 64bit values for the times.  */
+typedef unsigned long long int hp_timing_t;
 
 /* The "=A" constraint used in 32-bit mode does not work in 64-bit mode.  */
-# undef HP_TIMING_NOW
-# define HP_TIMING_NOW(Var) \
+#define HP_TIMING_NOW(Var) \
   ({ unsigned int _hi, _lo; \
      asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \
      (Var) = ((unsigned long long int) _hi << 32) | _lo; })
 
+#include <hp-timing-common.h>
+
 #endif /* hp-timing.h */