- #if (ARCH & ARCH_EMUL)
- /* We need a large stack because system libraries are bloated */
- #define CONFIG_KERN_MINSTACKSIZE 65536
- #else
- /**
- * Default stack size for each thread, in bytes.
- *
- * The goal here is to allow a minimal task to save all of its
- * registers twice, plus push a maximum of 32 variables on the
- * stack.
- *
- * The actual size computed by the default formula is:
- * AVR: 102
- * i386: 156
- * ARM: 164
- * x86_64: 184
- *
- * Note that on most 16bit architectures, interrupts will also
- * run on the stack of the currently running process. Nested
- * interrupts will greatly increases the amount of stack space
- * required per process. Use irqmanager to minimize stack
- * usage.
- */
- #define CONFIG_KERN_MINSTACKSIZE \
- (CPU_SAVED_REGS_CNT * 2 * sizeof(cpu_stack_t) \
- + 48 * sizeof(int))
- #endif
+#if (ARCH & ARCH_EMUL)
+ /* We need a large stack because system libraries are bloated */
+ #define KERN_MINSTACKSIZE 65536
+#else
+ #define KERN_MINSTACKSIZE \
+ (sizeof(Process) + CPU_SAVED_REGS_CNT * 2 * sizeof(cpu_stack_t) \
+ + 32 * sizeof(int))
+#endif
+
+#ifndef CONFIG_KERN_MINSTACKSIZE
+ /* For backward compatibility */
+ #define CONFIG_KERN_MINSTACKSIZE KERN_MINSTACKSIZE
+#else
+ #warning FIXME: This macro is deprecated, use KERN_MINSTACKSIZE instead