libs/wine: add missing checks for FreeBSD_kernel (1/5)

Austin English austinenglish at gmail.com
Sat Jan 15 17:52:50 CST 2011


Needed for Debian/kFreeBSD. Tested on kFreeBSD and PC-BSD 7.1.

This patch series fixes http://bugs.winehq.org/show_bug.cgi?id=20314

-- 
-Austin
-------------- next part --------------
diff --git a/libs/wine/ldt.c b/libs/wine/ldt.c
index c4dcb0e..3098061 100644
--- a/libs/wine/ldt.c
+++ b/libs/wine/ldt.c
@@ -412,7 +412,7 @@ 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__)
+#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
         i386_set_fsbase( wine_ldt_get_base( entry ));
 #endif
     }
diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c
index f0665b1..0e02d16 100644
--- a/libs/wine/mmap.c
+++ b/libs/wine/mmap.c
@@ -372,7 +372,7 @@ void mmap_init(void)
         char *base = stack_ptr - ((unsigned int)stack_ptr & granularity_mask) - (granularity_mask + 1);
         if (base > user_space_limit) reserve_area( user_space_limit, base );
         base = stack_ptr - ((unsigned int)stack_ptr & granularity_mask) + (granularity_mask + 1);
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
         /* Heuristic: assume the stack is near the end of the address */
         /* space, this avoids a lot of futile allocation attempts */
         end = (char *)(((unsigned long)base + 0x0fffffff) & 0xf0000000);


More information about the wine-patches mailing list