Skip to main content

maybe_preempt_from_interrupt

Function maybe_preempt_from_interrupt 

Source
pub fn maybe_preempt_from_interrupt(
    cpu_index: usize,
    current_frame: &mut SyscallFrame,
) -> Option<InterruptReturnDecision>
Expand description

Interrupt-aware preemption path.

Unlike the legacy ret-based scheduler path, the full interrupted user context is already materialized as a SyscallFrame on the current kernel stack. This lets us save the outgoing task immediately, select the next runnable task under the scheduler lock, and return an iretq-compatible frame pointer for the raw timer stub.