Commit f72940de authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ntdll: Store segment registers in x86_64 syscall frame.

parent 4e5b61bb
......@@ -1945,16 +1945,16 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
context->Rbp = frame->rbp;
context->Rip = frame->rip;
context->EFlags = frame->eflags;
__asm__( "movw %%cs,%0" : "=g" (context->SegCs) );
__asm__( "movw %%ss,%0" : "=g" (context->SegSs) );
context->SegCs = frame->cs;
context->SegSs = frame->ss;
context->ContextFlags |= CONTEXT_CONTROL;
}
if (needed_flags & CONTEXT_SEGMENTS)
{
__asm__( "movw %%ds,%0" : "=g" (context->SegDs) );
__asm__( "movw %%es,%0" : "=g" (context->SegEs) );
__asm__( "movw %%fs,%0" : "=g" (context->SegFs) );
__asm__( "movw %%gs,%0" : "=g" (context->SegGs) );
context->SegDs = frame->ds;
context->SegEs = frame->es;
context->SegFs = frame->fs;
context->SegGs = frame->gs;
context->ContextFlags |= CONTEXT_SEGMENTS;
}
if (needed_flags & CONTEXT_FLOATING_POINT)
......
......@@ -1529,6 +1529,12 @@ void output_syscalls( DLLSPEC *spec )
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
output( "\tleaq 0x10(%%rbp),%%rbx\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( "\tmovq %%gs:0x30,%%rcx\n" );
output( "\tleaq -0x98(%%rbp),%%rbx\n" );
......
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