From owner-freebsd-current Mon May 7 9:47:48 2001 Delivered-To: freebsd-current@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 8EB1D37B422 for ; Mon, 7 May 2001 09:47:45 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.1) with ESMTP id f47Glh049361; Mon, 7 May 2001 09:47:43 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.3/8.11.0) id f47GlgQ64138; Mon, 7 May 2001 09:47:42 -0700 (PDT) (envelope-from jdp) Date: Mon, 7 May 2001 09:47:42 -0700 (PDT) Message-Id: <200105071647.f47GlgQ64138@vashon.polstra.com> To: current@freebsd.org From: John Polstra Cc: eischen@vigrid.com Subject: Re: Rfork'd threads, signals, and LDTs In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message