Add unblock_no_ipi function and use in context switch

This commit is contained in:
Jeremy Soller
2023-12-13 17:19:43 -07:00
parent 2d065083df
commit fbaa4306e3
2 changed files with 4 additions and 7 deletions
+1 -4
View File
@@ -294,10 +294,7 @@ impl Context {
/// Unblock context, and return true if it was blocked before being marked runnable
pub fn unblock(&mut self) -> bool {
if self.status.is_soft_blocked() {
self.status = Status::Runnable;
self.status_reason = "";
if self.unblock_no_ipi() {
if let Some(cpu_id) = self.cpu_id {
if cpu_id != crate::cpu_id() {
// Send IPI if not on current CPU
+3 -3
View File
@@ -60,12 +60,12 @@ unsafe fn update_runnable(context: &mut Context, cpu_id: LogicalCpuId) -> bool {
regs.set_singlestep(was_singlestep);
}
context.unblock();
context.unblock_no_ipi();
}
// Unblock when there are pending signals
if context.status.is_soft_blocked() && !context.pending.is_empty() {
context.unblock();
context.unblock_no_ipi();
}
// Wake from sleep
@@ -75,7 +75,7 @@ unsafe fn update_runnable(context: &mut Context, cpu_id: LogicalCpuId) -> bool {
let current = time::monotonic();
if current >= wake {
context.wake = None;
context.unblock();
context.unblock_no_ipi();
}
}