summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch/i386/include/pthread_md.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/arch/i386/include/pthread_md.h')
-rw-r--r--lib/libpthread/arch/i386/include/pthread_md.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libpthread/arch/i386/include/pthread_md.h b/lib/libpthread/arch/i386/include/pthread_md.h
index 92d4275..e339391 100644
--- a/lib/libpthread/arch/i386/include/pthread_md.h
+++ b/lib/libpthread/arch/i386/include/pthread_md.h
@@ -40,6 +40,8 @@
extern int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *);
extern int _thr_getcontext(mcontext_t *);
+extern int _thr_using_setbase;
+
#define KSE_STACKSIZE 16384
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
@@ -155,8 +157,12 @@ _kcb_set(struct kcb *kcb)
#ifndef COMPAT_32BIT
int val;
- val = (kcb->kcb_ldt << 3) | 7;
- __asm __volatile("movl %0, %%gs" : : "r" (val));
+ if (_thr_using_setbase == 1) {
+ i386_set_gsbase(kcb);
+ } else {
+ val = (kcb->kcb_ldt << 3) | 7;
+ __asm __volatile("movl %0, %%gs" : : "r" (val));
+ }
#else
_amd64_set_gsbase(kcb);
#endif
OpenPOWER on IntegriCloud