summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2005-04-14 00:02:37 +0000
committerpeter <peter@FreeBSD.org>2005-04-14 00:02:37 +0000
commit3692814aa205daa2b88af6c8f8685de9694f0140 (patch)
treefa5fdc944c961bccb59e0f9adb1cc4272c696c24 /lib/libc/i386
parentd07b2f1b2c5c80162d2d8ccae1933f11c845031c (diff)
downloadFreeBSD-src-3692814aa205daa2b88af6c8f8685de9694f0140.zip
FreeBSD-src-3692814aa205daa2b88af6c8f8685de9694f0140.tar.gz
Attempt i386_set_gsbase() before using the user_ldt code. Unimplemented
sysarch() calls return EINVAL, not SIGSYS.. so we can trivially adapt.
Diffstat (limited to 'lib/libc/i386')
-rw-r--r--lib/libc/i386/gen/_set_tp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/i386/gen/_set_tp.c b/lib/libc/i386/gen/_set_tp.c
index 2380e99..287e0f2 100644
--- a/lib/libc/i386/gen/_set_tp.c
+++ b/lib/libc/i386/gen/_set_tp.c
@@ -36,8 +36,11 @@ _set_tp(void *tp)
{
#ifndef COMPAT_32BIT
union descriptor ldt;
- int sel;
+ int error, sel;
+ error = i386_set_gsbase(tp);
+ if (error == 0)
+ return;
memset(&ldt, 0, sizeof(ldt));
ldt.sd.sd_lolimit = 0xffff; /* 4G limit */
ldt.sd.sd_lobase = ((uintptr_t)tp) & 0xffffff;
OpenPOWER on IntegriCloud