Alexandre Julliard : loader/kthread: Remove some unneeded #ifdefs, other platforms use pthread now.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 15 06:43:06 CDT 2006


Module: wine
Branch: master
Commit: dd0340ef0a0cfd2d80f0f82081425d29bd00a5e4
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=dd0340ef0a0cfd2d80f0f82081425d29bd00a5e4

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Aug 15 12:57:25 2006 +0200

loader/kthread: Remove some unneeded #ifdefs, other platforms use pthread now.

---

 configure           |    4 ---
 configure.ac        |    2 --
 include/config.h.in |    6 -----
 loader/kthread.c    |   64 ---------------------------------------------------
 4 files changed, 0 insertions(+), 76 deletions(-)

diff --git a/configure b/configure
index fda6389..b8d6b8b 100755
--- a/configure
+++ b/configure
@@ -18346,11 +18346,7 @@ fi
 
 
 
-
-
 for ac_func in \
-	_lwp_create \
-	_lwp_self \
 	_pclose \
 	_popen \
 	_snprintf \
diff --git a/configure.ac b/configure.ac
index 951c553..8d89e0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1239,8 +1239,6 @@ fi
 dnl **** Check for functions ****
 
 AC_CHECK_FUNCS(\
-	_lwp_create \
-	_lwp_self \
 	_pclose \
 	_popen \
 	_snprintf \
diff --git a/include/config.h.in b/include/config.h.in
index ee42eeb..3a09075 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -932,12 +932,6 @@ #undef HAVE_XMLREADMEMORY
 /* Define if Xrender has the XRenderSetPictureTransform function */
 #undef HAVE_XRENDERSETPICTURETRANSFORM
 
-/* Define to 1 if you have the `_lwp_create' function. */
-#undef HAVE__LWP_CREATE
-
-/* Define to 1 if you have the `_lwp_self' function. */
-#undef HAVE__LWP_SELF
-
 /* Define to 1 if you have the `_pclose' function. */
 #undef HAVE__PCLOSE
 
diff --git a/loader/kthread.c b/loader/kthread.c
index 577311b..9c3e0ed 100644
--- a/loader/kthread.c
+++ b/loader/kthread.c
@@ -58,12 +58,6 @@ #endif
 #ifdef HAVE_SYS_SYSCALL_H
 # include <sys/syscall.h>
 #endif
-#ifdef HAVE_SYS_LWP_H
-# include <sys/lwp.h>
-#endif
-#ifdef HAVE_UCONTEXT_H
-# include <ucontext.h>
-#endif
 #ifdef HAVE_SCHED_H
 #include <sched.h>
 #endif
@@ -192,9 +186,6 @@ static void cleanup_thread( void *ptr )
     wine_ldt_free_fs( info.teb_sel );
     if (info.stack_size) munmap( info.stack_base, info.stack_size );
     if (info.teb_size) munmap( info.teb_base, info.teb_size );
-#ifdef HAVE__LWP_CREATE
-    _lwp_exit();
-#endif
     _exit( info.exit_status );
 }
 
@@ -276,15 +267,6 @@ #elif defined(HAVE_RFORK)
             : "eax", "edx");
         return 0;
     }
-#elif defined(HAVE__LWP_CREATE)
-    {
-        ucontext_t context;
-        _lwp_makecontext( &context, (void(*)(void *))info->entry, info,
-                          NULL, info->stack_base, info->stack_size );
-        if ( _lwp_create( &context, 0, NULL ) )
-            return -1;
-        return 0;
-    }
 #endif
     return -1;
 }
@@ -297,7 +279,6 @@ #endif
  */
 static void init_current_teb( struct wine_pthread_thread_info *info )
 {
-#ifdef __i386__
     /* On the i386, the current thread is in the %fs register */
     LDT_ENTRY fs_entry;
 
@@ -305,30 +286,10 @@ #ifdef __i386__
     wine_ldt_set_limit( &fs_entry, info->teb_size - 1 );
     wine_ldt_set_flags( &fs_entry, WINE_LDT_FLAGS_DATA|WINE_LDT_FLAGS_32BIT );
     wine_ldt_init_fs( info->teb_sel, &fs_entry );
-#elif defined(HAVE__LWP_CREATE)
-    /* On non-i386 Solaris, we use the LWP private pointer */
-    _lwp_setprivate( info->teb_base );
-#elif defined(__powerpc__)
-    /* On PowerPC, the current TEB is in the gpr13 register */
-# ifdef __APPLE__
-    __asm__ __volatile__("mr r13, %0" : : "r" (info->teb_base));
-# else
-    __asm__ __volatile__("mr 2, %0" : : "r" (info->teb_base));
-# endif
-#elif defined(__ALPHA__)
-    /* FIXME: On Alpha, the current TEB is not accessible to user-space */
-/*    __asm__ __volatile__();*/
-#else
-# error You must implement init_current_teb for your platform
-#endif
 
     /* set pid and tid */
     info->pid = getpid();
-#ifdef HAVE__LWP_SELF
-    info->tid = _lwp_self();
-#else
     info->tid = -1;
-#endif
 }
 
 
@@ -338,29 +299,7 @@ #endif
 static void *get_current_teb(void)
 {
     void *ret;
-
-#ifdef __i386__
     __asm__( ".byte 0x64\n\tmovl 0x18,%0" : "=r" (ret) );
-#elif defined(HAVE__LWP_CREATE)
-    ret = _lwp_getprivate();
-#elif defined(__powerpc__)
-# ifdef __APPLE__
-    __asm__( "mr %0,r13" : "=r" (ret) );
-# else
-    __asm__( "mr %0,2" : "=r" (ret) );
-# endif
-#elif defined(__ALPHA__)
-    /* 0x00ab is the PAL opcode for rdteb */
-    __asm__( "lda $30,8($30)\n\t"
-             "stq $0,0($30)\n\t"
-             "call_pal 0x00ab\n\t"
-             "mov $0,%0\n\t"
-             "ldq $0,0($30)\n\t"
-             "lda $30,-8($30)" : "=r" (ret) );
-#else
-# error get_current_teb not defined for this architecture
-#endif  /* __i386__ */
-
     return ret;
 }
 
@@ -379,9 +318,6 @@ static void DECLSPEC_NORETURN exit_threa
  */
 static void DECLSPEC_NORETURN abort_thread( long status )
 {
-#ifdef HAVE__LWP_CREATE
-    _lwp_exit();
-#endif
     _exit( status );
 }
 




More information about the wine-cvs mailing list