server: Fix FPU registers in get_thread_context()

Petr Tesarik hat at tesarici.cz
Wed Mar 29 10:48:35 CST 2006


Dne 03/27/06 v 17:19:47 (+0200), Petr Tesarik napsal(a):
> Dne 03/27/06 v 08:03:58 (-0700), Vitaliy Margolen napsal(a):
> > Monday, March 27, 2006, 12:51:03 AM, Petr Tesarik wrote:
> > > [skip]
> > 
> > > * Look at ContextFlags to see which registers are saved in
> > >   thread->context.
> > 
> > Sorry this is not correct. Exception handler should get full context
> > including FPU context. If we not saving it that's the problem on the
> > other end.
> 
> I don't think so. A real 80386 without a math coprocessor does not
> even have an FPU context.  I guess this is why CONTEXT_FULL does not
> include CONTEXT_FLOATING_POINT.

As I'm re-thinking it once more, I'm no longer sure about my point.
You're right that the signal handler must definitely save the FPU
state if there is one. Otherwise, it can't restore the context
correctly if the exception handler uses the FPU (which it is AFAIK
allowed to do).  And at least under Linux, there is always an FPU
state (either from a real FPU, or emulated).

So, I'll change my question:  Is there a platform, where FPU
instructions can't be invoked unless there is a real FPU?

To kick the answers off, I'm providing a table of possible operating
systems we run on the x86 architecture. Whoever knows for sure that
floating point instructions can or can not be safely run even without
a real (hardware) FPU, please help complete the chart. Also, feel free
to add any other systems which can run Wine.

Linux:    OK
FreeBSD:  ???
NetBSD:   ???
OpenBSD:  ???
Solaris:  ???
OS/X:     ???

Petr Tesarik



More information about the wine-devel mailing list