From b3ba0ba4e9249bd124cd73979e135e2e51c01ca4 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 8 Mar 2020 14:50:58 +0100 Subject: [PATCH] Use new enable_interrupts_and_hlt function of x86_64 --- src/task/executor.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/task/executor.rs b/src/task/executor.rs index 440011a0..72d11f9d 100644 --- a/src/task/executor.rs +++ b/src/task/executor.rs @@ -89,14 +89,7 @@ impl Executor { // check if relevant interrupts occured since the last check if interrupts::interrupt_wakeups().is_empty() { // no interrupts occured -> hlt to wait for next interrupt - // - // It's important to execute `hlt` directly after `sti` because - // otherwise we could miss interrupts between the two - // instructions. Since `sti` only enables interrupts after the - // subsequent instruction, we can be sure that we don't miss an - // interrupt. (One exception are non-maskable interrupts, which - // can occur even when interrupts are disabled.) - unsafe { asm!("sti; hlt") }; + x86_64::instructions::interrupts::enable_interrupts_and_hlt(); } else { // there were some new wakeups -> continue execution x86_64::instructions::interrupts::enable();