1Remove glibc specific function dependencies
2
3Sourced from: https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6diff --git a/include/my_cpu.h b/include/my_cpu.h
7index f2e26fca..94599b74 100644
8--- a/include/my_cpu.h
9+++ b/include/my_cpu.h
10@@ -24,17 +24,16 @@
11 */
12
13 #ifdef _ARCH_PWR8
14-#include <sys/platform/ppc.h>
15 /* Very low priority */
16-#define HMT_very_low() __ppc_set_ppr_very_low()
17+#define HMT_very_low() asm volatile("or 31,31,31")
18 /* Low priority */
19-#define HMT_low() __ppc_set_ppr_low()
20+#define HMT_low() asm volatile ("or 1,1,1")
21 /* Medium low priority */
22-#define HMT_medium_low() __ppc_set_ppr_med_low()
23+#define HMT_medium_low() asm volatile ("or 6,6,6")
24 /* Medium priority */
25-#define HMT_medium() __ppc_set_ppr_med()
26+#define HMT_medium() asm volatile ("or 2,2,2")
27 /* Medium high priority */
28-#define HMT_medium_high() __ppc_set_ppr_med_high()
29+#define HMT_medium_high() asm volatile("or 5,5,5")
30 /* High priority */
31 #define HMT_high() asm volatile("or 3,3,3")
32 #else
33@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void)
34   __asm__ __volatile__ ("pause");
35 #endif
36 #elif defined(_ARCH_PWR8)
37-  __ppc_get_timebase();
38+  __builtin_ppc_get_timebase();
39 #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
40   /* Mainly, prevent the compiler from optimizing away delay loops */
41   __asm__ __volatile__ ("":::"memory");
42