Date: Thu, 3 Apr 2003 21:29:11 -0500 From: Jake Burkholder <jake@locore.ca> To: Peter Wemm <peter@wemm.org> Cc: freebsd-threads@freebsd.org Subject: Re: 1:N threading Message-ID: <20030404022911.GA55016@locore.ca> In-Reply-To: <20030403233541.F02592A8A7@canning.wemm.org> References: <Pine.GSO.4.10.10304031804240.27631-100000@pcnet1.pcnet.com> <20030403233541.F02592A8A7@canning.wemm.org>
index | next in thread | previous in thread | raw e-mail
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. Jakehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030404022911.GA55016>
