proc_exit(): Free the correct stack base pointer.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Sun, 24 Aug 2008 06:37:08 +0000 (06:37 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Sun, 24 Aug 2008 06:37:08 +0000 (06:37 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1678 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/proc.c

index 0e3edbea37e368bfac54003ee9667d1cc0c7f042..c3d89b4315d499048b1a859e044dd7c2b6f61305 100644 (file)
@@ -286,10 +286,8 @@ void proc_exit(void)
 #endif
 
 #if (ARCH & ARCH_EMUL)
-#warning This is wrong
        /* Reinsert process stack in free list */
-       PROC_ATOMIC(ADDHEAD(&StackFreeList, (Node *)(CurrentProcess->stack
-               - (CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)))));
+       PROC_ATOMIC(ADDHEAD(&StackFreeList, (Node *)CurrentProcess->stack_base));
 
        /*
         * NOTE: At this point the first two words of what used