From a826f128ef56409cf87f60a0748bae388ccf42de Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 15 Sep 2009 08:27:27 +0000 Subject: [PATCH] Add macro for define process stack. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2937 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/kern/proc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- 2.25.1