You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/03 20:56:59 UTC

[incubator-nuttx] 02/05: sched/tls: Don't compensate the tls size to the stack size

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 33a6aa2f48a9ade5398f28d830ab435c41a304dd
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun May 29 05:38:37 2022 +0800

    sched/tls: Don't compensate the tls size to the stack size
    
    it isn't good to change the stack size passed by caller
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/pthread/pthread_create.c | 3 +--
 sched/task/task_init.c         | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c
index c0fd3dd5aa..9bbabb6e97 100644
--- a/sched/pthread/pthread_create.c
+++ b/sched/pthread/pthread_create.c
@@ -291,8 +291,7 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
     {
       /* Allocate the stack for the TCB */
 
-      ret = up_create_stack((FAR struct tcb_s *)ptcb,
-                            up_tls_size() + attr->stacksize,
+      ret = up_create_stack((FAR struct tcb_s *)ptcb, attr->stacksize,
                             TCB_FLAG_TTYPE_PTHREAD);
     }
 
diff --git a/sched/task/task_init.c b/sched/task/task_init.c
index 5cbb774fba..270b858893 100644
--- a/sched/task/task_init.c
+++ b/sched/task/task_init.c
@@ -131,9 +131,7 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
     {
       /* Allocate the stack for the TCB */
 
-      ret = up_create_stack(&tcb->cmn,
-                            up_tls_size() + stack_size,
-                            ttype);
+      ret = up_create_stack(&tcb->cmn, stack_size, ttype);
     }
 
   if (ret < OK)