From 54109e7e9e24e7e72e3f7151855c198fb4fdaa18 Mon Sep 17 00:00:00 2001 From: fgh1999 Date: Mon, 25 Mar 2024 11:51:08 +0000 Subject: [PATCH] Remove IRQ guard in `preempt()` Fix #478. Kernel preemption is not taken into account currently. --- framework/aster-frame/src/task/processor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/aster-frame/src/task/processor.rs b/framework/aster-frame/src/task/processor.rs index 02d9c0348..db972c1c1 100644 --- a/framework/aster-frame/src/task/processor.rs +++ b/framework/aster-frame/src/task/processor.rs @@ -10,7 +10,7 @@ use super::{ task::{context_switch, TaskContext}, Task, TaskStatus, }; -use crate::{cpu_local, sync::Mutex, trap::disable_local}; +use crate::{cpu_local, sync::Mutex}; pub struct Processor { current: Option>, @@ -62,8 +62,8 @@ pub fn schedule() { } pub fn preempt() { - // disable interrupts to avoid nested preemption. - let disable_irq = disable_local(); + // TODO: Refactor `preempt` and `schedule` + // after the Atomic mode and `might_break` is enabled. let Some(curr_task) = current_task() else { return; };