This is an automated email from the ASF dual-hosted git repository.
gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b1879d5 sched/vfork: allocate tls_info_s instead task_info_s from
stack
b1879d5 is described below
commit b1879d5d24e4be8d08161a29f493e16dc76d4344
Author: Xiang Xiao <[email protected]>
AuthorDate: Tue Nov 2 02:35:52 2021 +0800
sched/vfork: allocate tls_info_s instead task_info_s from stack
Signed-off-by: Xiang Xiao <[email protected]>
---
sched/task/task_vfork.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c
index 08df67e..942f837 100644
--- a/sched/task/task_vfork.c
+++ b/sched/task/task_vfork.c
@@ -96,7 +96,7 @@ FAR struct task_tcb_s *nxtask_setup_vfork(start_t retaddr)
FAR struct tcb_s *ptcb = this_task();
FAR struct task_tcb_s *parent;
FAR struct task_tcb_s *child;
- FAR struct task_info_s *info;
+ FAR struct tls_info_s *info;
size_t stack_size;
uint8_t ttype;
int priority;
@@ -173,7 +173,7 @@ FAR struct task_tcb_s *nxtask_setup_vfork(start_t retaddr)
/* Setup thread local storage */
- info = up_stack_frame(&child->cmn, sizeof(struct task_info_s));
+ info = up_stack_frame(&child->cmn, sizeof(struct tls_info_s));
if (info == NULL)
{
ret = -ENOMEM;
@@ -181,7 +181,8 @@ FAR struct task_tcb_s *nxtask_setup_vfork(start_t retaddr)
}
DEBUGASSERT(info == child->cmn.stack_alloc_ptr);
- memcpy(info, parent->cmn.stack_alloc_ptr, sizeof(struct task_info_s));
+ memcpy(info, parent->cmn.stack_alloc_ptr, sizeof(struct tls_info_s));
+ info->tl_task = child->cmn.group->tg_info;
/* Get the priority of the parent task */