[Openmcl-devel] Solaris x86-64 and %gs

Gary Byers gb at clozure.com
Sat Jan 12 07:49:22 UTC 2008


I poked around a little in the OpenSolaris sources.

I think that the incantation we want to use in the #ifdef SOLARIS
case of setup_tcr_extra_segment() is something like:

#include <sys/lwp.h>
#include <sys/proc.h>

_lwp_setprivate(lwp, _LWP_GSBASE, tcr);

where lwp is a "lightweight process" and there's some correspondence
between an lwp and a pthread which would probably be clear to
anyone who's read Solaris thread documentation recently.

(Or at least more recently than I have ...)

My best guess is that we want to try to arrange that the
correspondence between pthreads and Solaris LWPs is 1:1.  I don't know
if that's the default, but I assume that there's some way to arrange
that 1:1 correspondence and that other things (reasonable behavior of
alternate signal stacks ?)  may depend on that 1:1 mapping.



More information about the Openmcl-devel mailing list