Commit 24561498 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Use r2 instead of r13 for TLS, since r13 is used in the ELF32 PPC

ABI.
parent 4d54db75
......@@ -2332,7 +2332,7 @@ extern inline struct _TEB * WINAPI NtCurrentTeb(void);
extern inline struct _TEB * WINAPI NtCurrentTeb(void)
{
struct _TEB *teb;
__asm__("\tmr %0, 13" : "=r" (teb));
__asm__("\tmr %0, 2" : "=r" (teb));
return teb;
}
#else
......
......@@ -91,7 +91,7 @@ void SYSDEPS_SetCurThread( TEB *teb )
wine_set_fs( teb->teb_sel );
#elif defined(__powerpc__)
/* On PowerPC, the current TEB is in the gpr13 register */
__asm__ __volatile__("mr 13, %0" : : "r" (teb));
__asm__ __volatile__("mr 2, %0" : : "r" (teb));
#elif defined(HAVE__LWP_CREATE)
/* On non-i386 Solaris, we use the LWP private pointer */
_lwp_setprivate( teb );
......@@ -343,7 +343,7 @@ struct _TEB * WINAPI NtCurrentTeb(void)
return (struct _TEB *)_lwp_getprivate();
}
#elif defined(__powerpc__)
__ASM_GLOBAL_FUNC( NtCurrentTeb, "\n\tmr 3,13\n\tblr" );
__ASM_GLOBAL_FUNC( NtCurrentTeb, "\n\tmr 3,2\n\tblr" );
#else
# error NtCurrentTeb not defined for this architecture
#endif /* __i386__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment