From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 11:58:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81A3216A4CE for ; Wed, 10 Dec 2003 11:58:07 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5447E43D29 for ; Wed, 10 Dec 2003 11:58:06 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hBAJw5ml028738; Wed, 10 Dec 2003 14:58:05 -0500 (EST) Date: Wed, 10 Dec 2003 14:58:05 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Boston In-Reply-To: <200312101056.36458.craig@xfoil.gank.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Current Subject: Re: nss and pthreads and wine, oh my! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2003 19:58:07 -0000 On Wed, 10 Dec 2003, Craig Boston wrote: > On Wednesday 10 December 2003 09:56 am, Daniel Eischen wrote: > > The mplayer patch is to make it use LDT_AUTO_ALLOC. The ldt > > fiddling code (taken from wine) doesn't use LDT_AUTO_ALLOC, > > so I had to make it use it. See if you can patch wine to > > use LDT_AUTO_ALLOC; it shouldn't be calling i386_set_ldt() > > any other way. > > Ah, I see... Makes sense. > > Unfortunately I'm not having much success patching wine in this fashion. The > problems are two-fold: > > 1. The internal API used by wine wants to be able to allocate ldts before > actually calling i386_set_ldt. From what I can see, it's never actually used It doesn't work if you try to use an ldt before it's allocated. > in this fasion -- the caller always uses set_ldt right after allocating one. > I could probably fix this but it would involve making a fairly fundamental > change to the internals of wine. Still, it might be ugly-but-doable as a > BSD-local patch. > > Question: Would using some dummy descriptor in i386_set_ldt just to allocate > the selector do any harm, with the understanding that it would be reset to > something valid before it's actually used? > > 2. The wine_ldt_alloc_entries() function takes a count parameter, which is > documented as "Allocate a number of consecutive ldt entries, without setting > the LDT contents". From my perusal of the kernel sources, it seems that > LDT_AUTO_ALLOC only works when num_sels==1 and doesn't guarantee that > subsequent allocations are consecutive. This is a harder problem as it's > used for emulating a Windows API call "AllocSelectorArray" so we really don't > have any control over how it's used :( Just allocate them in a loop and fill the array appropriately. > I'll see what I can come up with for #1. Any thoughts or comments about how > to tackle #2 would be appreciated. -- Dan Eischen