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

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

I'll see what I can come up with for #1.  Any thoughts or comments about how 
to tackle #2 would be appreciated.

Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312101056.36458.craig>