Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2003 14:58:05 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Craig Boston <craig@xfoil.gank.org>
Cc:        Current <freebsd-current@freebsd.org>
Subject:   Re: nss and pthreads and wine, oh my!
Message-ID:  <Pine.GSO.4.10.10312101456310.27852-100000@pcnet5.pcnet.com>
In-Reply-To: <200312101056.36458.craig@xfoil.gank.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10312101456310.27852-100000>