ntdll: Store segment registers in x86_64 syscall frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4e5b61bb06
commit
f72940de8e
|
@ -1945,16 +1945,16 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
||||||
context->Rbp = frame->rbp;
|
context->Rbp = frame->rbp;
|
||||||
context->Rip = frame->rip;
|
context->Rip = frame->rip;
|
||||||
context->EFlags = frame->eflags;
|
context->EFlags = frame->eflags;
|
||||||
__asm__( "movw %%cs,%0" : "=g" (context->SegCs) );
|
context->SegCs = frame->cs;
|
||||||
__asm__( "movw %%ss,%0" : "=g" (context->SegSs) );
|
context->SegSs = frame->ss;
|
||||||
context->ContextFlags |= CONTEXT_CONTROL;
|
context->ContextFlags |= CONTEXT_CONTROL;
|
||||||
}
|
}
|
||||||
if (needed_flags & CONTEXT_SEGMENTS)
|
if (needed_flags & CONTEXT_SEGMENTS)
|
||||||
{
|
{
|
||||||
__asm__( "movw %%ds,%0" : "=g" (context->SegDs) );
|
context->SegDs = frame->ds;
|
||||||
__asm__( "movw %%es,%0" : "=g" (context->SegEs) );
|
context->SegEs = frame->es;
|
||||||
__asm__( "movw %%fs,%0" : "=g" (context->SegFs) );
|
context->SegFs = frame->fs;
|
||||||
__asm__( "movw %%gs,%0" : "=g" (context->SegGs) );
|
context->SegGs = frame->gs;
|
||||||
context->ContextFlags |= CONTEXT_SEGMENTS;
|
context->ContextFlags |= CONTEXT_SEGMENTS;
|
||||||
}
|
}
|
||||||
if (needed_flags & CONTEXT_FLOATING_POINT)
|
if (needed_flags & CONTEXT_FLOATING_POINT)
|
||||||
|
|
|
@ -1529,6 +1529,12 @@ void output_syscalls( DLLSPEC *spec )
|
||||||
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
|
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
|
||||||
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
|
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
|
||||||
output( "\tmovq %%rbx,-0x10(%%rbp)\n" );
|
output( "\tmovq %%rbx,-0x10(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%cs,-0x20(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%ds,-0x1e(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%es,-0x1c(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%fs,-0x1a(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%ss,-0x8(%%rbp)\n" );
|
||||||
|
output( "\tmovw %%gs,-0x6(%%rbp)\n" );
|
||||||
output( "\tfxsave64 (%%rsp)\n" );
|
output( "\tfxsave64 (%%rsp)\n" );
|
||||||
output( "\tmovq %%gs:0x30,%%rcx\n" );
|
output( "\tmovq %%gs:0x30,%%rcx\n" );
|
||||||
output( "\tleaq -0x98(%%rbp),%%rbx\n" );
|
output( "\tleaq -0x98(%%rbp),%%rbx\n" );
|
||||||
|
|
Loading…
Reference in New Issue