From 47a9cfcdead541aeaff4f6ad4039c41024568d62 Mon Sep 17 00:00:00 2001 From: bernie Date: Thu, 7 Aug 2008 09:40:57 +0000 Subject: [PATCH] proc_new(): Rename proc_size_words to PROC_SIZE_WORDS and make it const git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1560 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/kern/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bertos/kern/proc.c b/bertos/kern/proc.c index 1d36ab0b..800fc8e1 100644 --- a/bertos/kern/proc.c +++ b/bertos/kern/proc.c @@ -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--; -- 2.25.1