[Stackless] New 3 platforms for Stackless Python
Hye-Shik Chang
perky at fallin.lv
Mon Mar 4 20:27:53 CET 2002
Hello!
I found new 3 platforms for Stackless. :)
This two platforms was OK without any patch:
================
NetBSD on i386
================
Python 2.2 Stackless(HW) 020301 (#1, Mar 2 2002, 19:25:33)
[GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on netbsd1
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> os.name, sys.platform, sys.byteorder
('posix', 'netbsd1', 'little')
=================
OpenBSD on i386
=================
Python 2.2 Stackless(HW) 020301 (#1, Mar 2 2002, 19:42:18)
[GCC 2.95.3 20010125 (prerelease)] on openbsd3
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> os.name, sys.platform, sys.version
('posix', 'openbsd3', '2.2 Stackless(HW) 020301 (#1, Mar 2 2002, 19:42:18) \n[GCC 2.95.3 20010125
(prerelease)]')
I've ported one file for this architecture:
====================
MacOS X on PowerPC
====================
Python 2.2 Stackless(HW) 020303 (#1, Mar 5 2002, 03:54:02)
[GCC 2.95.2 19991024 (release)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> os.name, sys.platform, sys.byteorder
('posix', 'darwin', 'big')
The patch for MacOS X on PowerPC is attached.
Please review my dirty quick hack. :)
--
Hye-Shik
-------------- next part --------------
diff -ruN Stackless.orig/stackless.h Stackless/stackless.h
--- Stackless.orig/stackless.h Tue Mar 5 04:18:22 2002
+++ Stackless/stackless.h Tue Mar 5 03:41:22 2002
@@ -43,6 +43,7 @@
#if defined(MS_WIN32)
#elif defined(__GNUC__) && defined(__i386__)
+#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__)
/* add more platforms this way */
#else
/* no supported platform */
diff -ruN Stackless.orig/stacklesseval.h Stackless/stacklesseval.h
--- Stackless.orig/stacklesseval.h Sat Mar 2 03:11:36 2002
+++ Stackless/stacklesseval.h Tue Mar 5 03:41:42 2002
@@ -435,6 +435,8 @@
#include "switch_MS_WIN32.h"
#elif defined(__GNUC__) && defined(__i386__)
#include "switch_x86_unix.h"
+#elif defined(__APPLE__) && defined(__ppc__) && defined(__GNUC__)
+#include "switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */
#endif
diff -ruN Stackless.orig/switch_ppc_macosx.h Stackless/switch_ppc_macosx.h
--- Stackless.orig/switch_ppc_macosx.h Thu Jan 1 09:00:00 1970
+++ Stackless/switch_ppc_macosx.h Tue Mar 5 03:49:24 2002
@@ -0,0 +1,26 @@
+/*
+ * this is the internal transfer function.
+ *
+ * HISTORY
+ * 04-Mar-02 Hye-Shik Chang <perky at fallin.lv>
+ * Ported from i386.
+ */
+
+#include <stdio.h>
+
+static int
+slp_switch(void)
+{
+ register int *stackref, stsizediff;
+ __asm__ ("mr %0, r1" : "=g" (stackref) : );
+ SLP_SAVE_STATE(stackref, stsizediff);
+ __asm__ ("
+ mr r11, %0
+ add r1, r1, r11
+ add r30, r30, r11"
+ : /* no outputs */
+ : "g" (stsizediff)
+ : "r11"
+ );
+ SLP_RESTORE_STATE();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <http://www.stackless.com/pipermail/stackless/attachments/20020305/d5cca0f0/attachment.pgp>
More information about the Stackless
mailing list