Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2372
Modified Files:
Tag: lutex-branch
thread.h
Log Message:
0.9.12.26.lutex-branch.34
* adding an #ifdef LISP_FEATURE_RESTORE_SEGMENT_REGISTER_FROM_TLS
bit to restore %fs from pthread_getspecific(specials)
Index: thread.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/thread.h,v
retrieving revision 1.24.4.1
retrieving revision 1.24.4.2
diff -u -d -r1.24.4.1 -r1.24.4.2
--- thread.h 26 Mar 2006 18:51:47 -0000 1.24.4.1
+++ thread.h 16 May 2006 16:30:26 -0000 1.24.4.2
@@ -113,9 +113,18 @@
#if defined(LISP_FEATURE_SB_THREAD)
#if defined(LISP_FEATURE_X86)
register struct thread *me=0;
- if(all_threads)
+ if(all_threads) {
+#if defined(LISP_FEATURE_DARWIN) && defined(LISP_FEATURE_RESTORE_SEGMENT_REGISTER_FROM_TLS)
+ sel_t sel;
+ struct thread *th = pthread_getspecific(specials);
+ sel.index = th->tls_cookie;
+ sel.rpl = USER_PRIV;
+ sel.ti = SEL_LDT;
+ __asm__ __volatile__ ("movw %w0, %%fs" : : "r"(sel));
+#endif
__asm__ __volatile__ ("movl %%fs:%c1,%0" : "=r" (me)
: "i" (offsetof (struct thread,this)));
+ }
return me;
#else
return pthread_getspecific(specials);
|