Blame SOURCES/mysql-s390-tsc.patch

549713
Support s390/s390x in performance schema's cycle-counting functions.
549713
Filed upstream at http://bugs.mysql.com/bug.php?id=59953
549713
549713
549713
diff -up --recursive mysql-5.7.9.orig/include/my_rdtsc.h mysql-5.7.9/include/my_rdtsc.h
549713
--- mysql-5.7.9.orig/include/my_rdtsc.h	2015-10-12 08:21:33.000000000 +0200
549713
+++ mysql-5.7.9/include/my_rdtsc.h	2015-11-10 16:33:36.037432669 +0100
549713
@@ -125,6 +125,7 @@ C_MODE_END
549713
 #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
549713
 #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64       27
549713
 #define MY_TIMER_ROUTINE_ASM_AARCH64             28
549713
+#define MY_TIMER_ROUTINE_ASM_S390                29
549713
 
549713
 #endif
549713
 
549713
diff -up --recursive mysql-5.7.9.orig/mysys/my_rdtsc.c mysql-5.7.9/mysys/my_rdtsc.c
549713
--- mysql-5.7.9.orig/mysys/my_rdtsc.c	2015-10-12 08:21:33.000000000 +0200
549713
+++ mysql-5.7.9/mysys/my_rdtsc.c	2015-11-10 16:33:36.038432668 +0100
549713
@@ -183,6 +183,13 @@ ulonglong my_timer_cycles(void)
549713
     __asm __volatile__ ("mrs %[rt],cntvct_el0" : [rt] "=r" (result));
549713
     return result;
549713
   }
549713
+#elif defined(__GNUC__) && defined(__s390__)
549713
+  /* covers both s390 and s390x */
549713
+  {
549713
+    ulonglong result;
549713
+    __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
549713
+   return result;
549713
+  }
549713
 #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
549713
   /* gethrtime may appear as either cycle or nanosecond counter */
549713
   return (ulonglong) gethrtime();
549713
@@ -487,6 +494,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
549713
   mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
549713
 #elif defined(__GNUC__) && defined(__aarch64__)
549713
   mti->cycles.routine= MY_TIMER_ROUTINE_ASM_AARCH64;
549713
+#elif defined(__GNUC__) && defined(__s390__)
549713
+  mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
549713
 #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
549713
   mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
549713
 #else