aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/x86_64/getcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86_64/getcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/getcontext.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index e941f5d5fd..2f2c710040 100644
--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -33,7 +33,8 @@
ENTRY(__getcontext)
- /* Save the preserved registers and the return address. */
+ /* Save the preserved registers, the registers used for passing
+ args, and the return address. */
movq %rbx, oRBX(%rdi)
movq %rbp, oRBP(%rdi)
movq %r12, oR12(%rdi)
@@ -41,6 +42,13 @@ ENTRY(__getcontext)
movq %r14, oR14(%rdi)
movq %r15, oR15(%rdi)
+ movq %rdi, oRDI(%rdi)
+ movq %rsi, oRSI(%rdi)
+ movq %rdx, oRDX(%rdi)
+ movq %rcx, oRCX(%rdi)
+ movq %r8, oR8(%rdi)
+ movq %r9, oR9(%rdi)
+
movq (%rsp), %rcx
movq %rcx, oRIP(%rdi)
leaq 8(%rsp), %rcx /* Exclude the return address. */