mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-22 12:06:00 +00:00
hw_x86_64: Restore registers to client context values
Set the stack pointer to the R8 field in the client context to enable restoring registers by popping values of the stack. After this step the only remaining registers that do not contain client values are RAX, RSP and RIP. Note that the client value of RAX is pop'd to the global buffer region as the register will still be used by subsequent steps. It will be restored to the value in the buffer area just prior to resuming client code execution.
This commit is contained in:
parent
60e799f7b4
commit
172dec209b
@ -97,6 +97,24 @@
|
||||
mov %rbx, %fs
|
||||
mov %rbx, %gs
|
||||
|
||||
/* Restore register values from client context */
|
||||
lea R8_OFFSET(%rax), %rsp
|
||||
popq %r8
|
||||
popq %r9
|
||||
popq %r10
|
||||
popq %r11
|
||||
popq %r12
|
||||
popq %r13
|
||||
popq %r14
|
||||
popq %r15
|
||||
popq _mt_buffer
|
||||
popq %rbx
|
||||
popq %rcx
|
||||
popq %rdx
|
||||
popq %rdi
|
||||
popq %rsi
|
||||
popq %rbp
|
||||
|
||||
1: jmp 1b
|
||||
|
||||
/* end of the mode transition code */
|
||||
|
Loading…
x
Reference in New Issue
Block a user