From 40b3d2ed13f4a90b891527a9ded7a72e8f5aba18 Mon Sep 17 00:00:00 2001 From: Austin English Date: Sun, 23 May 2010 21:18:17 -0500 Subject: [PATCH] ntdll: Add %gs support for FreeBSD. --- configure | 1 + configure.ac | 1 + dlls/ntdll/signal_x86_64.c | 9 ++++++++- include/config.h.in | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure b/configure index fe69a20d65d..54573a48a0d 100755 --- a/configure +++ b/configure @@ -5837,6 +5837,7 @@ for ac_header in \ machine/cpu.h \ machine/limits.h \ machine/soundcard.h \ + machine/sysarch.h \ mntent.h \ mpg123.h \ ncurses.h \ diff --git a/configure.ac b/configure.ac index 130291c7f45..4c0cdbecce4 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 341111077f6..ccea6df01e1 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -28,10 +28,15 @@ #include #include #include + #ifdef HAVE_UNISTD_H # include #endif +#ifdef HAVE_MACHINE_SYSARCH_H +# include +#endif + #ifdef HAVE_SYS_PARAM_H # include #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 diff --git a/include/config.h.in b/include/config.h.in index 0faf127db60..5d8806ddc97 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -461,6 +461,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_SOUNDCARD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACHINE_SYSARCH_H + /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACHINE_H