ntdll: add %gs support for FreeBSD

Austin English austinenglish at gmail.com
Sun May 23 21:18:17 CDT 2010


Documented here:
http://fxr.googlebit.com/source/lib/libc/amd64/sys/amd64_set_gsbase.c

diff --git a/configure.ac b/configure.ac
index 130291c..4c0cdbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -422,6 +422,7 @@ AC_CHECK_HEADERS(\
 	machine/cpu.h \
 	machine/limits.h \
 	machine/soundcard.h \
+	machine/sysarch.h \
 	mntent.h \
 	mpg123.h \
 	ncurses.h \
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 3411110..ccea6df 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -28,10 +28,15 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif

+#ifdef HAVE_MACHINE_SYSARCH_H
+# include <machine/sysarch.h>
+#endif
+
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
@@ -2288,8 +2293,10 @@ void signal_init_thread( TEB *teb )
 {
     stack_t ss;

-#ifdef __linux__
+#if defined __linux__
     arch_prctl( ARCH_SET_GS, teb );
+#elif defined __FreeBSD__
+    amd64_set_gsbase( teb );
 #else
 # error Please define setting %gs for your architecture
 #endif
-- 
1.7.0.4



More information about the wine-patches mailing list