From 86e1a7ff92df1589a3a0e0dd44ef2d861e307620 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 25 Jun 2014 13:58:59 -0700 Subject: Unify hp-timing implementations Provide an hp-timing-common.h for ports to use. --- sysdeps/x86_64/hp-timing.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64') 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 @@ . */ #ifndef _HP_TIMING_H +#define _HP_TIMING_H 1 -/* We can use some of the i686 implementation without changes. */ -# include +/* 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 + #endif /* hp-timing.h */ -- cgit 1.4.1