Description: HACK: Default my_timer_cycles() to my_timer_microseconds()
 Tests on MIPS and SPARC64 were failing:
  -  "query_optimization": {
  -    "r_total_time_ms": "REPLACED"
  -  },
 .
 r_total_time_ms was missing due to lack of any my_timer_cycles()
 implementation.
 .
 This patch does the one-line hack of providing some implementation
 (and moves some function declarations a bit earlier for that),
 a proper fix should revisit all this 15-20 year old timer code.
 .
 Using std::chrono::high_resolution_clock as suggested in the comment
 does not work since this file is used in C code.
Author: Adrian Bunk <bunk@debian.org>
Bug: https://jira.mariadb.org/browse/MDEV-30411

--- mariadb-10.11.1.orig/include/my_rdtsc.h
+++ mariadb-10.11.1/include/my_rdtsc.h
@@ -75,6 +75,36 @@ typedef struct my_timer_info MY_TIMER_IN
 C_MODE_START
 
 /**
+  A nanosecond timer.
+  @return the current timer value, in nanoseconds.
+*/
+ulonglong my_timer_nanoseconds(void);
+
+/**
+  A microseconds timer.
+  @return the current timer value, in microseconds.
+*/
+ulonglong my_timer_microseconds(void);
+
+/**
+  A millisecond timer.
+  @return the current timer value, in milliseconds.
+*/
+ulonglong my_timer_milliseconds(void);
+
+/**
+  A ticks timer.
+  @return the current timer value, in ticks.
+*/
+ulonglong my_timer_ticks(void);
+
+/**
+  Timer initialization function.
+  @param [out] mti the timer characteristics.
+*/
+void my_timer_init(MY_TIMER_INFO *mti);
+
+/**
   A cycle timer.
 
   On clang we use __builtin_readcyclecounter(), except for AARCH64.
@@ -205,40 +235,10 @@ static inline ulonglong my_timer_cycles(
   /* gethrtime may appear as either cycle or nanosecond counter */
   return (ulonglong) gethrtime();
 #else
-  return 0;
+  return my_timer_microseconds();
 #endif
 }
 
-/**
-  A nanosecond timer.
-  @return the current timer value, in nanoseconds.
-*/
-ulonglong my_timer_nanoseconds(void);
-
-/**
-  A microseconds timer.
-  @return the current timer value, in microseconds.
-*/
-ulonglong my_timer_microseconds(void);
-
-/**
-  A millisecond timer.
-  @return the current timer value, in milliseconds.
-*/
-ulonglong my_timer_milliseconds(void);
-
-/**
-  A ticks timer.
-  @return the current timer value, in ticks.
-*/
-ulonglong my_timer_ticks(void);
-
-/**
-  Timer initialization function.
-  @param [out] mti the timer characteristics.
-*/
-void my_timer_init(MY_TIMER_INFO *mti);
-
 C_MODE_END
 
 #define MY_TIMER_ROUTINE_RDTSC                    5
