From: asterix Date: Tue, 15 Sep 2009 08:27:27 +0000 (+0000) Subject: Add macro for define process stack. X-Git-Tag: 2.2.0~31 X-Git-Url: https://codewiz.org/gitweb?p=bertos.git;a=commitdiff_plain;h=a826f128ef56409cf87f60a0748bae388ccf42de Add macro for define process stack. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2937 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index b396a2c9..45949e8e 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -56,6 +56,16 @@ #include // cpu_stack_t #include // 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.