taks_exithook: fix the build error when enable CONFIG_SCHED_DUMP_LEAK

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6 2023-05-16 23:45:23 +08:00 committed by Xiang Xiao
parent 940bbfc720
commit 4b8db6f22c

View file

@ -409,6 +409,17 @@ static inline void nxtask_exitwakeup(FAR struct tcb_s *tcb, int status)
void nxtask_exithook(FAR struct tcb_s *tcb, int status)
{
#ifdef CONFIG_SCHED_DUMP_LEAK
struct mm_memdump_s dump =
{
tcb->pid,
# if CONFIG_MM_BACKTRACE >= 0
0,
ULONG_MAX
# endif
};
#endif
/* Under certain conditions, nxtask_exithook() can be called multiple
* times. A bit in the TCB was set the first time this function was
* called. If that bit is set, then just exit doing nothing more..
@ -463,11 +474,11 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
#ifdef CONFIG_SCHED_DUMP_LEAK
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL)
{
kmm_memdump(tcb->pid);
kmm_memdump(&dump);
}
else
{
umm_memdump(tcb->pid);
umm_memdump(&dump);
}
#endif