SYSDEPS_SwitchToThreadStack on PowerPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I finally fix the
err:seh:EXC_DefaultHandling Exception frame is not in stack limits => unable to dispatch exception
Error on the PowerPC. It was because SYSDEPS_SwitchToThreadStack wasn't defined properly on the PowerPC for Darwin and Linux. Here is a patch which works on darwin. On the LinuxPPC side, it should work if the calling convention are the same.
( Marcus you probably should have a look, to make sure it works on LinuxPPC, thanks ;) )


Thanks,

Pierre.

ChangeLog:
- Add support for the PowerPC in SYSDEPS_SwitchToThreadStack

Attachment: patchsysdep.diff.txt
Description: application/applefile

Index: dlls/ntdll/sysdeps.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/sysdeps.c,v
retrieving revision 1.3
diff -u -r1.3 sysdeps.c
--- dlls/ntdll/sysdeps.c	16 Jul 2003 23:29:14 -0000	1.3
+++ dlls/ntdll/sysdeps.c	22 Jul 2003 17:03:37 -0000
@@ -240,7 +240,27 @@
                    "call %l0, 0\n\t" /* call func */
                    "mov %l1, %o0\n\t" /* delay slot:  arg for func */
                    "ta 0x01\n\t"); /* breakpoint - we never get here */
-#else /* !sparc, !i386 */
+#elif defined(__powerpc__) && defined(__APPLE__)
+/* Darwin SYSDEPS_SwitchToThreadStack
+ Function Pointer to call is on r3, Args to pass on r4 and stack on r1 */
+__ASM_GLOBAL_FUNC( SYSDEPS_SwitchToThreadStack,
+                   "stw r1, 0x4(r13)\n\t" /* teb->stack_top */
+                   "mr r12,r3\n\t"
+                   "mtctr r12\n\t" /* func->ctr */
+                   "mr r3,r4\n\t" /* args->function param 1 (r3) */
+                   "bctr\n\t" /* call ctr */
+                   "b _SYSDEPS_SwitchToThreadStack+24\n\t"); /* loop */
+#elif defined(__powerpc__) && defined(__GNUC__)
+/* Linux SYSDEPS_SwitchToThreadStack
+ Function Pointer to call is on r3, Args to pass on r4 and stack on r1 */
+__ASM_GLOBAL_FUNC( SYSDEPS_SwitchToThreadStack,
+                   "stw 1, 0x4(13)\n\t" /* teb->stack_top */
+                   "mr 12,3\n\t"
+                   "mtctr 12\n\t" /* func->ctr */
+                   "mr 3,4\n\t" /* args->function param 1 (r3) */
+                   "bctr\n\t" /* call ctr */
+                   "b _SYSDEPS_SwitchToThreadStack+24\n\t"); /* loop */
+#else  /* !powerpc, !sparc, !i386 */
 void SYSDEPS_SwitchToThreadStack( void (*func)(void *), void *arg )
 {
     func( arg );

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux