sched: Fix kernel panic (1 -> idle, idle -> idle)
This commit is contained in:
parent
0e6cb88756
commit
058bfddd58
@ -115,20 +115,7 @@ impl CpuQueue {
|
|||||||
// Start from idle thread to avoid having a Rc stuck here without getting dropped
|
// Start from idle thread to avoid having a Rc stuck here without getting dropped
|
||||||
let t = CNTPCT_EL0.get();
|
let t = CNTPCT_EL0.get();
|
||||||
self.lock().stats.measure_time = t;
|
self.lock().stats.measure_time = t;
|
||||||
|
self.idle.enter()
|
||||||
let mut inner = self.inner.lock();
|
|
||||||
if let Some(proc) = inner.next_ready_task() {
|
|
||||||
inner.queue.push_back(proc.clone());
|
|
||||||
inner.current = Some(proc.clone());
|
|
||||||
proc.set_running(Cpu::local_id());
|
|
||||||
|
|
||||||
drop(inner);
|
|
||||||
proc.context().enter();
|
|
||||||
} else {
|
|
||||||
drop(inner);
|
|
||||||
|
|
||||||
self.idle.enter();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Yields CPU execution to the next task in queue (or idle task if there aren't any).
|
/// Yields CPU execution to the next task in queue (or idle task if there aren't any).
|
||||||
@ -177,6 +164,7 @@ impl CpuQueue {
|
|||||||
(&self.idle, 0)
|
(&self.idle, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// log_print_raw!(crate::debug::LogLevel::Info, "{}: ", Cpu::local_id());
|
||||||
// if let Some(from) = current.as_ref() {
|
// if let Some(from) = current.as_ref() {
|
||||||
// log_print_raw!(crate::debug::LogLevel::Info, "{}", from.id());
|
// log_print_raw!(crate::debug::LogLevel::Info, "{}", from.id());
|
||||||
// } else {
|
// } else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user