summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStas Sergeev <stsp@aknet.ru>2007-05-28 23:10:20 +0400
committerStas Sergeev <stsp@aknet.ru>2007-05-28 23:10:20 +0400
commit54af64d5c7612dee367fd9ddfec3d5db62ff14f3 (patch)
treee7e03ecfc60337942d7c414ec4ae9c65905f4410 /src
parent6687a340feb300841f5885a993cfd20a7604178b (diff)
downloadxine-lib-54af64d5c7612dee367fd9ddfec3d5db62ff14f3.tar.gz
xine-lib-54af64d5c7612dee367fd9ddfec3d5db62ff14f3.tar.bz2
Add an x86_64-specific version of rdtsc().
Diffstat (limited to 'src')
-rw-r--r--src/xine-utils/monitor.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c
index 1a348087c..fa3bcc779 100644
--- a/src/xine-utils/monitor.c
+++ b/src/xine-utils/monitor.c
@@ -64,13 +64,20 @@ int xine_profiler_allocate_slot (const char *label) {
}
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(ARCH_X86_32)
__inline__ unsigned long long int rdtsc(void)
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
+#elif defined(ARCH_X86_64)
+__inline__ unsigned long long int rdtsc(void)
+{
+ unsigned long long int a, d;
+ __asm__ volatile (".byte 0x0f, 0x31" : "=a" (a), "=d" (d));
+ return (d << 32) | (a & 0xffffffff);
+}
#endif
void xine_profiler_start_count (int id) {