Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jul 2003 14:06:51 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        current@FreeBSD.org
Cc:        emulation@FreeBSD.org
Subject:   LDT entries and WINE and Threads..
Message-ID:  <200307082106.h68L6pKH061228@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

I'm looking at this and I think that my interpretation is that 
WINE, under FreeBSD, blindly allocates LDT entries starting at location 17,
without looking to see if they are in use already..

My reason for thinking thios is that the string i386_get_ldt
only occurs once in the WINE source, and that is a prototype declaration
in ./work/wine-20030508/libs/wine/ldt.c (in the port)
In other words, it is not checking first..

This makes it "incompatible" with threads (both libthr and libkse)
and while this isn't an immediate problem, it WILL be a problem because
WINE uses OpenGL and OpenGL used threads (currently linuxthreads)
so it will eventually be a problem..

It seems to me that we could better serve the applications by 
having a differnt API for setting LDTs, and that the kernel
should keep track of which is free and which is not.
I would say that the API should be something like:

int selector = i386_make_ldte(type, base, limit, flags);
 
where "selector" is what you later stuff into a segment register.
there would be an equivalent
void i386_free_ldte(selector)

i386_get_ldt() could stay as it is I think..


The 'guts' of i386_make_ldte would be used directly by 
kse_create() and set the value of %gs that the upcall returns with.


comments?





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