diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-11-27 13:58:30 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-12-09 16:52:12 +0400 |
commit | 218da97d5d8e42de68d38aee25d5367569a35c4c (patch) | |
tree | 1c21d2fc0917878d0490e0e765ed34ea7df20e2a /mysys | |
parent | f3e5329846a99339d8b69e27b2470956bcf1ed29 (diff) | |
download | mariadb-git-218da97d5d8e42de68d38aee25d5367569a35c4c.tar.gz |
MDEV-9172 - Analyze patches for IBM System z
Extended my_timer_cycles() to support s390.
Some compiler tunings for RHEL/SLES RPM packages on s390.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_rdtsc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c index 82e560944f9..4228973caa8 100644 --- a/mysys/my_rdtsc.c +++ b/mysys/my_rdtsc.c @@ -249,6 +249,13 @@ ulonglong my_timer_cycles(void) clock_gettime(CLOCK_SGI_CYCLE, &tp); return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; } +#elif defined(__GNUC__) && defined(__s390__) + /* covers both s390 and s390x */ + { + ulonglong result; + __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc"); + return result; + } #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) /* gethrtime may appear as either cycle or nanosecond counter */ return (ulonglong) gethrtime(); @@ -558,6 +565,8 @@ void my_timer_init(MY_TIMER_INFO *mti) mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32; #elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE; +#elif defined(__GNUC__) && defined(__s390__) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390; #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME; #else |