Skip to content
Snippets Groups Projects
Commit 05d20363 authored by ziggurat29's avatar ziggurat29
Browse files

complete logic in 'create stack' and 'use stack' to support stack coloration. ...

complete logic in 'create stack' and 'use stack' to support stack coloration.  Fix some booboos breaking compatibility with TLS in libc.
parent e68ba11f
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (tcb->stack_alloc_ptr)
{
#if defined(CONFIG_TLS) && defined(CONFIG_STACK_COLORATION)
uinptr_t stack_base;
uintptr_t stack_base;
#endif
size_t top_of_stack;
size_t size_of_stack;
......@@ -264,7 +264,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
* water marks.
*/
stackbase = (uintptr_t)tcb->stack_alloc_ptr + sizeof(struct tls_info_s);
stack_base = (uintptr_t)tcb->stack_alloc_ptr + sizeof(struct tls_info_s);
stack_size = tcb->adj_stack_size - sizeof(struct tls_info_s);
up_stack_color((FAR void *)stack_base, stack_size);
......
......@@ -174,7 +174,13 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
* value that we can use later to test for high water marks.
*/
# warning Missing logic
#ifdef CONFIG_TLS
up_stack_color(
(FAR void *)((uintptr_t)tcb->stack_alloc_ptr + sizeof(struct tls_info_s)),
tcb->adj_stack_size - sizeof(struct tls_info_s));
#else
up_stack_color(tcb->stack_alloc_ptr, tcb->adj_stack_size);
#endif
#endif
return OK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment