From owner-freebsd-current Mon May 7 10:12:59 2001 Delivered-To: freebsd-current@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 31DA837B424 for ; Mon, 7 May 2001 10:12:57 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id NAA21637; Mon, 7 May 2001 13:12:05 -0400 (EDT) Date: Mon, 7 May 2001 13:12:05 -0400 (EDT) From: Daniel Eischen To: John Polstra Cc: current@freebsd.org Subject: Re: Rfork'd threads, signals, and LDTs In-Reply-To: <200105071647.f47GlgQ64138@vashon.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 7 May 2001, John Polstra wrote: > In article > , Daniel > Eischen 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