From owner-freebsd-threads@FreeBSD.ORG Thu Jun 19 16:11:53 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0EEA537B401 for ; Thu, 19 Jun 2003 16:11:53 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C65F43FB1 for ; Thu, 19 Jun 2003 16:11:52 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h5JNBkXh009361; Thu, 19 Jun 2003 19:11:46 -0400 (EDT) Date: Thu, 19 Jun 2003 19:11:46 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030619225224.GC1273@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Julian Elischer Subject: Re: Implementing TLS: step 1 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2003 23:11:53 -0000 On Thu, 19 Jun 2003, Marcel Moolenaar wrote: > On Thu, Jun 19, 2003 at 03:36:11PM -0700, Julian Elischer wrote: > > Basically in libKSE there is what the kernel calls a thread, which is > > interpretted in userspace as a virtual CPU, and this is used to > > run user level threads. The kernel sets the thread-pointer register > > upcorrectly according to which of these "kernel visible threads" > > is running. This is a legitimate use of the thread pointer register as > > far as I see. In 1:1 (libthr) the two things are the same and it stops > > there. > > It isn't on ia64. The thread pointer register has a predefined > meaning. You cannot point it to anything else than the TLS in > a process that has TLS. (if there's no TLS, the TP register is > unused (=reserved)). > > See also: > http://www.freebsd.org/platforms/ia64/refs.html > > I'm not sure the runtime specification pointed to there has the > TLS info. I'll update the page ASAP if it's missing. Please do. All it says is the TP is the thread pointer and "The usage of this register is ABI specific. Programs conforming to these conventions may not modify this register." I don't see how using it to point to a per-KSE structure abuses its intended use. You must have a different document in mind. The one I looked at was: http://developer.intel.com/design/itanium/downloads/24535803.pdf Titled: "Itanium Software Conventions and Runtime Architecture Guide", May 2001 Or perhaps I just didn't look in the correct section... The above quote was from section 5.2. Thanks, -- Dan Eischen