#include <cpu/types.h> // cpu_stack_t
#include <cpu/frame.h> // CPU_SAVED_REGS_CNT
+/*
+ * Define stack for one process.
+ *
+ * This macro define a static stack for one process and do
+ * check if given stack size is enough to run process.
+ */
+#define PROC_DEFINE_STACK(name, size) \
+ STATIC_ASSERT(size >= CONFIG_KERN_MINSTACKSIZE); \
+ cpu_stack_t name[size / sizeof(cpu_stack_t)]; \
+
/*
* Forward declaration. The definition of struct Process is private to the
* scheduler and hidden in proc_p.h.
/**
* Create a new named process and schedules it for execution.
*
+ * When defining the stacksize take into account that you may want at least:
+ * \li save all the registers for each nested function call;
+ * \li have memory for the struct Process, which is positioned at the bottom
+ * of the stack;
+ * \li have some memory for temporary variables inside called functions.
+ *
+ * The value given by CONFIG_KERN_MINSTACKSIZE is rather safe to use in the first place.
+ *
* \note The function
* \code
* proc_new(entry, data, stacksize, stack)