X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-bsd-os.c;h=d493800f36f675089ba2296cd6aa96f1871f957e;hb=9a19ce460a70a6c1de36095b3e2621116b91cc80;hp=00a7ca67d09e1a3fb152ee9a74c413be319318ba;hpb=134fa6b3f7c5f4bb0652e74227d940a9e7a83563;p=sbcl.git diff --git a/src/runtime/x86-bsd-os.c b/src/runtime/x86-bsd-os.c index 00a7ca6..d493800 100644 --- a/src/runtime/x86-bsd-os.c +++ b/src/runtime/x86-bsd-os.c @@ -169,8 +169,12 @@ int arch_os_thread_init(struct thread *thread) { load_fs(sel); thread->tls_cookie=n; +#ifdef LISP_FEATURE_GCC_TLS + current_thread = thread; +#else pthread_setspecific(specials,thread); #endif +#endif #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK stack_t sigstack; @@ -207,6 +211,14 @@ int arch_os_thread_cleanup(struct thread *thread) { #endif /* !LISP_FEATURE_DARWIN */ #if defined(LISP_FEATURE_FREEBSD) +#if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT) +void +os_restore_tls_segment_register(os_context_t *context) +{ + load_fs(context->uc_mcontext.mc_fs); +} +#endif + void os_restore_fp_control(os_context_t *context) { @@ -217,5 +229,11 @@ os_restore_fp_control(os_context_t *context) struct envxmm *ex = (struct envxmm*)(&context->uc_mcontext.mc_fpstate); asm ("fldcw %0" : : "m" (ex->en_cw)); #endif +#if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT) + /* Calling this function here may not be good idea. Or rename + * function name os_restore_fp_control to os_restore_context or + * so, to match the behavior? */ + os_restore_tls_segment_register(context); +#endif } #endif