Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 2021 15:02:06 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 09b0d7764386 - main - databases/mariadb105-server: fix build on powerpc64le
Message-ID:  <202109271502.18RF26BD061458@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=09b0d776438600cc33e3c83f1a7273688bf156a7

commit 09b0d776438600cc33e3c83f1a7273688bf156a7
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-09-27 14:59:55 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-09-27 14:59:55 +0000

    databases/mariadb105-server: fix build on powerpc64le
    
    Add FreeBSD variants for Linux-only code.
---
 .../files/patch-include_my__cpu.h                  | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/databases/mariadb105-server/files/patch-include_my__cpu.h b/databases/mariadb105-server/files/patch-include_my__cpu.h
new file mode 100644
index 000000000000..e205cbfa05e2
--- /dev/null
+++ b/databases/mariadb105-server/files/patch-include_my__cpu.h
@@ -0,0 +1,48 @@
+--- include/my_cpu.h.orig	2021-09-27 13:32:48 UTC
++++ include/my_cpu.h
+@@ -23,7 +23,8 @@
+   The defines are the same ones used by the linux kernel
+ */
+ 
+-#ifdef _ARCH_PWR8
++#if defined(_ARCH_PWR8)
++#if defined(linux)
+ #include <sys/platform/ppc.h>
+ /* Very low priority */
+ #define HMT_very_low() __ppc_set_ppr_very_low()
+@@ -37,6 +38,22 @@
+ #define HMT_medium_high() __ppc_set_ppr_med_high()
+ /* High priority */
+ #define HMT_high() asm volatile("or 3,3,3")
++#elif defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++/* Very low priority */
++#define HMT_very_low() __asm__ volatile ("or 31,31,31")
++/* Low priority */
++#define HMT_low() __asm__ volatile ("or 1,1,1")
++/* Medium low priority */
++#define HMT_medium_low() __asm__ volatile ("or 6,6,6")
++/* Medium priority */
++#define HMT_medium() __asm__ volatile ("or 2,2,2")
++/* Medium high priority */
++#define HMT_medium_high() __asm__ volatile ("or 5,5,5")
++/* High priority */
++#define HMT_high() asm volatile("or 3,3,3")
++#endif
+ #else
+ #define HMT_very_low()
+ #define HMT_low()
+@@ -81,7 +98,12 @@ static inline void MY_RELAX_CPU(void)
+   __asm__ __volatile__ ("pause");
+ #endif
+ #elif defined(_ARCH_PWR8)
++#if defined(linux)
+   __ppc_get_timebase();
++#elif defined(__FreeBSD__)
++  uint64_t __tb;
++  __asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
++#endif
+ #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
+   /* Mainly, prevent the compiler from optimizing away delay loops */
+ #ifdef _aarch64_



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109271502.18RF26BD061458>