- #if CONFIG_KERN_PREEMPT
-
- getcontext(&proc->context);
- proc->context.uc_stack.ss_sp = proc->stack;
- proc->context.uc_stack.ss_size = stack_size - 1;
- proc->context.uc_link = NULL;
- makecontext(&proc->context, (void (*)(void))proc_entry, 1, entry);
-
- #else // !CONFIG_KERN_PREEMPT
-
- CPU_CREATE_NEW_STACK(proc->stack, entry, proc_exit);
-
- #endif // CONFIG_KERN_PREEMPT
-
- #if CONFIG_KERN_MONITOR
- monitor_add(proc, name);
- #endif