diff options
author | lloyd <[email protected]> | 2008-11-11 20:58:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 20:58:37 +0000 |
commit | 8879a51da7c3b93e27439122cea5d5aa81ae38c3 (patch) | |
tree | b1faa753266d4a762fc38252df35a2435b757b92 /src/utils/timer/cpu_counter | |
parent | 6eff33ae263109ccbbeb32bd0ffb25c77140cc45 (diff) |
Move utils/{timer,mutex} to toplevel
Diffstat (limited to 'src/utils/timer/cpu_counter')
-rw-r--r-- | src/utils/timer/cpu_counter/info.txt | 36 | ||||
-rw-r--r-- | src/utils/timer/cpu_counter/tm_hard.cpp | 49 | ||||
-rw-r--r-- | src/utils/timer/cpu_counter/tm_hard.h | 25 |
3 files changed, 0 insertions, 110 deletions
diff --git a/src/utils/timer/cpu_counter/info.txt b/src/utils/timer/cpu_counter/info.txt deleted file mode 100644 index 025663a84..000000000 --- a/src/utils/timer/cpu_counter/info.txt +++ /dev/null @@ -1,36 +0,0 @@ -realname "Hardware Timer" - -define TIMER_HARDWARE - -load_on asm_ok - -<add> -tm_hard.cpp -tm_hard.h -</add> - -<cc> -gcc -</cc> - -<arch> -# RDTSC: Pentium and up -i586 -i686 -athlon -pentium4 -pentium-m -amd64 - -ppc # PPC timebase register -ppc64 # PPC timebase register -alpha # rpcc -sparc64 # %tick register -ia64 # ar.itc -s390x -hppa -</arch> - -<requires> -timer -</requires> diff --git a/src/utils/timer/cpu_counter/tm_hard.cpp b/src/utils/timer/cpu_counter/tm_hard.cpp deleted file mode 100644 index 2f7516930..000000000 --- a/src/utils/timer/cpu_counter/tm_hard.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************* -* Hardware Timer Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#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; - } - -} diff --git a/src/utils/timer/cpu_counter/tm_hard.h b/src/utils/timer/cpu_counter/tm_hard.h deleted file mode 100644 index ec5268085..000000000 --- a/src/utils/timer/cpu_counter/tm_hard.h +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************* -* Hardware Timer Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_TIMER_HARDWARE_H__ -#define BOTAN_TIMER_HARDWARE_H__ - -#include <botan/timer.h> - -namespace Botan { - -/************************************************* -* Hardware Timer * -*************************************************/ -class BOTAN_DLL Hardware_Timer : public Timer - { - public: - std::string name() const { return "Hardware Timer"; } - u64bit clock() const; - }; - -} - -#endif |