#endif
#endif
+#if CONFIG_KERN_PREEMPT
+ // FIXME: proc_exit
+ getcontext(&proc->context);
+ proc->context.uc_stack.ss_sp = stack_base;
+ proc->context.uc_stack.ss_size = stack_size;
+ proc->context.uc_link = NULL;
+ makecontext(&proc->context, entry, 0);
+
+#else // !CONFIG_KERN_PREEMPT
/* Initialize process stack frame */
CPU_PUSH_CALL_FRAME(proc->stack, proc_exit);
CPU_PUSH_CALL_FRAME(proc->stack, entry);
/* Add to ready list */
ATOMIC(SCHED_ENQUEUE(proc));
ATOMIC(LIST_ASSERT_VALID(&ProcReadyList));
+#endif // CONFIG_KERN_PREEMPT
#if CONFIG_KERN_MONITOR
monitor_add(proc, name);