aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer/cpu_counter/tm_hard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timer/cpu_counter/tm_hard.cpp')
-rw-r--r--src/timer/cpu_counter/tm_hard.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/timer/cpu_counter/tm_hard.cpp b/src/timer/cpu_counter/tm_hard.cpp
deleted file mode 100644
index 9e31aee39..000000000
--- a/src/timer/cpu_counter/tm_hard.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-* Hardware Timer
-* (C) 1999-2007 Jack Lloyd
-*
-* Distributed under the terms of the Botan license
-*/
-
-#include <botan/tm_hard.h>
-
-namespace Botan {
-
-/*
-* Get the timestamp
-*/
-u64bit Hardware_Timer::clock() const
- {
- u64bit rtc = 0;
-
-#if defined(BOTAN_TARGET_ARCH_IS_IA32) || defined(BOTAN_TARGET_ARCH_IS_AMD64)
- u32bit rtc_low = 0, rtc_high = 0;
- asm volatile("rdtsc" : "=d" (rtc_high), "=a" (rtc_low));
- rtc = (static_cast<u64bit>(rtc_high) << 32) | rtc_low;
-
-#elif defined(BOTAN_TARGET_ARCH_IS_PPC) || defined(BOTAN_TARGET_ARCH_IS_PPC64)
- u32bit rtc_low = 0, rtc_high = 0;
- asm volatile("mftbu %0; mftb %1" : "=r" (rtc_high), "=r" (rtc_low));
- rtc = (static_cast<u64bit>(rtc_high) << 32) | rtc_low;
-
-#elif defined(BOTAN_TARGET_ARCH_IS_ALPHA)
- asm volatile("rpcc %0" : "=r" (rtc));
-
-#elif defined(BOTAN_TARGET_ARCH_IS_SPARC64)
- asm volatile("rd %%tick, %0" : "=r" (rtc));
-
-#elif defined(BOTAN_TARGET_ARCH_IS_IA64)
- asm volatile("mov %0=ar.itc" : "=r" (rtc));
-
-#elif defined(BOTAN_TARGET_ARCH_IS_S390X)
- asm volatile("stck 0(%0)" : : "a" (&rtc) : "memory", "cc");
-
-#elif defined(BOTAN_TARGET_ARCH_IS_HPPA)
- asm volatile("mfctl 16,%0" : "=r" (rtc)); // 64-bit only?
-
-#else
- #error "Unsure how to access hardware timer on this system"
-#endif
-
- return rtc;
- }
-
-}