summaryrefslogtreecommitdiff
path: root/arch/arch-x86_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arch-x86_64.h')
-rw-r--r--arch/arch-x86_64.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arch-x86_64.h b/arch/arch-x86_64.h
index 457714c8..3ea8070e 100644
--- a/arch/arch-x86_64.h
+++ b/arch/arch-x86_64.h
@@ -38,7 +38,17 @@ static inline unsigned int arch_ffz(unsigned int bitmask)
__asm__("bsfl %1,%0" :"=r" (bitmask) :"r" (~bitmask));
return bitmask;
}
+
+static inline unsigned long long get_cpu_clock(void)
+{
+ unsigned int lo, hi;
+
+ __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi));
+ return ((unsigned long long) hi << 32ULL) | lo;
+}
+
#define ARCH_HAVE_FFZ
#define ARCH_HAVE_SSE
+#define ARCH_HAVE_CPU_CLOCK
#endif