hw_x86_64: Save client register values to context

Point stack to client context region and save registers using push
instructions.

Note that since the push instruction first increments the stack pointer
and then stores the value on the stack, the RSP has to point one field
past RBP before pushing the first register value.
This commit is contained in:
Adrian-Ken Rueegsegger 2015-02-20 16:09:39 +01:00 committed by Christian Helmuth
parent 1035efcf3f
commit fb5946b69c
1 changed files with 18 additions and 0 deletions

View File

@ -90,6 +90,24 @@
popq FLAGS_OFFSET(%rax)
popq SP_OFFSET(%rax)
/* Save register values to client context */
lea ERRCODE_OFFSET(%rax), %rsp
pushq %rbp
pushq %rsi
pushq %rdi
pushq %rdx
pushq %rcx
pushq %rbx
pushq _mt_buffer
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %r11
pushq %r10
pushq %r9
pushq %r8
1: jmp 1b
.global _mt_user_entry_pic