pub unsafe fn prepare_context_switch<'switch>(
pin: &'switch CpuPin<'_>,
previous: Pin<&ExecutionContextHeader>,
next: Pin<&ExecutionContextHeader>,
) -> Result<(PreparedContextSwitch<'switch>, PreviousContextBinding), ContextSwitchError>Expand description
Validates and binds a complete execution-context switch transaction.
All fallible validation occurs before the returned prepared token can be
committed. Dropping the prepared token automatically rolls back next.
ยงSafety
The caller must own the IRQ-disabled context-switch path. Both headers must remain pinned and alive through the raw switch and incoming tail.