From owner-freebsd-threads@FreeBSD.ORG Thu Apr 3 18:24:19 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 F0D1937B405 for ; Thu, 3 Apr 2003 18:24:18 -0800 (PST) Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id C902543F93 for ; Thu, 3 Apr 2003 18:24:15 -0800 (PST) (envelope-from jake@k6.locore.ca) Received: from k6.locore.ca (localhost.locore.ca [127.0.0.1]) by k6.locore.ca (8.12.8/8.12.8) with ESMTP id h342VBxS055637; Thu, 3 Apr 2003 21:31:11 -0500 (EST) (envelope-from jake@k6.locore.ca) Received: (from jake@localhost) by k6.locore.ca (8.12.8/8.12.8/Submit) id h342VB2u055636; Thu, 3 Apr 2003 21:31:11 -0500 (EST) Date: Thu, 3 Apr 2003 21:31:11 -0500 From: Jake Burkholder To: Peter Wemm Message-ID: <20030404023111.GB55016@locore.ca> References: <20030403233541.F02592A8A7@canning.wemm.org> <20030404022911.GA55016@locore.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030404022911.GA55016@locore.ca> User-Agent: Mutt/1.4i cc: Daniel Eischen cc: freebsd-threads@freebsd.org Subject: Re: 1:N threading 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: Fri, 04 Apr 2003 02:24:19 -0000 Apparently, On Thu, Apr 03, 2003 at 09:29:11PM -0500, Jake Burkholder said words to the effect of; > Apparently, On Thu, Apr 03, 2003 at 03:35:41PM -0800, > Peter Wemm said words to the effect of; > > > Daniel Eischen wrote: > > > > > The patches are available: > > > > > > http://people.freebsd.org/~deischen/libpthread.diffs > > > > > > FYI, since this is a new mailing list, the above changes > > > are meant to give libpthread M:N capability. > > > > > > I don't need testers; I have enough bugs that I know about > > > to fix. > > > > + __asm__("movl %%gs, %0" : "=r" (id)); > > + id >>= 3; > > + if (id - NLDT < 0) > > > > There is a problem here, NLDT is kernel private and changes depending on > > things like whether SMP is enabled or what the maximum number of cpus > > is. > > > > You're trying to find if its a local or global selector, right? > > What you really want is bit 2 which tells you which it is. > > > > #define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ > > #define SEL_LDT 4 /* local descriptor table */ > > NLDT seems to be invariant, but we should have a sysctl or something to > get the first LDT entry that is unused by the kernel. Libthr uses it > in order to know which entry to start at. Actually Dan uses it for the exact same thing :) Jake