From 1035efcf3f541b32a69735b4dae01af256bd5387 Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Fri, 20 Feb 2015 16:06:50 +0100 Subject: [PATCH] hw_x86_64: Save info on interrupt stack to client context As the kernel entry is called from the interrupt handler the stack layout is as specified by Intel SDM Vol. 3A, figure 6-8. An additional vector number is stored at the top of the stack. Gather the necessary client information from the interrupt stack frame and store it in the client context. --- repos/base-hw/src/core/spec/x86_64/mode_transition.s | 9 +++++++++ 1 file changed, 9 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 86ecbf5d2..c76f229cf 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 @@ -81,6 +81,15 @@ mov _mt_master_context_begin+CR3_OFFSET, %rax mov %rax, %cr3 + /* Save information on interrupt stack frame in client context */ + mov _mt_client_context_ptr, %rax + popq TRAPNO_OFFSET(%rax) + popq ERRCODE_OFFSET(%rax) + popq (%rax) + popq FLAGS_OFFSET(%rax) /* Discard cs */ + popq FLAGS_OFFSET(%rax) + popq SP_OFFSET(%rax) + 1: jmp 1b .global _mt_user_entry_pic