From 2456149860808a2b4e899b202fbe40c24145e903 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 20 Aug 2002 00:00:35 +0000 Subject: [PATCH] Use r2 instead of r13 for TLS, since r13 is used in the ELF32 PPC ABI. --- include/winnt.h | 2 +- scheduler/sysdeps.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index dd495a4c02d..7808dbff345 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -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 diff --git a/scheduler/sysdeps.c b/scheduler/sysdeps.c index f00b4fd9f12..5101dd3a568 100644 --- a/scheduler/sysdeps.c +++ b/scheduler/sysdeps.c @@ -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__ */