Commit b8ae3f07 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fix handling of the duplicate MxCsr entry in the x86_64 context.

parent 0223f71d
...@@ -1019,11 +1019,11 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) ...@@ -1019,11 +1019,11 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext )
#else #else
__asm__("movw %%ss,%0" : "=m" (context->SegSs)); __asm__("movw %%ss,%0" : "=m" (context->SegSs));
#endif #endif
context->MxCsr = 0; /* FIXME */
if (FPU_sig(sigcontext)) if (FPU_sig(sigcontext))
{ {
context->ContextFlags |= CONTEXT_FLOATING_POINT; context->ContextFlags |= CONTEXT_FLOATING_POINT;
context->u.FltSave = *FPU_sig(sigcontext); context->u.FltSave = *FPU_sig(sigcontext);
context->MxCsr = context->u.FltSave.MxCsr;
} }
} }
...@@ -1107,7 +1107,6 @@ void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) ...@@ -1107,7 +1107,6 @@ void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
to->SegCs = from->SegCs; to->SegCs = from->SegCs;
to->SegSs = from->SegSs; to->SegSs = from->SegSs;
to->EFlags = from->EFlags; to->EFlags = from->EFlags;
to->MxCsr = from->MxCsr;
} }
if (flags & CONTEXT_INTEGER) if (flags & CONTEXT_INTEGER)
{ {
...@@ -1135,6 +1134,7 @@ void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) ...@@ -1135,6 +1134,7 @@ void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
} }
if (flags & CONTEXT_FLOATING_POINT) if (flags & CONTEXT_FLOATING_POINT)
{ {
to->MxCsr = from->MxCsr;
to->u.FltSave = from->u.FltSave; to->u.FltSave = from->u.FltSave;
} }
if (flags & CONTEXT_DEBUG_REGISTERS) if (flags & CONTEXT_DEBUG_REGISTERS)
...@@ -1170,7 +1170,6 @@ NTSTATUS context_to_server( context_t *to, const CONTEXT *from ) ...@@ -1170,7 +1170,6 @@ NTSTATUS context_to_server( context_t *to, const CONTEXT *from )
to->ctl.x86_64_regs.cs = from->SegCs; to->ctl.x86_64_regs.cs = from->SegCs;
to->ctl.x86_64_regs.ss = from->SegSs; to->ctl.x86_64_regs.ss = from->SegSs;
to->ctl.x86_64_regs.flags = from->EFlags; to->ctl.x86_64_regs.flags = from->EFlags;
to->ctl.x86_64_regs.mxcsr = from->MxCsr;
} }
if (flags & CONTEXT_INTEGER) if (flags & CONTEXT_INTEGER)
{ {
...@@ -1236,7 +1235,6 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from ) ...@@ -1236,7 +1235,6 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from )
to->SegCs = from->ctl.x86_64_regs.cs; to->SegCs = from->ctl.x86_64_regs.cs;
to->SegSs = from->ctl.x86_64_regs.ss; to->SegSs = from->ctl.x86_64_regs.ss;
to->EFlags = from->ctl.x86_64_regs.flags; to->EFlags = from->ctl.x86_64_regs.flags;
to->MxCsr = from->ctl.x86_64_regs.mxcsr;
} }
if (from->flags & SERVER_CTX_INTEGER) if (from->flags & SERVER_CTX_INTEGER)
...@@ -1269,6 +1267,7 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from ) ...@@ -1269,6 +1267,7 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from )
{ {
to->ContextFlags |= CONTEXT_FLOATING_POINT; to->ContextFlags |= CONTEXT_FLOATING_POINT;
memcpy( &to->u.FltSave, from->fp.x86_64_regs.fpregs, sizeof(from->fp.x86_64_regs.fpregs) ); memcpy( &to->u.FltSave, from->fp.x86_64_regs.fpregs, sizeof(from->fp.x86_64_regs.fpregs) );
to->MxCsr = to->u.FltSave.MxCsr;
} }
if (from->flags & SERVER_CTX_DEBUG_REGISTERS) if (from->flags & SERVER_CTX_DEBUG_REGISTERS)
{ {
......
...@@ -143,7 +143,7 @@ typedef struct ...@@ -143,7 +143,7 @@ typedef struct
{ {
struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs; struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
struct { unsigned __int64 rip, rbp, rsp; struct { unsigned __int64 rip, rbp, rsp;
unsigned int cs, ss, flags, mxcsr; } x86_64_regs; unsigned int cs, ss, flags; } x86_64_regs;
struct { unsigned __int64 fir; struct { unsigned __int64 fir;
unsigned int psr; } alpha_regs; unsigned int psr; } alpha_regs;
struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_regs; struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_regs;
...@@ -5347,6 +5347,6 @@ union generic_reply ...@@ -5347,6 +5347,6 @@ union generic_reply
struct set_window_layered_info_reply set_window_layered_info_reply; struct set_window_layered_info_reply set_window_layered_info_reply;
}; };
#define SERVER_PROTOCOL_VERSION 389 #define SERVER_PROTOCOL_VERSION 390
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
...@@ -159,7 +159,7 @@ typedef struct ...@@ -159,7 +159,7 @@ typedef struct
{ {
struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs; struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
struct { unsigned __int64 rip, rbp, rsp; struct { unsigned __int64 rip, rbp, rsp;
unsigned int cs, ss, flags, mxcsr; } x86_64_regs; unsigned int cs, ss, flags; } x86_64_regs;
struct { unsigned __int64 fir; struct { unsigned __int64 fir;
unsigned int psr; } alpha_regs; unsigned int psr; } alpha_regs;
struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_regs; struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_regs;
......
...@@ -457,9 +457,8 @@ static void dump_varargs_context( const char *prefix, data_size_t size ) ...@@ -457,9 +457,8 @@ static void dump_varargs_context( const char *prefix, data_size_t size )
dump_uint64( ",rip=", &ctx.ctl.x86_64_regs.rip ); dump_uint64( ",rip=", &ctx.ctl.x86_64_regs.rip );
dump_uint64( ",rbp=", &ctx.ctl.x86_64_regs.rbp ); dump_uint64( ",rbp=", &ctx.ctl.x86_64_regs.rbp );
dump_uint64( ",rsp=", &ctx.ctl.x86_64_regs.rsp ); dump_uint64( ",rsp=", &ctx.ctl.x86_64_regs.rsp );
fprintf( stderr, ",cs=%04x,ss=%04x,flags=%08x,mxcsr=%08x", fprintf( stderr, ",cs=%04x,ss=%04x,flags=%08x",
ctx.ctl.x86_64_regs.cs, ctx.ctl.x86_64_regs.ss, ctx.ctl.x86_64_regs.cs, ctx.ctl.x86_64_regs.ss, ctx.ctl.x86_64_regs.flags );
ctx.ctl.x86_64_regs.flags, ctx.ctl.x86_64_regs.mxcsr );
} }
if (ctx.flags & SERVER_CTX_INTEGER) if (ctx.flags & SERVER_CTX_INTEGER)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment