⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

restore_signal_frame

Function restore_signal_frame 

Source
pub fn restore_signal_frame(
    process: &Process,
    thread: &Thread,
    frame_ptr: usize,
) -> Result<(), KernelError>
Expand description

Restore the original thread context from a signal frame on the user stack.

Called by sys_sigreturn after the signal handler returns. Reads the SignalFrame from the user stack and restores all saved registers and the signal mask.

§Arguments

  • process: The process whose signal mask will be restored.
  • thread: The thread whose context will be restored.
  • frame_ptr: User-space pointer to the SignalFrame (passed by the trampoline via RDI).

§Returns

  • Ok(()) on success (thread context is restored, execution will resume at the interrupted instruction).
  • Err(...) if the frame cannot be read.