Tijl Coosemans : libwine: Use GDT entry for %fs segment on FreeBSD.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 27 06:07:44 CDT 2007


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

Author: Tijl Coosemans <tijl at ulyssis.org>
Date:   Sat Aug 25 17:46:32 2007 +0200

libwine: Use GDT entry for %fs segment on FreeBSD.

---

 libs/wine/ldt.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libs/wine/ldt.c b/libs/wine/ldt.c
index ceb8db4..e05a962 100644
--- a/libs/wine/ldt.c
+++ b/libs/wine/ldt.c
@@ -112,9 +112,7 @@ static inline int set_thread_area( struct modify_ldt_s *ptr )
 
 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <machine/segments.h>
-
-extern int i386_get_ldt(int, union descriptor *, int);
-extern int i386_set_ldt(int, union descriptor *, int);
+#include <machine/sysarch.h>
 #endif  /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ */
 
 #ifdef __APPLE__
@@ -417,6 +415,8 @@ unsigned short wine_ldt_alloc_fs(void)
             if (errno != ENOSYS) perror( "set_thread_area" );
         }
         else global_fs_sel = (ldt_info.entry_number << 3) | 3;
+#elif defined(__FreeBSD__)
+        global_fs_sel = GSEL( GUFS_SEL, SEL_UPL );
 #endif
     }
     if (global_fs_sel > 0) return global_fs_sel;
@@ -443,6 +443,8 @@ void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry )
         ldt_info.entry_number = sel >> 3;
         fill_modify_ldt_struct( &ldt_info, entry );
         if ((ret = set_thread_area( &ldt_info ) < 0)) perror( "set_thread_area" );
+#elif defined(__FreeBSD__)
+        i386_set_fsbase( wine_ldt_get_base( entry ));
 #endif
     }
     else  /* LDT selector */




More information about the wine-cvs mailing list