diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86_64/setcontext.S')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/setcontext.S | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/sysdeps/unix/sysv/linux/x86_64/setcontext.S index eb46034a50..e3d770bcc6 100644 --- a/sysdeps/unix/sysv/linux/x86_64/setcontext.S +++ b/sysdeps/unix/sysv/linux/x86_64/setcontext.S @@ -55,7 +55,8 @@ ENTRY(__setcontext) ldmxcsr oMXCSR(%rdi) - /* Load the new stack pointer and the preserved registers. */ + /* Load the new stack pointer, the preserved registers and + registers used for passing args. */ movq oRSP(%rdi), %rsp movq oRBX(%rdi), %rbx movq oRBP(%rdi), %rbp @@ -69,6 +70,15 @@ ENTRY(__setcontext) movq oRIP(%rdi), %rcx pushq %rcx + movq oRSI(%rdi), %rsi + movq oRDX(%rdi), %rdx + movq oRCX(%rdi), %rcx + movq oR8(%rdi), %r8 + movq oR9(%rdi), %r9 + + /* Setup finally %rdi. */ + movq oRDI(%rdi), %rdi + /* Clear rax to indicate success. */ xorq %rax, %rax |