From owner-freebsd-threads@FreeBSD.ORG Thu Apr 3 16:26:22 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 ABA0C37B401 for ; Thu, 3 Apr 2003 16:26:22 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 077F443F93 for ; Thu, 3 Apr 2003 16:26:22 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h340QLBg007669; Thu, 3 Apr 2003 19:26:21 -0500 (EST) Received: from localhost (eischen@localhost)h340QKET007665; Thu, 3 Apr 2003 19:26:20 -0500 (EST) Date: Thu, 3 Apr 2003 19:26:20 -0500 (EST) From: Daniel Eischen To: Peter Wemm In-Reply-To: <20030403233541.F02592A8A7@canning.wemm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 00:26:23 -0000 On Thu, 3 Apr 2003, Peter Wemm wrote: > 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 */ OK, but if NLDT is kernel private, how do can I know what LDTs I can use as local? (*) (*) The only thing I know about LDTs came from an Intel 486 architecture manual. -- Dan Eischen