From c62b4ea36a99e58ac6e2263742ed357c2ce4713d Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Fri, 20 Feb 2015 16:11:41 +0100 Subject: [PATCH] hw_x86_64: Restore kernel register values from master context Set stack pointer to master context and restore kernel register by popping the values from the master context. --- .../src/core/spec/x86_64/mode_transition.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/repos/base-hw/src/core/spec/x86_64/mode_transition.s b/repos/base-hw/src/core/spec/x86_64/mode_transition.s index 0c620bb75..50453b21f 100644 --- a/repos/base-hw/src/core/spec/x86_64/mode_transition.s +++ b/repos/base-hw/src/core/spec/x86_64/mode_transition.s @@ -115,6 +115,24 @@ mov %rbx, %fs mov %rbx, %gs + /* Restore register values from kernel context */ + mov $_mt_master_context_begin+R8_OFFSET, %rsp + popq %r8 + popq %r9 + popq %r10 + popq %r11 + popq %r12 + popq %r13 + popq %r14 + popq %r15 + popq %rax + popq %rbx + popq %rcx + popq %rdx + popq %rdi + popq %rsi + popq %rbp + 1: jmp 1b .global _mt_user_entry_pic