Compare commits

..

No commits in common. "2243aa05cb8c18951469ed3fe8ba5773e5435a60" and "18636e3c8a5a27236de4c2f681c98b4f8e2dab00" have entirely different histories.

5 changed files with 5 additions and 287 deletions

View File

@ -1,157 +0,0 @@
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/assert.h \
urcu/call-rcu.h \
urcu/cds.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

Binary file not shown.

View File

@ -1,25 +0,0 @@
From b1cbded1b30a77137984f2b6d13a513eaf58ab8a Mon Sep 17 00:00:00 2001
From: yueyuankun <yueyuankun@kylinos.cn>
Date: Wed, 12 Feb 2025 15:49:08 +0800
Subject: [PATCH] Fix conditional compilation for LoongArch architectures
---
include/urcu/arch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/urcu/arch.h b/include/urcu/arch.h
index 71d7342..a96b8a6 100644
--- a/include/urcu/arch.h
+++ b/include/urcu/arch.h
@@ -173,7 +173,7 @@
#define URCU_ARCH_RISCV 1
#include <urcu/arch/riscv.h>
-#elif defined(__loongarch__) || (_loongarch64)
+#elif (defined(__loongarch__) || defined(_loongarch64))
#define URCU_ARCH_LOONGARCH 1
#include <urcu/arch/loongarch.h>
--
2.33.0

Binary file not shown.

View File

@ -1,14 +1,13 @@
Name: userspace-rcu Name: userspace-rcu
Version: 0.14.0 Version: 0.13.0
Release: 3 Release: 4
Summary: Userspace read-copy-update library Summary: Userspace read-copy-update library
License: LGPLv2+ License: LGPLv2+
URL: http://liburcu.org URL: http://liburcu.org
Source0: http://lttng.org/files/urcu/%{name}-%{version}.tar.bz2 Source0: http://lttng.org/files/urcu/%{name}-%{version}.tar.bz2
Patch0001: userspace-rcu-0.13.0-sw.patch Patch1 : userspace-rcu-0.13.0-sw.patch
Patch0002: add-loongarch.patch
Patch0003: userspace-rcu-0.14.0-fix-conditional-compilation-for-LoongArch-architectu.patch BuildRequires: pkgconfig perl-Test-Harness autoconf automake libtool
BuildRequires: pkgconfig gcc gcc-c++ autoconf automake make libtool
%description %description
liburcu is a LGPLv2.1 userspace RCU (read-copy-update) library. This data liburcu is a LGPLv2.1 userspace RCU (read-copy-update) library. This data
@ -67,105 +66,6 @@ make check
%changelog %changelog
* Wed Feb 12 2025 yueyuankun <yueyuankun@kylinos.cn> - 0.14.0-3
- Type: compile
- ID: NA
- SUG: NA
- DESC: Fix compilation errors in loongarch architecture
Replace setup with autosetup
* Thu Dec 19 2024 wangxiao <wangxiao184@h-partners.com> - 0.14.0-2
- include all patches in the source package
* Wed Jan 24 2024 liuchao <liuchao173@huawei.com> - 0.14.0-1
- upgrade to 0.14.0:
- Fix: urcu-bp: only teardown call-rcu worker in destructor
- Fix: rculfhash: urcu_die() takes positive error value
- Fix: call_rcu: teardown default call_rcu worker on application exit
- Fix: join worker thread in call_rcu_data_free
- Docs: clarify grace period polling API
- Document grace period polling in rcu-api.md
- Implement poll rcu stress test in rcutorture
- urcu-memb,mb,signal: Implement grace period polling
- Fix: auto-resize hash table destroy deadlock
- Fix building on MSYS2
- rculfhash: Include rculfhash-internal.h from local directory
- Remove "Darwin" from "should also work on list"
- Merge branch 'adah1972-improve-md'
- Add semicolons at the end of function prototypes
- Wrap a file name in backticks
- Wrap command-line options in backticks
- Fix a wrong format
- Wrap URLs in angle brackets
- Fix Markdown issues
- Fix: Always check pthread_create for failures
- Disable signals in URCU background threads
- Fix: futex.h: include headers outside extern C
- Fix: add missing unused attribute to _rcu_dereference
- Fix: change method used by _rcu_dereference to strip type constness
- Fix: remove type constness in URCU_FORCE_CAST's C++ version
- Move extern "C" down in include/urcu/urcu-bp.h
- fix: ifdef linux specific cpu count compat
- Add unit tests for possible_cpus_array_len
- fix: sysconf(_SC_NPROCESSORS_CONF) can be less than max cpu id
- Fix: revise obsolete command in README.md
- Fix: workqueue: remove unused variable "ret"
- Fix: urcu-qsbr: futex wait: handle spurious futex wakeups
- Fix: urcu: futex wait: handle spurious futex wakeups
- Fix: urcu-wait: futex wait: handle spurious futex wakeups
- Fix: defer_rcu: futex wait: handle spurious futex wakeups
- Fix: call_rcu: futex wait: handle spurious futex wakeups
- Fix: workqueue: futex wait: handle spurious futex wakeups
- Fix: Use %lu rather than %ld to print count
- Update ABI definition files
- Bump version current and age
- alpha: allocate membarrier system call number
- Bump version to 0.14.0-pre
- Improved test framework
- rculfhash: introduce cds_lfht_node_init_deleted
- Fix: changelog: v0.13.0 was released in 2021
- cleanup: i386 arch detection
- fix: properly detect 'cmpxchg' on x86-32
- fix: use urcu-tls compat with c++ compiler
- Fix typo
- fix: remove autoconf features default value in help message
- fix: add missing pkgconfig file for memb flavour lib
- Cleanup: Tests: Remove useless pre-C99 compatibility code from tap.h
- Document C99 and C++11 requirement in README.md
- Always use '__thread' for Thread local storage except on MSVC
- Fix: powerpc32: transparent unions alter calling convention
- fix: don't use C++ thread_local on MacOs
- wfcqueue API: implement overloaded wrappers with templates
- wfcqueue: combine C++ API cds_wfcq_head_cast with overloading
- wfstack C++ API: implement overloaded wrappers with templates
- lfstack C++ API: implement overloaded wrappers with templates
- wfstack: combine C++ API cds_wfs_stack_cast with overloading
- lfstack: combine C++ API cds_lfs_stack_cast with overloading
- fix: test_build tap plan
- Test C++ build of list head init
- Fix order of initializers in CDS_LIST_HEAD_INIT
- unit tests: test wfcqueue, wfstack, lfstack empty check functions in C++
- wfcqueue: implement C++ API based on function overloading
- wfstack: implement C++ API based on function overloading
- lfstack: implement C++ API based on function overloading
- Fix tap.h: remove extra semicolon in pass/fail macros
- Add C++ build tests
- Build and run regression and unit tests as C++ programs
- Add --enable-Werror configure switch
- Add `urcu_posix_assert()` as `assert()` replacement
- Rename `urcu_assert()` to `urcu_assert_debug()`
- cleanup: spelling fixes in comments
- Make temporary variable in _rcu_dereference non-const
- (tls-ie2) Fix: x86 and s390: uatomic __hp() macro C++ support
- Fix: x86 and s390: uatomic __hp() macro clang support
- Fix: x86 and s390 uatomic: __hp() macro warning with gcc 11
* Thu Feb 9 2023 laihangliang<laihangliang1@huawei.com> - 0.13.2-1
- upgrade to 0.13.2
* Mon Nov 14 2022 huajingyun<huajingyun@loongson.cn> - 0.13.0-5
- Add support loongarch
* Thu Aug 11 2022 wuzx<wuzx1226@qq.com> - 0.13.0-4 * Thu Aug 11 2022 wuzx<wuzx1226@qq.com> - 0.13.0-4
- add sw64 patch - add sw64 patch