Remove CONFIG_TLS
A first step in implementing the user-space error is force TLS to be enabled at all times. It is no longer optional
This commit is contained in:
parent
1ad03a5a13
commit
c2244a2382
54 changed files with 15 additions and 225 deletions
2
TODO
2
TODO
|
@ -1029,7 +1029,7 @@ o Kernel/Protected Build
|
||||||
would not be an issue in the more general case.
|
would not be an issue in the more general case.
|
||||||
|
|
||||||
Update:
|
Update:
|
||||||
One solution might be to used CONFIG_TLS, add the PID to struct
|
One solution might be to use TLS, add the PID to struct
|
||||||
tls_info_s. Then the PID could be obtained without a system call.
|
tls_info_s. Then the PID could be obtained without a system call.
|
||||||
TLS is not very useful in the FLAT build, however. TLS works by
|
TLS is not very useful in the FLAT build, however. TLS works by
|
||||||
putting per-thread data at the bottom of an aligned stack. The
|
putting per-thread data at the bottom of an aligned stack. The
|
||||||
|
|
|
@ -10,7 +10,6 @@ choice
|
||||||
config ARCH_ARM
|
config ARCH_ARM
|
||||||
bool "ARM"
|
bool "ARM"
|
||||||
select ARCH_HAVE_INTERRUPTSTACK
|
select ARCH_HAVE_INTERRUPTSTACK
|
||||||
select ARCH_HAVE_TLS
|
|
||||||
select ARCH_HAVE_VFORK
|
select ARCH_HAVE_VFORK
|
||||||
select ARCH_HAVE_STACKCHECK
|
select ARCH_HAVE_STACKCHECK
|
||||||
select ARCH_HAVE_CUSTOMOPT
|
select ARCH_HAVE_CUSTOMOPT
|
||||||
|
@ -68,7 +67,6 @@ config ARCH_SIM
|
||||||
bool "Simulation"
|
bool "Simulation"
|
||||||
select ARCH_HAVE_MULTICPU
|
select ARCH_HAVE_MULTICPU
|
||||||
select ARCH_HAVE_RTC_SUBSECONDS
|
select ARCH_HAVE_RTC_SUBSECONDS
|
||||||
select ARCH_HAVE_TLS
|
|
||||||
select ARCH_HAVE_TICKLESS
|
select ARCH_HAVE_TICKLESS
|
||||||
select ARCH_HAVE_POWEROFF
|
select ARCH_HAVE_POWEROFF
|
||||||
select ARCH_HAVE_TESTSET
|
select ARCH_HAVE_TESTSET
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -92,5 +90,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_ARM_INCLUDE_TLS_H */
|
#endif /* __ARCH_ARM_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -102,7 +102,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -117,7 +116,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -190,7 +188,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
|
|
||||||
if (tcb->stack_alloc_ptr)
|
if (tcb->stack_alloc_ptr)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TLS) && defined(CONFIG_STACK_COLORATION)
|
#if defined(CONFIG_STACK_COLORATION)
|
||||||
uintptr_t stack_base;
|
uintptr_t stack_base;
|
||||||
#endif
|
#endif
|
||||||
size_t top_of_stack;
|
size_t top_of_stack;
|
||||||
|
@ -224,7 +222,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
|
@ -242,17 +239,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
arm_stack_color((FAR void *)stack_base, stack_size);
|
arm_stack_color((FAR void *)stack_base, stack_size);
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
#endif /* CONFIG_STACK_COLORATION */
|
||||||
#else /* CONFIG_TLS */
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
|
||||||
/* If stack debug is enabled, then fill the stack with a
|
|
||||||
* recognizable value that we can use later to test for high
|
|
||||||
* water marks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
arm_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -137,24 +137,18 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
/* If stack debug is enabled, then fill the stack with a recognizable
|
/* If stack debug is enabled, then fill the stack with a recognizable
|
||||||
* value that we can use later to test for high water marks.
|
* value that we can use later to test for high water marks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
arm_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr +
|
arm_stack_color((FAR void *)((uintptr_t)tcb->stack_alloc_ptr +
|
||||||
sizeof(struct tls_info_s)),
|
sizeof(struct tls_info_s)),
|
||||||
tcb->adj_stack_size - sizeof(struct tls_info_s));
|
tcb->adj_stack_size - sizeof(struct tls_info_s));
|
||||||
#else
|
|
||||||
arm_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,5 +72,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_AVR_INCLUDE_TLS_H */
|
#endif /* __ARCH_AVR_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -101,7 +101,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -116,7 +115,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -139,6 +137,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
* then create a zeroed stack to make stack dumps easier to trace.
|
* then create a zeroed stack to make stack dumps easier to trace.
|
||||||
* If TLS is enabled, then we must allocate aligned stacks.
|
* If TLS is enabled, then we must allocate aligned stacks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_TLS_ALIGNED
|
#ifdef CONFIG_TLS_ALIGNED
|
||||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||||
/* Use the kernel allocator if this is a kernel thread */
|
/* Use the kernel allocator if this is a kernel thread */
|
||||||
|
@ -212,11 +211,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
||||||
tcb->adj_stack_size = stack_size;
|
tcb->adj_stack_size = stack_size;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ARCH_HAVE_LEDS)
|
#if defined(ARCH_HAVE_LEDS)
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
|
|
|
@ -135,11 +135,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
||||||
tcb->adj_stack_size = stack_size;
|
tcb->adj_stack_size = stack_size;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -121,7 +120,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -226,11 +224,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -144,11 +144,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR void *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -89,5 +87,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_HC_INCLUDE_TLS_H */
|
#endif /* __ARCH_HC_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -103,7 +103,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -118,7 +117,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -225,11 +223,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -135,11 +135,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -89,5 +87,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_MIPS_INCLUDE_TLS_H */
|
#endif /* __ARCH_MIPS_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -124,7 +124,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -139,7 +138,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -252,11 +250,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -161,11 +161,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -87,5 +85,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_MISOC_INCLUDE_TLS_H */
|
#endif /* __ARCH_MISOC_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -124,7 +124,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -139,7 +138,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -245,11 +243,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -116,7 +116,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -131,7 +130,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -238,11 +236,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR uint32_t *) top_of_stack;
|
tcb->adj_stack_ptr = (FAR uint32_t *) top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -91,5 +89,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_OR1K_INCLUDE_TLS_H */
|
#endif /* __ARCH_OR1K_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -97,7 +97,6 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack)
|
||||||
|
|
||||||
/* Get aligned addresses of the top and bottom of the stack */
|
/* Get aligned addresses of the top and bottom of the stack */
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
if (!int_stack)
|
if (!int_stack)
|
||||||
{
|
{
|
||||||
/* Skip over the TLS data structure at the bottom of the stack */
|
/* Skip over the TLS data structure at the bottom of the stack */
|
||||||
|
@ -109,10 +108,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack)
|
||||||
{
|
{
|
||||||
start = alloc & ~3;
|
start = alloc & ~3;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
UNUSED(int_stack);
|
|
||||||
start = alloc & ~3;
|
|
||||||
#endif
|
|
||||||
end = (alloc + size + 3) & ~3;
|
end = (alloc + size + 3) & ~3;
|
||||||
|
|
||||||
/* Get the adjusted size based on the top and bottom of the stack */
|
/* Get the adjusted size based on the top and bottom of the stack */
|
||||||
|
|
|
@ -117,7 +117,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -132,7 +131,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -205,7 +203,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
|
|
||||||
if (tcb->stack_alloc_ptr)
|
if (tcb->stack_alloc_ptr)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TLS) && defined(CONFIG_STACK_COLORATION)
|
#if defined(CONFIG_STACK_COLORATION)
|
||||||
uintptr_t stack_base;
|
uintptr_t stack_base;
|
||||||
#endif
|
#endif
|
||||||
size_t top_of_stack;
|
size_t top_of_stack;
|
||||||
|
@ -220,7 +218,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
|
@ -238,17 +235,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
up_stack_color((FAR void *)stack_base, stack_size);
|
up_stack_color((FAR void *)stack_base, stack_size);
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
#endif /* CONFIG_STACK_COLORATION */
|
||||||
#else /* CONFIG_TLS */
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
|
||||||
/* If stack debug is enabled, then fill the stack with a
|
|
||||||
* recognizable value that we can use later to test for high
|
|
||||||
* water marks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
up_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,5 +72,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_RENESAS_INCLUDE_TLS_H */
|
#endif /* __ARCH_RENESAS_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -103,7 +103,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -118,7 +117,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -225,11 +223,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -134,11 +134,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = top_of_stack;
|
tcb->adj_stack_ptr = top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,5 +72,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_RISCV_INCLUDE_TLS_H */
|
#endif /* __ARCH_RISCV_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -91,7 +91,6 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack)
|
||||||
|
|
||||||
/* Get aligned addresses of the top and bottom of the stack */
|
/* Get aligned addresses of the top and bottom of the stack */
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
if (!int_stack)
|
if (!int_stack)
|
||||||
{
|
{
|
||||||
/* Skip over the TLS data structure at the bottom of the stack */
|
/* Skip over the TLS data structure at the bottom of the stack */
|
||||||
|
@ -103,10 +102,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack)
|
||||||
{
|
{
|
||||||
start = alloc & ~3;
|
start = alloc & ~3;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
UNUSED(int_stack);
|
|
||||||
start = alloc & ~3;
|
|
||||||
#endif
|
|
||||||
end = (alloc + size + 3) & ~3;
|
end = (alloc + size + 3) & ~3;
|
||||||
|
|
||||||
/* Get the adjusted size based on the top and bottom of the stack */
|
/* Get the adjusted size based on the top and bottom of the stack */
|
||||||
|
|
|
@ -124,7 +124,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -139,7 +138,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -212,7 +210,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
|
|
||||||
if (tcb->stack_alloc_ptr)
|
if (tcb->stack_alloc_ptr)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TLS) && defined(CONFIG_STACK_COLORATION)
|
#if defined(CONFIG_STACK_COLORATION)
|
||||||
uintptr_t stack_base;
|
uintptr_t stack_base;
|
||||||
#endif
|
#endif
|
||||||
size_t top_of_stack;
|
size_t top_of_stack;
|
||||||
|
@ -240,7 +238,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
|
@ -258,16 +255,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
riscv_stack_color((FAR void *)stack_base, stack_size);
|
riscv_stack_color((FAR void *)stack_base, stack_size);
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
#endif /* CONFIG_STACK_COLORATION */
|
||||||
#else /* CONFIG_TLS */
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
|
||||||
/* If stack debug is enabled, then fill the stack with a
|
|
||||||
* recognizable value that we can use later to test for high
|
|
||||||
* water marks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
up_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -155,11 +155,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uintptr_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uintptr_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -73,5 +71,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_SIM_INCLUDE_TLS_H */
|
#endif /* __ARCH_SIM_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -106,7 +106,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
FAR uint8_t *stack_alloc_ptr;
|
FAR uint8_t *stack_alloc_ptr;
|
||||||
int ret = ERROR;
|
int ret = ERROR;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -121,7 +120,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Move up to next even word boundary if necessary */
|
/* Move up to next even word boundary if necessary */
|
||||||
|
@ -133,15 +131,15 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
#ifdef CONFIG_TLS_ALIGNED
|
#ifdef CONFIG_TLS_ALIGNED
|
||||||
stack_alloc_ptr = (FAR uint8_t *)kumm_memalign(TLS_STACK_ALIGN,
|
stack_alloc_ptr = (FAR uint8_t *)kumm_memalign(TLS_STACK_ALIGN,
|
||||||
adj_stack_size);
|
adj_stack_size);
|
||||||
#else /* CONFIG_TLS */
|
#else
|
||||||
stack_alloc_ptr = (FAR uint8_t *)kumm_malloc(adj_stack_size);
|
stack_alloc_ptr = (FAR uint8_t *)kumm_malloc(adj_stack_size);
|
||||||
#endif /* CONFIG_TLS */
|
#endif
|
||||||
|
|
||||||
/* Was the allocation successful? */
|
/* Was the allocation successful? */
|
||||||
|
|
||||||
if (stack_alloc_ptr)
|
if (stack_alloc_ptr)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TLS) && defined(CONFIG_STACK_COLORATION)
|
#if defined(CONFIG_STACK_COLORATION)
|
||||||
uintptr_t stack_base;
|
uintptr_t stack_base;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -160,7 +158,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->stack_alloc_ptr = stack_alloc_ptr;
|
tcb->stack_alloc_ptr = stack_alloc_ptr;
|
||||||
tcb->adj_stack_ptr = (FAR void *)adj_stack_addr;
|
tcb->adj_stack_ptr = (FAR void *)adj_stack_addr;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
|
@ -177,17 +174,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
up_stack_color((FAR void *)stack_base, stack_size);
|
up_stack_color((FAR void *)stack_base, stack_size);
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
#endif /* CONFIG_STACK_COLORATION */
|
||||||
#else /* CONFIG_TLS */
|
|
||||||
#ifdef CONFIG_STACK_COLORATION
|
|
||||||
/* If stack debug is enabled, then fill the stack with a
|
|
||||||
* recognizable value that we can use later to test for high
|
|
||||||
* water marks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
up_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
|
|
||||||
|
|
||||||
#endif /* CONFIG_STACK_COLORATION */
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
|
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,11 +126,9 @@ int up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size)
|
||||||
tcb->stack_alloc_ptr = stack;
|
tcb->stack_alloc_ptr = stack;
|
||||||
tcb->adj_stack_ptr = (FAR void *)adj_stack_addr;
|
tcb->adj_stack_ptr = (FAR void *)adj_stack_addr;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(stack, 0, sizeof(struct tls_info_s));
|
memset(stack, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,5 +72,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_X86_INCLUDE_TLS_H */
|
#endif /* __ARCH_X86_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -105,7 +105,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -120,7 +119,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -225,11 +223,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -134,11 +134,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,5 +72,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_X86_64_INCLUDE_TLS_H */
|
#endif /* __ARCH_X86_64_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -105,7 +104,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -213,11 +211,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint64_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint64_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -122,11 +122,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint64_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint64_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -91,5 +89,4 @@ static inline FAR struct tls_info_s *up_tls_info(void)
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_XTENSA_INCLUDE_TLS_H */
|
#endif /* __ARCH_XTENSA_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -91,14 +91,10 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size)
|
||||||
|
|
||||||
/* Get aligned addresses of the top and bottom of the stack */
|
/* Get aligned addresses of the top and bottom of the stack */
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Skip over the TLS data structure at the bottom of the stack */
|
/* Skip over the TLS data structure at the bottom of the stack */
|
||||||
|
|
||||||
DEBUGASSERT((alloc & TLS_STACK_MASK) == 0);
|
DEBUGASSERT((alloc & TLS_STACK_MASK) == 0);
|
||||||
start = alloc + sizeof(struct tls_info_s);
|
start = alloc + sizeof(struct tls_info_s);
|
||||||
#else
|
|
||||||
start = alloc & ~3;
|
|
||||||
#endif
|
|
||||||
end = (alloc + size + 3) & ~3;
|
end = (alloc + size + 3) & ~3;
|
||||||
|
|
||||||
/* Get the adjusted size based on the top and bottom of the stack */
|
/* Get the adjusted size based on the top and bottom of the stack */
|
||||||
|
|
|
@ -121,7 +121,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
uintptr_t cpstart;
|
uintptr_t cpstart;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -136,7 +135,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -287,11 +285,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -147,11 +147,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -70,5 +68,4 @@
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_Z16_INCLUDE_TLS_H */
|
#endif /* __ARCH_Z16_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -84,7 +84,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -99,7 +98,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -204,11 +202,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -119,11 +119,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_size = top_of_stack;
|
tcb->adj_stack_size = top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -70,5 +68,4 @@
|
||||||
# define up_tls_info() tls_get_info()
|
# define up_tls_info() tls_get_info()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __ARCH_Z80_INCLUDE_TLS_H */
|
#endif /* __ARCH_Z80_INCLUDE_TLS_H */
|
||||||
|
|
|
@ -88,7 +88,6 @@
|
||||||
|
|
||||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Add the size of the TLS information structure */
|
/* Add the size of the TLS information structure */
|
||||||
|
|
||||||
stack_size += sizeof(struct tls_info_s);
|
stack_size += sizeof(struct tls_info_s);
|
||||||
|
@ -103,7 +102,6 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
{
|
{
|
||||||
stack_size = TLS_MAXSTACK;
|
stack_size = TLS_MAXSTACK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is there already a stack allocated of a different size? Because of
|
/* Is there already a stack allocated of a different size? Because of
|
||||||
|
@ -209,11 +207,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||||
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
tcb->adj_stack_ptr = (FAR uint32_t *)top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
board_autoled_on(LED_STACKCREATED);
|
board_autoled_on(LED_STACKCREATED);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
@ -118,11 +118,9 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
|
||||||
tcb->adj_stack_size = top_of_stack;
|
tcb->adj_stack_size = top_of_stack;
|
||||||
tcb->adj_stack_size = size_of_stack;
|
tcb->adj_stack_size = size_of_stack;
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* Initialize the TLS data structure */
|
/* Initialize the TLS data structure */
|
||||||
|
|
||||||
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
memset(tcb->stack_alloc_ptr, 0, sizeof(struct tls_info_s));
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1695,14 +1695,12 @@ int up_timer_start(FAR const struct timespec *ts);
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
/* struct tls_info_s;
|
/* struct tls_info_s;
|
||||||
* FAR struct tls_info_s *up_tls_info(void);
|
* FAR struct tls_info_s *up_tls_info(void);
|
||||||
*
|
*
|
||||||
* The actual declaration or definition is provided in arch/tls.h. The
|
* The actual declaration or definition is provided in arch/tls.h. The
|
||||||
* actual implementation may be a MACRO or and inline function.
|
* actual implementation may be a MACRO or and inline function.
|
||||||
*/
|
*/
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Multiple CPU support
|
* Multiple CPU support
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -148,5 +146,4 @@ void tls_set_element(int elem, uintptr_t value);
|
||||||
FAR struct tls_info_s *tls_get_info(void);
|
FAR struct tls_info_s *tls_get_info(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
|
||||||
#endif /* __INCLUDE_NUTTX_TLS_H */
|
#endif /* __INCLUDE_NUTTX_TLS_H */
|
||||||
|
|
|
@ -3,23 +3,7 @@
|
||||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
#
|
#
|
||||||
|
|
||||||
config ARCH_HAVE_TLS
|
|
||||||
bool
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Selected by the configuration system if the current architecture
|
|
||||||
supports TLS.
|
|
||||||
|
|
||||||
menu "Thread Local Storage (TLS)"
|
menu "Thread Local Storage (TLS)"
|
||||||
depends on ARCH_HAVE_TLS
|
|
||||||
|
|
||||||
config TLS
|
|
||||||
bool "Thread Local Storage (TLS)"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Build in support for stack based thread local storage (TLS).
|
|
||||||
|
|
||||||
if TLS
|
|
||||||
|
|
||||||
config TLS_ALIGNED
|
config TLS_ALIGNED
|
||||||
bool "Require stack alignment"
|
bool "Require stack alignment"
|
||||||
|
@ -66,5 +50,4 @@ config TLS_NELEM
|
||||||
The number of unique TLS elements. These can be accessed with
|
The number of unique TLS elements. These can be accessed with
|
||||||
the user library functions tls_get_element() and tls_set_element().
|
the user library functions tls_get_element() and tls_set_element().
|
||||||
|
|
||||||
endif # TLS
|
|
||||||
endmenu # Thread Local Storage (TLS)
|
endmenu # Thread Local Storage (TLS)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
ifeq ($(CONFIG_TLS),y)
|
ifneq ($(CONFIG_TLS_NELEM),0)
|
||||||
|
|
||||||
CSRCS += tls_setelem.c tls_getelem.c
|
CSRCS += tls_setelem.c tls_getelem.c
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
#include <arch/tls.h>
|
#include <arch/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
#if CONFIG_TLS_NELEM > 0
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
@ -75,4 +75,4 @@ uintptr_t tls_get_element(int elem)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
#endif /* CONFIG_TLS_NELEM > 0 */
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <nuttx/tls.h>
|
#include <nuttx/tls.h>
|
||||||
#include <arch/tls.h>
|
#include <arch/tls.h>
|
||||||
|
|
||||||
#ifdef CONFIG_TLS
|
#if CONFIG_TLS_NELEM > 0
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
@ -71,4 +71,4 @@ void tls_set_element(int elem, uintptr_t value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_TLS */
|
#endif /* CONFIG_TLS_NELEM > 0 */
|
||||||
|
|
Loading…
Reference in a new issue