proc_new(): Rename proc_size_words to PROC_SIZE_WORDS and make it const
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 7 Aug 2008 09:40:57 +0000 (09:40 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 7 Aug 2008 09:40:57 +0000 (09:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1560 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/proc.c

index 1d36ab0b16cdb482c65d894470d892e36f482a0d..800fc8e1fb0f532ec5d441e679b89213afe584dd 100644 (file)
@@ -145,7 +145,7 @@ struct Process *proc_new_with_name(UNUSED(const char *, name), void (*entry)(voi
 {
        Process *proc;
        size_t i;
-       size_t proc_size_words = ROUND2(sizeof(Process), sizeof(cpustack_t)) / sizeof(cpustack_t);
+       const size_t PROC_SIZE_WORDS = ROUND2(sizeof(Process), sizeof(cpustack_t)) / sizeof(cpustack_t);
 #if CONFIG_KERN_HEAP
        bool free_stack = false;
 #endif
@@ -184,13 +184,13 @@ struct Process *proc_new_with_name(UNUSED(const char *, name), void (*entry)(voi
        if (CPU_STACK_GROWS_UPWARD)
        {
                proc = (Process*)stack_base;
-               proc->stack = stack_base + proc_size_words;
+               proc->stack = stack_base + PROC_SIZE_WORDS;
                if (CPU_SP_ON_EMPTY_SLOT)
                        proc->stack++;
        }
        else
        {
-               proc = (Process*)(stack_base + stack_size / sizeof(cpustack_t) - proc_size_words);
+               proc = (Process*)(stack_base + stack_size / sizeof(cpustack_t) - PROC_SIZE_WORDS);
                proc->stack = (cpustack_t*)proc;
                if (CPU_SP_ON_EMPTY_SLOT)
                        proc->stack--;