1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-23249: Support aarch64 architecture timer

aarch64 timer is available to userspace via arch register.
clang's __builtin_readcyclecounter is wrong for aarch64 (reads the PMU
cycle counter instead of the archi-timer register), so we don't use it.

my_rdtsc unit-test on AWS m6g shows:
frequency: 121830845
resolution: 1
overhead: 1

This counter is not strictly increasing, but it is non-decreasing.
This commit is contained in:
Tzachi Zidenberg
2020-07-06 13:43:30 +03:00
parent 5f2628d1ee
commit c76b45a524
2 changed files with 14 additions and 2 deletions

View File

@@ -362,6 +362,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__GNUC__) && defined(__s390__)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
#elif defined(__GNUC__) && defined (__aarch64__)
mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64;
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
#else