代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/userspace-rcu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff --git a/include/Makefile.am b/include/Makefile.am
index 3f92cc3..5c042fd 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -16,6 +16,7 @@ nobase_include_HEADERS = \
urcu/arch/sparc64.h \
urcu/arch/tile.h \
urcu/arch/x86.h \
+ urcu/arch/loongarch.h \
urcu/call-rcu.h \
urcu/cds.h \
urcu/compiler.h \
@@ -76,6 +77,7 @@ nobase_include_HEADERS = \
urcu/uatomic/sparc64.h \
urcu/uatomic/tile.h \
urcu/uatomic/x86.h \
+ urcu/uatomic/loongarch.h \
urcu/urcu-bp.h \
urcu/urcu-futex.h \
urcu/urcu.h \
diff --git a/include/urcu/arch.h b/include/urcu/arch.h
index 620743c..e42267a 100644
--- a/include/urcu/arch.h
+++ b/include/urcu/arch.h
@@ -157,6 +157,11 @@
#define URCU_ARCH_RISCV 1
#include <urcu/arch/riscv.h>
+#elif defined(__loongarch__) || (_loongarch64)
+
+#define URCU_ARCH_LOONGARCH 1
+#include <urcu/arch/loongarch.h>
+
#else
#error "Cannot build: unrecognized architecture, see <urcu/arch.h>."
#endif
diff --git a/include/urcu/arch/loongarch.h b/include/urcu/arch/loongarch.h
new file mode 100644
index 0000000..865bbb5
--- /dev/null
+++ b/include/urcu/arch/loongarch.h
@@ -0,0 +1,50 @@
+#ifndef _URCU_ARCH_LOONGARCH_H
+#define _URCU_ARCH_LOONGARCH_H
+
+/*
+ * arch/loongarch.h: definitions for the LOONGARCH architecture
+ *
+ * Copyright (c) 2022 Loongson Technology Corporation Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/config.h>
+#include <urcu/syscall-compat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+/*
+ * On Linux, define the membarrier system call number if not yet available in
+ * the system headers. loongarch64 implements asm-generic/unistd.h system call
+ * numbers.
+ */
+#if (defined(__linux__) && !defined(__NR_membarrier))
+#define __NR_membarrier 283
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/arch/generic.h>
+
+#endif /* _URCU_ARCH_LOONGARCH_H */
diff --git a/include/urcu/uatomic.h b/include/urcu/uatomic.h
index 2fb5fd4..e1ff44d 100644
--- a/include/urcu/uatomic.h
+++ b/include/urcu/uatomic.h
@@ -51,6 +51,8 @@
#include <urcu/uatomic/m68k.h>
#elif defined(URCU_ARCH_RISCV)
#include <urcu/uatomic/riscv.h>
+#elif defined(URCU_ARCH_LOONGARCH)
+#include <urcu/uatomic/loongarch.h>
#else
#error "Cannot build: unrecognized architecture, see <urcu/arch.h>."
#endif
diff --git a/include/urcu/uatomic/loongarch.h b/include/urcu/uatomic/loongarch.h
new file mode 100644
index 0000000..e0fb2a6
--- /dev/null
+++ b/include/urcu/uatomic/loongarch.h
@@ -0,0 +1,44 @@
+/*
+ * Atomic exchange operations for the LOONGARCH architecture. Let GCC do it.
+ *
+ * Copyright (c) 2022 Loongson Technology Corporation Limited
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _URCU_ARCH_UATOMIC_LOONGARCH_H
+#define _URCU_ARCH_UATOMIC_LOONGARCH_H
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define UATOMIC_HAS_ATOMIC_BYTE
+#define UATOMIC_HAS_ATOMIC_SHORT
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/uatomic/generic.h>
+
+#endif /* _URCU_ARCH_UATOMIC_LOONGARCH_H */
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。