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