Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
fb073912a4
!29 [sync] PR-28: add loongarch64 and sw_64 support
From: @openeuler-sync-bot 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-09-21 12:27:23 +00:00
panchenbo
229223f5c2 add loongarch64 and sw_64 support
(cherry picked from commit 011c35325e6b406896d452c209d34a4b66b25c2d)
2023-09-21 16:24:23 +08:00
openeuler-ci-bot
a540100fec
!22 update to version 1.1.2
From: @wang--ge 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2022-10-28 08:21:54 +00:00
wang--ge
5c83a214c6 update to version 1.1.2 2022-10-24 17:57:38 +08:00
openeuler-ci-bot
bc315f4868 !14 Upgrade to 1.0.0 to support OpenStack-W
From: @huangtianhua
Reviewed-by: @small_leek,@ultra_planet,@xxiaosong
Signed-off-by: @ultra_planet
2021-08-06 06:55:22 +00:00
huangtianhua
5b86068395 Upgrade to 1.0.0 2021-08-06 03:36:36 +00:00
openeuler-ci-bot
5e69b0d410 !13 回退 'Pull Request !12 : upgrade greenlet to 1.0.0'
From: @small_leek
Reviewed-by: @ultra_planet
Signed-off-by: @ultra_planet
2021-08-06 02:23:05 +00:00
small_leek
90ab899dc3 回退 'Pull Request !12 : upgrade greenlet to 1.0.0' 2021-08-06 02:00:07 +00:00
openeuler-ci-bot
a426989581 !12 upgrade greenlet to 1.0.0
From: @li-mingzhou
Reviewed-by: @huangtianhua
Signed-off-by:
2021-08-02 08:09:01 +00:00
lmz
f167fce1f3 update to 1.0.0 2021-07-31 13:46:06 +00:00
5 changed files with 151 additions and 8 deletions

Binary file not shown.

View File

@ -0,0 +1,65 @@
From 5bad26bce4675cd6b590a2e990e69ff7a6c187b5 Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Sat, 7 May 2022 14:39:18 +0800
Subject: [PATCH] add loongarch64 architecture support
---
.../platform/switch_loongarch64_linux.h | 31 +++++++++++++++++++
src/greenlet/slp_platformselect.h | 2 ++
2 files changed, 33 insertions(+)
create mode 100644 src/greenlet/platform/switch_loongarch64_linux.h
diff --git a/src/greenlet/platform/switch_loongarch64_linux.h b/src/greenlet/platform/switch_loongarch64_linux.h
new file mode 100644
index 0000000..4252561
--- /dev/null
+++ b/src/greenlet/platform/switch_loongarch64_linux.h
@@ -0,0 +1,31 @@
+#define STACK_REFPLUS 1
+
+#ifdef SLP_EVAL
+#define STACK_MAGIC 0
+
+#define REGS_TO_SAVE "s0", "s1", "s2", "s3", "s4", "s5", \
+ "s6", "s7", "s8", "fp", \
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"
+
+static int
+slp_switch(void)
+{
+ register int ret;
+ register long *stackref, stsizediff;
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ __asm__ volatile ("move %0, $sp" : "=r" (stackref) : );
+ {
+ SLP_SAVE_STATE(stackref, stsizediff);
+ __asm__ volatile (
+ "add.d $sp, $sp, %0\n\t"
+ : /* no outputs */
+ : "r" (stsizediff)
+ );
+ SLP_RESTORE_STATE();
+ }
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ __asm__ volatile ("move %0, $zero" : "=r" (ret) : );
+ return ret;
+}
+
+#endif
\ No newline at end of file
diff --git a/src/greenlet/slp_platformselect.h b/src/greenlet/slp_platformselect.h
index b5e8eb6..1766e16 100644
--- a/src/greenlet/slp_platformselect.h
+++ b/src/greenlet/slp_platformselect.h
@@ -45,6 +45,8 @@
#endif
#elif defined(__GNUC__) && defined(__mips__) && defined(__linux__)
#include "platform/switch_mips_unix.h" /* Linux/MIPS */
+#elif defined(__GNUC__) && defined(__loongarch64) && defined(__linux__)
+#include "platform/switch_loongarch64_linux.h" /* Linux/LoongArch64 */
#elif defined(__GNUC__) && defined(__aarch64__)
#include "platform/switch_aarch64_gcc.h" /* Aarch64 ABI */
#elif defined(__GNUC__) && defined(__mc68000__)
--
2.27.0

View File

@ -0,0 +1,62 @@
diff -Naur greenlet-1.0.0.org/src/greenlet/platform/switch_sw_64_unix.h greenlet-1.0.0.sw/src/greenlet/platform/switch_sw_64_unix.h
--- greenlet-1.0.0.org/src/greenlet/platform/switch_sw_64_unix.h 1970-01-01 00:00:00.000000000 +0000
+++ greenlet-1.0.0.sw/src/greenlet/platform/switch_sw_64_unix.h 2021-11-30 11:03:50.760000000 +0000
@@ -0,0 +1,30 @@
+#define STACK_REFPLUS 1
+
+#ifdef SLP_EVAL
+#define STACK_MAGIC 0
+
+#define REGS_TO_SAVE "$9", "$10", "$11", "$12", "$13", "$14", "$15", \
+ "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8", "$f9"
+
+static int
+slp_switch(void)
+{
+ register int ret;
+ register long *stackref, stsizediff;
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ __asm__ volatile ("mov $30, %0" : "=r" (stackref) : );
+ {
+ SLP_SAVE_STATE(stackref, stsizediff);
+ __asm__ volatile (
+ "addl $30, %0, $30\n\t"
+ : /* no outputs */
+ : "r" (stsizediff)
+ );
+ SLP_RESTORE_STATE();
+ }
+ __asm__ volatile ("" : : : REGS_TO_SAVE);
+ __asm__ volatile ("mov $31, %0" : "=r" (ret) : );
+ return ret;
+}
+
+#endif
diff -Naur greenlet-1.0.0.org/src/greenlet/slp_platformselect.h greenlet-1.0.0.sw/src/greenlet/slp_platformselect.h
--- greenlet-1.0.0.org/src/greenlet/slp_platformselect.h 2021-11-30 10:44:51.030000000 +0000
+++ greenlet-1.0.0.sw/src/greenlet/slp_platformselect.h 2021-11-30 10:45:39.990000000 +0000
@@ -55,4 +55,6 @@
#include "platform/switch_riscv_unix.h" /* gcc on RISC-V */
#elif defined(__GNUC__) && defined(__alpha__)
#include "platform/switch_alpha_unix.h" /* gcc on DEC Alpha */
+#elif defined(__GNUC__) && defined(__sw_64__)
+#include "platform/switch_sw_64_unix.h" /* gcc on DEC Sw_64 */
#endif
diff -Naur greenlet-1.0.0.org/src/greenlet.egg-info/SOURCES.txt greenlet-1.0.0.sw/src/greenlet.egg-info/SOURCES.txt
--- greenlet-1.0.0.org/src/greenlet.egg-info/SOURCES.txt 2021-11-30 10:44:51.030000000 +0000
+++ greenlet-1.0.0.sw/src/greenlet.egg-info/SOURCES.txt 2021-11-30 10:46:37.890000000 +0000
@@ -47,6 +47,7 @@
src/greenlet/platform/setup_switch_x64_masm.cmd
src/greenlet/platform/switch_aarch64_gcc.h
src/greenlet/platform/switch_alpha_unix.h
+src/greenlet/platform/switch_sw_64_unix.h
src/greenlet/platform/switch_amd64_unix.h
src/greenlet/platform/switch_arm32_gcc.h
src/greenlet/platform/switch_arm32_ios.h
@@ -83,4 +84,4 @@
src/greenlet/tests/test_throw.py
src/greenlet/tests/test_tracing.py
src/greenlet/tests/test_version.py
-src/greenlet/tests/test_weakref.py
\ No newline at end of file
+src/greenlet/tests/test_weakref.py

BIN
greenlet-1.1.2.tar.gz Normal file

Binary file not shown.

View File

@ -1,14 +1,12 @@
Name: python-greenlet
Version: 0.4.15
Release: 4
Version: 1.1.2
Release: 2
Summary: lightweight coroutines for in-process concurrent programming
License: Python-2.0 and MIT
URL: https://github.com/python-greenlet/greenlet
Source0: https://github.com/python-greenlet/greenlet/archive/0.4.15.tar.gz
BuildRequires: python3-devel python3-setuptools
BuildRequires: gcc-c++
Source0: https://files.pythonhosted.org/packages/0c/10/754e21b5bea89d0e73f99d60c83754df7cc64db74f47d98ab187669ce341/greenlet-1.1.2.tar.gz
Patch3000: 3000-add-loongarch64-support.patch
Patch3001: 3001-add-sw_64-support.patch
%description
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run pseudo-concurrently
@ -18,6 +16,13 @@ with data exchanges on "channels".
%package -n python3-greenlet
Summary: lightweight coroutines for in-process concurrent programming
%{?python_provide:%python_provide python3-greenlet}
BuildRequires: gcc-c++
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-cffi
%description -n python3-greenlet
The greenlet package of python 3 version.
@ -26,6 +31,8 @@ The greenlet package of python 3 version.
Summary: Development files for python3-greenlet
Requires: python3-greenlet%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-greenlet-devel}
BuildRequires: python3-devel python3-setuptools
BuildRequires: gcc-c++
%description -n python3-greenlet-devel
This package contains libraries and headier files for developing applications
@ -46,7 +53,7 @@ that use python3-greenlet.
%files -n python3-greenlet
%defattr(-,root,root)
%license LICENSE LICENSE.PSF
%doc AUTHORS NEWS README.rst
%doc AUTHORS README.rst
%{python3_sitearch}/*
%files -n python3-greenlet-devel
@ -54,6 +61,15 @@ that use python3-greenlet.
%{_includedir}/python%{python3_version}*/greenlet/
%changelog
* Sat Aug 12 2023 panchenbo <panchenbo@kylinsec.com.cn> - 1.1.2-2
- add loongarch64 and sw_64 support
* Mon Oct 24 2022 Ge Wang <wangge20@h-partners.com> - 1.1.2-1
- update to 1.1.2
* Fri Aug 6 2021 huangtianhua <huangtianhua@huawei.com> - 1.0.0-1
- update to 1.0.0
* Fri Jan 22 2021 zhangy1317 <zhangy1317@foxmail.com> -0.4.15
- update to 0.4.15