代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/greatsql 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 77b6310acfd57e500211784806bb60c76c9a6cb2 Mon Sep 17 00:00:00 2001
From: Huang Yang <huangyang@loongson.cn>
Date: Mon, 22 Apr 2024 03:23:18 +0000
Subject: [PATCH] greatsql 8.0.32 add loongarch support
---
extra/duktape/duktape-2.7.0/src/duk_config.h | 12 ++++++++++
.../source/i18n/double-conversion-utils.h | 3 ++-
storage/ndb/include/portlib/mt-asm.h | 24 +++++++++++++++++++
3 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/extra/duktape/duktape-2.7.0/src/duk_config.h b/extra/duktape/duktape-2.7.0/src/duk_config.h
index 77cddc1d..2c919ea9 100644
--- a/extra/duktape/duktape-2.7.0/src/duk_config.h
+++ b/extra/duktape/duktape-2.7.0/src/duk_config.h
@@ -42,6 +42,7 @@
* - SPARC 64-bit
* - RISC-V 32-bit
* - RISC-V 64-bit
+ * - loongarch 64-bit
* - SuperH
* - Motorola 68k
* - Emscripten
@@ -303,6 +304,11 @@
#endif
#endif /* __riscv */
+/* loongarch64 */
+#if defined(__loongarch64)
+#define DUK_F_LOONGARCH64
+#endif
+
/* SuperH */
#if defined(__sh__) || \
defined(__sh1__) || defined(__SH1__) || \
@@ -991,6 +997,12 @@
#define DUK_USE_BYTEORDER 1
#undef DUK_USE_PACKED_TVAL
#define DUK_F_PACKED_TVAL_PROVIDED
+#elif defined(DUK_F_LOONGARCH64)
+/* --- loongarch 64-bit --- */
+#define DUK_USE_ARCH_STRING "loongarch64"
+#define DUK_USE_BYTEORDER 1
+#undef DUK_USE_PACKED_TVAL
+#define DUK_F_PACKED_TVAL_PROVIDED
#elif defined(DUK_F_SUPERH)
/* --- SuperH --- */
#define DUK_USE_ARCH_STRING "sh"
diff --git a/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h b/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h
index c9374636..8d95fe89 100644
--- a/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h
+++ b/extra/icu/icu-release-69-1/source/i18n/double-conversion-utils.h
@@ -128,7 +128,8 @@ int main(int argc, char** argv) {
defined(__riscv) || defined(__e2k__) || \
defined(__or1k__) || defined(__arc__) || \
defined(__microblaze__) || defined(__XTENSA__) || \
- defined(__EMSCRIPTEN__) || defined(__wasm32__)
+ defined(__EMSCRIPTEN__) || defined(__wasm32__) || \
+ defined(__loongarch64)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(__mc68000__) || \
defined(__pnacl__) || defined(__native_client__)
diff --git a/storage/ndb/include/portlib/mt-asm.h b/storage/ndb/include/portlib/mt-asm.h
index 418b8d9c..f2518eeb 100644
--- a/storage/ndb/include/portlib/mt-asm.h
+++ b/storage/ndb/include/portlib/mt-asm.h
@@ -156,6 +156,30 @@ xcng(volatile unsigned * addr, int val)
#define wmb() std::atomic_thread_fence(std::memory_order_seq_cst)
#define cpu_pause() __asm__ __volatile__ ("yield")
+#elif defined(__loongarch64)
+
+#define NDB_HAVE_MB
+#define NDB_HAVE_RMB
+#define NDB_HAVE_WMB
+//#define NDB_HAVE_XCNG
+
+// details frome kernel-6.9 arch/loongarch/include/asm/barrier.h
+
+#define DBAR(hint) __asm__ __volatile__("dbar %0 " : : "I"(hint) : "memory")
+
+#define crwrw 0b00000
+#define cr_r_ 0b00101
+#define c_w_w 0b01010
+
+#define c_sync() DBAR(crwrw)
+#define c_rsync() DBAR(cr_r_)
+#define c_wsync() DBAR(c_w_w)
+
+#define mb() c_sync()
+#define rmb() c_rsync()
+#define wmb() c_wsync()
+
+#define cpu_pause() __asm__ __volatile__ ("nop")
#else
#define NDB_NO_ASM "Unsupported architecture (gcc)"
--
2.43.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。