diff --git a/arch/arm/src/common/up_createstack.c b/arch/arm/src/common/up_createstack.c index 12d4575e3d..eb5986835f 100644 --- a/arch/arm/src/common/up_createstack.c +++ b/arch/arm/src/common/up_createstack.c @@ -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); diff --git a/arch/arm/src/common/up_usestack.c b/arch/arm/src/common/up_usestack.c index 5dea96be4e..887387976a 100644 --- a/arch/arm/src/common/up_usestack.c +++ b/arch/arm/src/common/up_usestack.c @@ -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;