Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2001 13:12:05 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        John Polstra <jdp@polstra.com>
Cc:        current@freebsd.org
Subject:   Re: Rfork'd threads, signals, and LDTs
Message-ID:  <Pine.SUN.3.91.1010507130624.20611A@pcnet1.pcnet.com>
In-Reply-To: <200105071647.f47GlgQ64138@vashon.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 7 May 2001, John Polstra wrote:
> In article
> <Pine.SUN.3.91.1010507073832.26371A-100000@pcnet1.pcnet.com>, Daniel
> Eischen <eischen@vigrid.com> wrote:
> 
> > I think the only reason we used %fs instead of %gs was WINE.  I
> > think Linux uses %gs for TSD, so if WINE were to ever depend on
> > linuxthreads, one of them would have to change.
> 
> At least on Red Hat 7.0 (glibc-2.1.92-14), Linux does not use a
> segment register to find TSD.  It aligns all stacks at a multpile
> of 2MB and then does bit ops on the current stack pointer to find a
> thread control block at the base (highest address) of the stack.
> 
> There is an alternate implementation in that version of glibc which
> uses %gs to find TSD.  However, it is not used in this version of
> Linux.  I don't know whether it's used in other versions or not.

I was looking at our linuxthreads port and noticed some %gs
fiddling.  If linuxthreads wants to allow POSIX semantics for
specifying thread stack allocation, they'll have to stop relying
on stack alignments for TSD.

-- 
Dan Eischen

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010507130624.20611A>