Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
64c7532575
!35 [sync] PR-33: add loongarch64 support.
From: @openeuler-sync-bot 
Reviewed-by: @SuperSix173 
Signed-off-by: @SuperSix173
2022-12-16 06:20:05 +00:00
Jingyun Hua
d564550acc Add support loongarch
Signed-off-by: Jingyun Hua <huajingyun@loongson.cn>
(cherry picked from commit b54ea5a085aa10a1f19bcdab8195e3e000add0d5)
2022-12-16 12:05:07 +08:00
openeuler-ci-bot
585352a820
!31 添加sw架构
From: @wuzx065891 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-08-16 00:24:10 +00:00
wzx
51be3aa037 add sw architecture
Signed-off-by: wzx <wuzx1226@qq.com>
2022-08-15 10:37:54 +08:00
openeuler-ci-bot
fbd97b6616
!28 添加sw架构
From: @wuzx065891 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-08-11 11:03:38 +00:00
wzx
d2000b5c28 e2fsprogs add sw
Signed-off-by: wzx <wuzx1226@qq.com>
2022-08-10 09:54:22 +08:00
openeuler-ci-bot
c6c98b2faf
!23 【轻量级PR】修正changelog中的错误日期
From: @konglidong 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-06-20 01:09:49 +00:00
konglidong
9404995135 modify bad date in changelog 2022-06-16 09:51:35 +08:00
openeuler-ci-bot
7c02f3902b
!20 [sync] PR-19: delete old so file
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-04-01 11:07:50 +00:00
zhouwenpei
3d1f884b94 delete old so file
(cherry picked from commit 8e84239bd7b341095267278666c5cd56763cf8ff)
2022-04-01 14:09:01 +08:00
3 changed files with 341 additions and 6 deletions

157
add-loongarch.patch Normal file
View File

@ -0,0 +1,157 @@
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

166
userspace-rcu-0.13.0-sw.patch Executable file
View File

@ -0,0 +1,166 @@
diff -Naur userspace-rcu-0.13.0.org/LICENSE userspace-rcu-0.13.0.sw/LICENSE
--- userspace-rcu-0.13.0.org/LICENSE 2022-02-26 01:43:47.240000000 +0000
+++ userspace-rcu-0.13.0.sw/LICENSE 2022-02-26 01:46:41.140000000 +0000
@@ -44,6 +44,7 @@
compiler.h
arch/s390.h
uatomic/alpha.h
+uatomic/sw_64.h
uatomic/mips.h
uatomic/nios2.h
uatomic/s390.h
diff -Naur userspace-rcu-0.13.0.org/include/Makefile.am userspace-rcu-0.13.0.sw/include/Makefile.am
--- userspace-rcu-0.13.0.org/include/Makefile.am 2022-02-26 01:43:47.240000000 +0000
+++ userspace-rcu-0.13.0.sw/include/Makefile.am 2022-02-26 01:44:36.980000000 +0000
@@ -1,6 +1,7 @@
nobase_include_HEADERS = \
urcu/arch/aarch64.h \
urcu/arch/alpha.h \
+ urcu/arch/sw_64.h \
urcu/arch/arm.h \
urcu/arch/gcc.h \
urcu/arch/generic.h \
@@ -60,6 +61,7 @@
urcu/tls-compat.h \
urcu/uatomic/aarch64.h \
urcu/uatomic/alpha.h \
+ urcu/uatomic/sw_64.h \
urcu/uatomic_arch.h \
urcu/uatomic/arm.h \
urcu/uatomic/gcc.h \
diff -Naur userspace-rcu-0.13.0.org/include/Makefile.in userspace-rcu-0.13.0.sw/include/Makefile.in
--- userspace-rcu-0.13.0.org/include/Makefile.in 2022-02-26 01:43:47.250000000 +0000
+++ userspace-rcu-0.13.0.sw/include/Makefile.in 2022-02-26 01:44:17.140000000 +0000
@@ -318,6 +318,7 @@
nobase_include_HEADERS = \
urcu/arch/aarch64.h \
urcu/arch/alpha.h \
+ urcu/arch/sw_64.h \
urcu/arch/arm.h \
urcu/arch/gcc.h \
urcu/arch/generic.h \
@@ -377,6 +378,7 @@
urcu/tls-compat.h \
urcu/uatomic/aarch64.h \
urcu/uatomic/alpha.h \
+ urcu/uatomic/sw_64.h \
urcu/uatomic_arch.h \
urcu/uatomic/arm.h \
urcu/uatomic/gcc.h \
diff -Naur userspace-rcu-0.13.0.org/include/urcu/arch/sw_64.h userspace-rcu-0.13.0.sw/include/urcu/arch/sw_64.h
--- userspace-rcu-0.13.0.org/include/urcu/arch/sw_64.h 1970-01-01 00:00:00.000000000 +0000
+++ userspace-rcu-0.13.0.sw/include/urcu/arch/sw_64.h 2022-02-26 01:49:14.100000000 +0000
@@ -0,0 +1,42 @@
+#ifndef _URCU_ARCH_SW_64_H
+#define _URCU_ARCH_SW_64_H
+
+/*
+ * arch_sw_64.h: trivial definitions for the Sw_64 architecture.
+ *
+ * Copyright (c) 2010 Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * 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
+
+#define cmm_mb() __asm__ __volatile__ ("memb":::"memory")
+#define cmm_wmb() __asm__ __volatile__ ("memb":::"memory")
+#define cmm_read_barrier_depends() __asm__ __volatile__ ("memb":::"memory")
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/arch/generic.h>
+
+#endif /* _URCU_ARCH_SW_64_H */
diff -Naur userspace-rcu-0.13.0.org/include/urcu/arch.h userspace-rcu-0.13.0.sw/include/urcu/arch.h
--- userspace-rcu-0.13.0.org/include/urcu/arch.h 2022-02-26 01:43:47.250000000 +0000
+++ userspace-rcu-0.13.0.sw/include/urcu/arch.h 2022-02-26 01:46:28.100000000 +0000
@@ -39,6 +39,7 @@
* URCU_ARCH_SPARC64 : All Sun SPARC variants
*
* URCU_ARCH_ALPHA : All DEC Alpha variants
+ * URCU_ARCH_SW_64 : All DEC Sw_64 variants
* URCU_ARCH_IA64 : All Intel Itanium variants
* URCU_ARCH_ARM : All ARM 32 bits variants
* URCU_ARCH_ARMV7 : All ARMv7 ISA variants
@@ -101,6 +102,11 @@
#define URCU_ARCH_ALPHA 1
#include <urcu/arch/alpha.h>
+#elif (defined(__sw_64__) || defined(__sw_64))
+
+#define URCU_ARCH_SW_64 1
+#include <urcu/arch/sw_64.h>
+
#elif (defined(__ia64__) || defined(__ia64))
#define URCU_ARCH_IA64 1
diff -Naur userspace-rcu-0.13.0.org/include/urcu/uatomic/sw_64.h userspace-rcu-0.13.0.sw/include/urcu/uatomic/sw_64.h
--- userspace-rcu-0.13.0.org/include/urcu/uatomic/sw_64.h 1970-01-01 00:00:00.000000000 +0000
+++ userspace-rcu-0.13.0.sw/include/urcu/uatomic/sw_64.h 2022-02-26 01:47:48.170000000 +0000
@@ -0,0 +1,32 @@
+#ifndef _URCU_UATOMIC_ARCH_SW_64_H
+#define _URCU_UATOMIC_ARCH_SW_64_H
+
+/*
+ * Atomic exchange operations for the Sw_64 architecture. Let GCC do it.
+ *
+ * Copyright (c) 2010 Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * 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.
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+#include <urcu/uatomic/generic.h>
+
+#endif /* _URCU_UATOMIC_ARCH_SW_64_H */
diff -Naur userspace-rcu-0.13.0.org/include/urcu/uatomic.h userspace-rcu-0.13.0.sw/include/urcu/uatomic.h
--- userspace-rcu-0.13.0.org/include/urcu/uatomic.h 2022-02-26 01:43:47.250000000 +0000
+++ userspace-rcu-0.13.0.sw/include/urcu/uatomic.h 2022-02-26 01:52:01.610000000 +0000
@@ -31,6 +31,8 @@
#include <urcu/uatomic/s390.h>
#elif defined(URCU_ARCH_SPARC64)
#include <urcu/uatomic/sparc64.h>
+#elif defined(URCU_ARCH_SW_64)
+#include <urcu/uatomic/sw_64.h>
#elif defined(URCU_ARCH_ALPHA)
#include <urcu/uatomic/alpha.h>
#elif defined(URCU_ARCH_IA64)

View File

@ -1,12 +1,16 @@
Name: userspace-rcu
Version: 0.13.0
Release: 2
Release: 5
Summary: Userspace read-copy-update library
License: LGPLv2+
URL: http://liburcu.org
Source0: http://lttng.org/files/urcu/%{name}-%{version}.tar.bz2
Patch1: userspace-rcu-0.13.0-sw.patch
BuildRequires: pkgconfig perl-Test-Harness autoconf automake libtool userspace-rcu-devel
%ifarch loongarch64
Patch0000: add-loongarch.patch
%endif
BuildRequires: pkgconfig perl-Test-Harness autoconf automake libtool
%description
liburcu is a LGPLv2.1 userspace RCU (read-copy-update) library. This data
@ -36,7 +40,6 @@ make %{?_smp_mflags} V=1
%install
%make_install
cp -a %{_libdir}/liburcu*.so.6* %{buildroot}%{_libdir}
%check
make check
@ -66,16 +69,25 @@ make check
%changelog
* 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
- add sw64 patch
* Fri Apr 01 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 0.13.0-3
- delete old so file
* Mon Dec 13 2021 zhouwenpei <zhouwenpei1@huawei.com> - 0.13.0-2
- fix build error
* Mon Nov 29 2021 zhouwenpei <zhouwenpei1@huawei.com> - 0.13.0-1
- upgrade to 0.13.0
* Thu Jul 21 2020 jinzhimin <jinzhimin2@huawei.com> - 0.12.1-1
* Tue Jul 21 2020 jinzhimin <jinzhimin2@huawei.com> - 0.12.1-1
- upgrade to 0.12.1
* Thu Jun 29 2020 xinghe <xinghe1@huawei.com> - 0.10.1-10
* Mon Jun 29 2020 xinghe <xinghe1@huawei.com> - 0.10.1-10
- Type:bugfix
- ID:NA
- SUG:restart
@ -87,7 +99,7 @@ make check
- SUG:restart
- DESC: Shield regtest
* Thu Jun 24 2020 xinghe <xinghe1@huawei.com> - 0.10.1-8
* Wed Jun 24 2020 xinghe <xinghe1@huawei.com> - 0.10.1-8
- Type:bugfix
- ID:NA
- SUG:restart