Compare commits

..

No commits in common. "fb073912a46146704f493aedbabeba58e3028dda" and "1ee9d53daa6273214a82aab176d810ec0a39c422" have entirely different histories.

5 changed files with 8 additions and 151 deletions

BIN
0.4.15.tar.gz Normal file

Binary file not shown.

View File

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

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

Binary file not shown.

View File

@ -1,12 +1,14 @@
Name: python-greenlet
Version: 1.1.2
Release: 2
Version: 0.4.15
Release: 4
Summary: lightweight coroutines for in-process concurrent programming
License: Python-2.0 and MIT
URL: https://github.com/python-greenlet/greenlet
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
Source0: https://github.com/python-greenlet/greenlet/archive/0.4.15.tar.gz
BuildRequires: python3-devel python3-setuptools
BuildRequires: gcc-c++
%description
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run pseudo-concurrently
@ -16,13 +18,6 @@ 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.
@ -31,8 +26,6 @@ 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
@ -53,7 +46,7 @@ that use python3-greenlet.
%files -n python3-greenlet
%defattr(-,root,root)
%license LICENSE LICENSE.PSF
%doc AUTHORS README.rst
%doc AUTHORS NEWS README.rst
%{python3_sitearch}/*
%files -n python3-greenlet-devel
@ -61,15 +54,6 @@ 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