mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user