From fe22858550d9eaa47ec8c6c279dd9138131ab6db Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Fri, 20 Feb 2015 11:10:51 +0100 Subject: [PATCH] hw_x86_64: Adjust EFLAGS of prepared interrupt stack frame Set I/O privilege level to 3 to allow core to perform port I/O from userspace. Also make sure the IF flag is cleared for now until interrupt handling is implemented. --- repos/base-hw/src/core/spec/x86_64/mode_transition.s | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 cc5c216c6..3bbc0e238 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,7 +81,12 @@ mov $_mt_buffer+BUFFER_SIZE, %rsp pushq $0x23 pushq SP_OFFSET(%rax) - pushq $0x3000 /* XXX: Set Interrupt Enable flag */ + + /* Set I/O privilege level to 3 */ + orq $0x3000, FLAGS_OFFSET(%rax) + btrq $9, FLAGS_OFFSET(%rax) /* XXX: Drop once interrupt handling is done */ + pushq FLAGS_OFFSET(%rax) + pushq $0x1b pushq (%rax)