From owner-freebsd-threads@FreeBSD.ORG Fri Apr 4 14:39:34 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 1B3F437B401 for ; Fri, 4 Apr 2003 14:39:34 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EFBF43FBF for ; Fri, 4 Apr 2003 14:39:33 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <20030404223931001002mtane>; Fri, 4 Apr 2003 22:39:32 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA37772; Fri, 4 Apr 2003 14:39:29 -0800 (PST) Date: Fri, 4 Apr 2003 14:39:28 -0800 (PST) From: Julian Elischer To: Peter Wemm In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 22:39:34 -0000 On Fri, 4 Apr 2003, Julian Elischer wrote: > > > On Fri, 4 Apr 2003, Peter Wemm wrote: > > > Daniel Eischen wrote: > > > 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? > > > > Whoops. I misread NLDT as NGDT. > > > > Gah. We're doing some crufty stuff here. For starters, we're running > > userland on a LDT for %cs and %ds/es/ss/etc. We really should be using a > > GDT slot for those. Most of the other stuff there is for the a.out > > "lcall 7,0" instruction and for BSDI's version of the lcall stuff. > > > > The i386_[gs]et_ldt() syscalls really should have a way of reporting what > > is available for use. > > What we SHOULD be doing is setting an LDT entry to point to the > mailbox (puts some constraints on the mailbox but..) of each upcall > and setting %gs to teh appropriate entry before returning to userspace. by which I mean that the setting of the LDT would be done in the kse_create() call by the kernel. The userland would just have to offset off the g segment to find the current KSE/upcall mailbox which would have a pointer to the current thread.. > > (different schemes would be used for the other architectures.) > > > > > 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 > > > > _______________________________________________ > > freebsd-threads@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" >