blob: a4deee6070b03555c4a15d1e7196cac35bf0ba1b [file] [log] [blame]
Andrew Geissler32b11992021-03-31 13:37:05 -05001Remove 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
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05006diff --git a/include/my_cpu.h b/include/my_cpu.h
7index f2e26fca..94599b74 100644
Andrew Geissler32b11992021-03-31 13:37:05 -05008--- a/include/my_cpu.h
9+++ b/include/my_cpu.h
10@@ -24,17 +24,16 @@
11 */
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050012
Andrew Geissler32b11992021-03-31 13:37:05 -050013 #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
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050033@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void)
Andrew Geissler32b11992021-03-31 13:37:05 -050034 __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 */
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050041 __asm__ __volatile__ ("":::"memory");