+ #if CONFIG_KERN_PREEMPT
+ /*
+ * A preemptible kernel needs a larger stack compared to the
+ * cooperative case. A task can be interrupted anytime in each
+ * node of the call graph, at any level of depth. This may
+ * result in a higher stack consumption, to call the ISR, save
+ * the current user context and to execute the kernel
+ * preemption routines implemented as ISR prologue and
+ * epilogue. All these calls are nested into the process stack.
+ *
+ * So, to reduce the risk of stack overflow/underflow problems
+ * add a x2 to the portion stack reserved to the user process.
+ */
+ #define KERN_MINSTACKSIZE \
+ (sizeof(Process) + CPU_SAVED_REGS_CNT * 2 * sizeof(cpu_stack_t) \
+ + 32 * sizeof(int) * 2)
+ #else
+ #define KERN_MINSTACKSIZE \
+ (sizeof(Process) + CPU_SAVED_REGS_CNT * 2 * sizeof(cpu_stack_t) \
+ + 32 * sizeof(int))
+ #endif /* CONFIG_KERN_PREEMPT */
+