[][src]Function sunrise_kernel::i386::process_switch::prepare_for_first_schedule

pub unsafe fn prepare_for_first_schedule(
    t: &ThreadStruct,
    entrypoint: usize,
    userspace_args: (usize, usize),
    userspace_stack: usize
)

Prepares the thread for its first schedule by writing default values at the start of the stack that will be loaded in the registers in schedule-in. See process_switch() documentation for more details.

Safety

This function will definitely fuck up your stack, so make sure you're calling it on a never-scheduled thread's empty-stack.