Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/nuttx/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,6 @@ int up_timer_start(FAR const struct timespec *ts);

#ifdef CONFIG_SCHED_THREAD_LOCAL
int up_tls_size(void);
#else
#define up_tls_size() sizeof(struct tls_info_s)
#endif

/****************************************************************************
Expand Down
1 change: 0 additions & 1 deletion libs/libc/tls/tls_getinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdint.h>
#include <assert.h>

#include <nuttx/arch.h>
#include <nuttx/tls.h>

#if !defined(up_tls_info) && (defined(__KERNEL__) || !defined(CONFIG_TLS_ALIGNED))
Expand Down
3 changes: 0 additions & 3 deletions libs/libc/unistd/lib_getoptvars.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
****************************************************************************/

#include <nuttx/config.h>

#include <assert.h>

#include <nuttx/tls.h>

#include "unistd.h"

/****************************************************************************
Expand Down
1 change: 0 additions & 1 deletion sched/group/group_leave.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
#include <nuttx/lib/lib.h>
#include <nuttx/tls.h>

#ifdef CONFIG_BINFMT_LOADABLE
# include <nuttx/binfmt/binfmt.h>
Expand Down
11 changes: 3 additions & 8 deletions sched/init/nx_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <nuttx/binfmt/binfmt.h>
#include <nuttx/drivers/drivers.h>
#include <nuttx/init.h>
#include <nuttx/tls.h>

#include "sched/sched.h"
#include "signal/signal.h"
Expand All @@ -54,6 +53,7 @@
#include "irq/irq.h"
#include "group/group.h"
#include "init/init.h"
#include "tls/tls.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down Expand Up @@ -517,7 +517,6 @@ void nx_start(void)

for (i = 0; i < CONFIG_SMP_NCPUS; i++)
{
FAR struct tls_info_s *info;
int hashndx;

/* Assign the process ID(s) of ZERO to the idle task(s) */
Expand Down Expand Up @@ -546,13 +545,9 @@ void nx_start(void)

up_initial_state(&g_idletcb[i].cmn);

/* Initialize the thread local storage
* Note: Don't copy tdata and tss for idle task to improve footprint
*/
/* Initialize the thread local storage */

info = up_stack_frame(&g_idletcb[i].cmn, sizeof(struct tls_info_s));
DEBUGASSERT(info == g_idletcb[i].cmn.stack_alloc_ptr);
info->tl_task = g_idletcb[i].cmn.group->tg_info;
tls_init_info(&g_idletcb[i].cmn);

/* Complete initialization of the IDLE group. Suppress retention
* of child status in the IDLE group.
Expand Down
1 change: 0 additions & 1 deletion sched/pthread/pthread_cancel.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <assert.h>
#include <errno.h>

#include <nuttx/tls.h>
#include <nuttx/pthread.h>

#include "sched/sched.h"
Expand Down
1 change: 0 additions & 1 deletion sched/pthread/pthread_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#include <nuttx/arch.h>
#include <nuttx/signal.h>
#include <nuttx/tls.h>

#include "sched/sched.h"
#include "task/task.h"
Expand Down
3 changes: 0 additions & 3 deletions sched/task/task_vfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#include <queue.h>
#include <debug.h>

#include <nuttx/sched.h>
#include <nuttx/tls.h>

#include "sched/sched.h"
#include "environ/environ.h"
#include "group/group.h"
Expand Down
1 change: 0 additions & 1 deletion sched/tls/task_initinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <nuttx/kmalloc.h>
#include <nuttx/semaphore.h>
#include <nuttx/tls.h>

#include "tls.h"

Expand Down
1 change: 0 additions & 1 deletion sched/tls/task_uninitinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <nuttx/kmalloc.h>
#include <nuttx/semaphore.h>
#include <nuttx/tls.h>

#include "tls.h"

Expand Down
18 changes: 18 additions & 0 deletions sched/tls/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,29 @@
****************************************************************************/

#include <nuttx/sched.h>
#include <nuttx/tls.h>

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

/****************************************************************************
* Name: up_tls_size
*
* Description:
* Get TLS (sizeof(struct tls_info_s) + tdata + tbss) section size.
*
* Returned Value:
* Size of (sizeof(struct tls_info_s) + tdata + tbss).
*
****************************************************************************/

#ifdef CONFIG_SCHED_THREAD_LOCAL
# define tls_info_size() up_tls_size()
#else
# define tls_info_size() sizeof(struct tls_info_s)
#endif

/****************************************************************************
* Name: task_init_info
*
Expand Down
7 changes: 2 additions & 5 deletions sched/tls/tls_dupinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include <errno.h>
#include <string.h>

#include <nuttx/arch.h>
#include <nuttx/tls.h>

#include "tls.h"

/****************************************************************************
Expand Down Expand Up @@ -56,7 +53,7 @@ int tls_dup_info(FAR struct tcb_s *dst, FAR struct tcb_s *src)

/* Allocate thread local storage */

info = up_stack_frame(dst, up_tls_size());
info = up_stack_frame(dst, tls_info_size());
if (info == NULL)
{
return -ENOMEM;
Expand All @@ -66,7 +63,7 @@ int tls_dup_info(FAR struct tcb_s *dst, FAR struct tcb_s *src)

/* Copy thread local storage */

memcpy(info, src->stack_alloc_ptr, sizeof(struct tls_info_s));
memcpy(info, src->stack_alloc_ptr, tls_info_size());

/* Attach per-task info in group to TLS */

Expand Down
5 changes: 1 addition & 4 deletions sched/tls/tls_initinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#include <assert.h>
#include <errno.h>

#include <nuttx/arch.h>
#include <nuttx/tls.h>

#include "tls.h"

/****************************************************************************
Expand All @@ -54,7 +51,7 @@ int tls_init_info(FAR struct tcb_s *tcb)

/* Allocate thread local storage */

info = up_stack_frame(tcb, up_tls_size());
info = up_stack_frame(tcb, tls_info_size());
if (info == NULL)
{
return -ENOMEM;
Expand Down