[py-svn] r17324 - py/dist/py/c-extension/greenlet

arigo at codespeak.net arigo at codespeak.net
Wed Sep 7 14:42:23 CEST 2005


Author: arigo
Date: Wed Sep  7 14:42:22 2005
New Revision: 17324

Modified:
   py/dist/py/c-extension/greenlet/switch_ppc_macosx.h
   py/dist/py/c-extension/greenlet/switch_ppc_unix.h
   py/dist/py/c-extension/greenlet/switch_x86_unix.h
Log:
Removed r31 in the ppc files as well, and added big fat warnings.
(The problem here is that if you try to compile these statically,
e.g. use them back in Stackless, then it's likely to almost work
if you are lucky but possibly crash mysteriously sometimes...
Hence the big fat warnings.)

Still looking for a solution that would detect by itself if these extra
registers must be mentioned or not...



Modified: py/dist/py/c-extension/greenlet/switch_ppc_macosx.h
==============================================================================
--- py/dist/py/c-extension/greenlet/switch_ppc_macosx.h	(original)
+++ py/dist/py/c-extension/greenlet/switch_ppc_macosx.h	Wed Sep  7 14:42:22 2005
@@ -2,6 +2,10 @@
  * this is the internal transfer function.
  *
  * HISTORY
+ * 07-Sep-05 (py-dev mailing list discussion)
+ *      removed 'r31' from the register-saved.  !!!! WARNING !!!!
+ *      It means that this file can no longer be compiled statically!
+ *      It is now only suitable as part of a dynamic library!
  * 14-Jan-04  Bob Ippolito <bob at redivi.com>
  *      added cr2-cr4 to the registers to be saved.
  *      Open questions: Should we save FP registers?
@@ -32,8 +36,11 @@
 
 #define STACK_MAGIC 3
 
+/* !!!!WARNING!!!! need to add "r31" in the next line if this header file
+ * is meant to be compiled non-dynamically!
+ */
 #define REGS_TO_SAVE "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", \
-       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r31", \
+       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \
        "cr2", "cr3", "cr4"
 
 static int

Modified: py/dist/py/c-extension/greenlet/switch_ppc_unix.h
==============================================================================
--- py/dist/py/c-extension/greenlet/switch_ppc_unix.h	(original)
+++ py/dist/py/c-extension/greenlet/switch_ppc_unix.h	Wed Sep  7 14:42:22 2005
@@ -2,6 +2,10 @@
  * this is the internal transfer function.
  *
  * HISTORY
+ * 07-Sep-05 (py-dev mailing list discussion)
+ *      removed 'r31' from the register-saved.  !!!! WARNING !!!!
+ *      It means that this file can no longer be compiled statically!
+ *      It is now only suitable as part of a dynamic library!
  * 14-Jan-04  Bob Ippolito <bob at redivi.com>
  *      added cr2-cr4 to the registers to be saved.
  *      Open questions: Should we save FP registers?
@@ -34,8 +38,11 @@
 
 #define STACK_MAGIC 3
 
+/* !!!!WARNING!!!! need to add "r31" in the next line if this header file
+ * is meant to be compiled non-dynamically!
+ */
 #define REGS_TO_SAVE "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", \
-       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r31", \
+       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \
        "cr2", "cr3", "cr4"
 static int
 slp_switch(void)

Modified: py/dist/py/c-extension/greenlet/switch_x86_unix.h
==============================================================================
--- py/dist/py/c-extension/greenlet/switch_x86_unix.h	(original)
+++ py/dist/py/c-extension/greenlet/switch_x86_unix.h	Wed Sep  7 14:42:22 2005
@@ -2,6 +2,10 @@
  * this is the internal transfer function.
  *
  * HISTORY
+ * 07-Sep-05 (py-dev mailing list discussion)
+ *      removed 'ebx' from the register-saved.  !!!! WARNING !!!!
+ *      It means that this file can no longer be compiled statically!
+ *      It is now only suitable as part of a dynamic library!
  * 24-Nov-02  Christian Tismer  <tismer at tismer.com>
  *      needed to add another magic constant to insure
  *      that f in slp_eval_frame(PyFrameObject *f)
@@ -31,6 +35,10 @@
 slp_switch(void)
 {
     register int *stackref, stsizediff;
+    /* !!!!WARNING!!!! need to add "ebx" in the next line, as well as in the
+     * last line of this function, if this header file is meant to be compiled
+     * non-dynamically!
+     */
     __asm__ volatile ("" : : : "esi", "edi");
     __asm__ ("movl %%esp, %0" : "=g" (stackref));
     {



More information about the pytest-commit mailing list