Commits

Floris Bruynooghe committed 9d7501d

Add AIX patch

  • Participants
  • Parent commits 9bbb9ee

Comments (0)

Files changed (2)

+# HG changeset patch
+# Parent 1cc42128329f7131c811c777d200b8812e7f1a26
+# User Floris Bruynooghe <flub@devork.be>
+# Date 1299517314 0
+
+Port for AIX on PowerPC
+
+This removes modifying r30 by the difference of the stack size.  It
+would seem this tried to copy the frame pointer but the PowerOpen
+Environment spec does not seem to define a frame pointer.  Ang general
+purpose register (GPR) 30 is a non-volatile register so changing it
+will interfere with code lower down the stack.
+
+
+diff --git a/platform/switch_ppc_unix.h b/platform/switch_ppc_aix.h
+copy from platform/switch_ppc_unix.h
+copy to platform/switch_ppc_aix.h
+--- a/platform/switch_ppc_unix.h
++++ b/platform/switch_ppc_aix.h
+@@ -2,6 +2,12 @@
+  * this is the internal transfer function.
+  *
+  * HISTORY
++ * 07-Mar-11 Floris Bruynooghe <flub@devork.be>
++ *      Do not add stsizediff to general purpose
++ *      register (GPR) 30 as this is a non-volatile and
++ *      unused by the PowerOpen Environment, therefore
++ *      this was modifying a user register instead of the
++ *      frame pointer (which does not seem to exist).
+  * 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!
+@@ -55,7 +61,6 @@ slp_switch(void)
+         __asm__ volatile (
+             "mr 11, %0\n"
+             "add 1, 1, 11\n"
+-            "add 30, 30, 11\n"
+             : /* no outputs */
+             : "g" (stsizediff)
+             : "11"
+diff --git a/platform/switch_ppc_unix.h b/platform/switch_ppc_linux.h
+copy from platform/switch_ppc_unix.h
+copy to platform/switch_ppc_linux.h
+diff --git a/slp_platformselect.h b/slp_platformselect.h
+--- a/slp_platformselect.h
++++ b/slp_platformselect.h
+@@ -9,9 +9,11 @@
+ #elif defined(__GNUC__) && defined(__i386__)
+ #include "platform/switch_x86_unix.h" /* gcc on X86 */
+ #elif defined(__GNUC__) && defined(__PPC__) && defined(__linux__)
+-#include "platform/switch_ppc_unix.h" /* gcc on PowerPC */
++#include "platform/switch_ppc_linux.h" /* gcc on PowerPC */
+ #elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__)
+ #include "platform/switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */
++#elif defined(__GNUC__) && defined(_ARCH_PPC) && defined(_AIX)
++#include "platform/switch_ppc_aix.h" /* gcc on AIX/PowerPC */
+ #elif defined(__GNUC__) && defined(sparc) && defined(sun)
+ #include "platform/switch_sparc_sun_gcc.h" /* SunOS sparc with gcc */
+ #elif defined(__GNUC__) && defined(__s390__) && defined(__linux__)
 headers
 tests
 sparc
+ppc-aix
 # Placed by Bitbucket