sched/tls: Shouldn't get tls info directly from sp in kernel space

since the stack may switch to the kernel or interrupt stack

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-06-07 06:43:28 +08:00 committed by Masayuki Ishikawa
parent 114758e518
commit 2707ba58d2
2 changed files with 3 additions and 3 deletions

View File

@ -304,7 +304,7 @@ uintptr_t task_tls_get_value(int tlsindex);
#if defined(up_tls_info)
# define tls_get_info() up_tls_info()
#elif defined(CONFIG_TLS_ALIGNED)
#elif defined(CONFIG_TLS_ALIGNED) && !defined(__KERNEL__)
# define tls_get_info() TLS_INFO(up_getsp())
#else
FAR struct tls_info_s *tls_get_info(void);

View File

@ -30,7 +30,7 @@
#include <nuttx/arch.h>
#include <nuttx/tls.h>
#if !defined(up_tls_info) && !defined(CONFIG_TLS_ALIGNED)
#if !defined(up_tls_info) && (defined(__KERNEL__) || !defined(CONFIG_TLS_ALIGNED))
/****************************************************************************
* Public Functions
@ -72,4 +72,4 @@ FAR struct tls_info_s *tls_get_info(void)
return info;
}
#endif /* !defined(up_tls_info) && !defined(CONFIG_TLS_ALIGNED) */
#endif /* !defined(up_tls_info) && (defined(__KERNEL__) || !defined(CONFIG_TLS_ALIGNED)) */