From owner-freebsd-threads@FreeBSD.ORG Thu Apr 3 15:35:42 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 68EC737B401 for ; Thu, 3 Apr 2003 15:35:42 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13A4F43F75 for ; Thu, 3 Apr 2003 15:35:42 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id F02592A8A7; Thu, 3 Apr 2003 15:35:41 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Daniel Eischen In-Reply-To: Date: Thu, 03 Apr 2003 15:35:41 -0800 From: Peter Wemm Message-Id: <20030403233541.F02592A8A7@canning.wemm.org> 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: Thu, 03 Apr 2003 23:35:42 -0000 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 */ Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5