Skip to content

Commit

Permalink
arch/arm/src/common: add heapinfo_set_stack_node function in up_vfork.c
Browse files Browse the repository at this point in the history
If stack node, pid is negative number in heapinfo.
vfork() function create stack, but doesn't update pid of stack node heapinfo.

Therefore, this commit adds heapinfo_set_stack_node() to update the pid of stack node.

Signed-off-by: eunwoo.nam <[email protected]>
  • Loading branch information
ewoodev authored and sunghan-chang committed Mar 31, 2023
1 parent a5142a0 commit 2f9131e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions os/arch/arm/src/common/up_vfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
#include <tinyara/arch.h>
#include <arch/irq.h>

#ifdef CONFIG_DEBUG_MM_HEAPINFO
#include <tinyara/mm/mm.h>
#endif

#include "up_vfork.h"
#include "sched/sched.h"

Expand Down Expand Up @@ -182,6 +186,11 @@ pid_t up_vfork(const struct vfork_s *context)
return (pid_t)ERROR;
}

#ifdef CONFIG_DEBUG_MM_HEAPINFO
/* Update the pid information in stack node */
heapinfo_set_stack_node(child->cmn.stack_alloc_ptr, child->cmn.pid);
#endif

/* How much of the parent's stack was utilized? The ARM uses
* a push-down stack so that the current stack pointer should
* be lower than the initial, adjusted stack pointer. The
Expand Down

0 comments on commit 2f9131e

Please sign in to comment.