libc/tls: Make tls_get_info as the pulibc function instead up_tls_info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-05-27 10:05:43 +08:00
committed by Petro Karashchenko
parent 33a6aa2f48
commit 3e32b605fe
17 changed files with 26 additions and 34 deletions
+1 -2
View File
@@ -24,7 +24,6 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include <nuttx/tls.h>
/****************************************************************************
@@ -57,7 +56,7 @@ FAR int *__errno(void)
{
/* Get the TLS tls_info_s structure instance for this thread */
FAR struct tls_info_s *tlsinfo = up_tls_info();
FAR struct tls_info_s *tlsinfo = tls_get_info();
/* And return the return refernce to the error number */
+2 -3
View File
@@ -28,7 +28,6 @@
#include <sched.h>
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include <nuttx/tls.h>
#include <nuttx/pthread.h>
@@ -119,7 +118,7 @@ static void pthread_cleanup_pop_tls(FAR struct tls_info_s *tls, int execute)
void pthread_cleanup_pop(int execute)
{
FAR struct tls_info_s *tls = up_tls_info();
FAR struct tls_info_s *tls = tls_get_info();
DEBUGASSERT(tls != NULL);
@@ -135,7 +134,7 @@ void pthread_cleanup_pop(int execute)
void pthread_cleanup_push(pthread_cleanup_t routine, FAR void *arg)
{
FAR struct tls_info_s *tls = up_tls_info();
FAR struct tls_info_s *tls = tls_get_info();
DEBUGASSERT(tls != NULL);
DEBUGASSERT(tls->tos < CONFIG_PTHREAD_CLEANUP_STACKSIZE);
+1 -2
View File
@@ -28,7 +28,6 @@
#include <debug.h>
#include <sched.h>
#include <nuttx/arch.h>
#include <nuttx/pthread.h>
#include <nuttx/tls.h>
@@ -64,7 +63,7 @@ void pthread_exit(FAR void *exit_value)
#endif
#ifdef CONFIG_PTHREAD_CLEANUP
pthread_cleanup_popall(up_tls_info());
pthread_cleanup_popall(tls_get_info());
#endif
#if CONFIG_TLS_NELEM > 0
+1 -2
View File
@@ -27,7 +27,6 @@
#include <pthread.h>
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/tls.h>
#if CONFIG_TLS_NELEM > 0
@@ -71,7 +70,7 @@ FAR void *pthread_getspecific(pthread_key_t key)
{
/* Get the TLS info structure from the current threads stack */
info = up_tls_info();
info = tls_get_info();
DEBUGASSERT(info != NULL);
/* Get the element value from the TLS info. */
+1 -2
View File
@@ -27,7 +27,6 @@
#include <pthread.h>
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/tls.h>
#if CONFIG_TLS_NELEM > 0
@@ -81,7 +80,7 @@ int pthread_setspecific(pthread_key_t key, FAR const void *value)
{
/* Get the TLS info structure from the current threads stack */
info = up_tls_info();
info = tls_get_info();
DEBUGASSERT(info != NULL);
/* Set the element value int the TLS info. */
+2 -2
View File
@@ -63,7 +63,7 @@ config TLS_TASK_NELEM
The number of unique Task Local Storage elements similar with
Thread Local Storage.
These can be accessed with task_tls_alloc/task_tls_get_value/task_tls_set_value.
NOTE that the 0 value of CONFIG_SCHED_TLS_NELEM disables these
TLS interfaces.
NOTE that the 0 value of CONFIG_SCHED_TLS_NELEM disables these
TLS interfaces.
endmenu # Thread Local Storage (TLS)
+1 -2
View File
@@ -24,7 +24,6 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include <nuttx/tls.h>
/****************************************************************************
@@ -48,7 +47,7 @@
FAR struct task_info_s *task_get_info(void)
{
FAR struct tls_info_s *info = up_tls_info();
FAR struct tls_info_s *info = tls_get_info();
return info->tl_task;
}
+1 -2
View File
@@ -26,7 +26,6 @@
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/tls.h>
#if CONFIG_TLS_NELEM > 0
@@ -52,7 +51,7 @@
void tls_destruct(void)
{
FAR struct task_info_s *info = task_get_info();
FAR struct tls_info_s *tls = up_tls_info();
FAR struct tls_info_s *tls = tls_get_info();
FAR void *tls_elem_ptr = NULL;
tls_dtor_t destructor;
tls_ndxset_t tlsset;
+2 -2
View File
@@ -30,7 +30,7 @@
#include <nuttx/arch.h>
#include <nuttx/tls.h>
#if !defined(CONFIG_TLS_ALIGNED) || defined(__KERNEL__)
#if !defined(up_tls_info) && !defined(CONFIG_TLS_ALIGNED)
/****************************************************************************
* Public Functions
@@ -72,4 +72,4 @@ FAR struct tls_info_s *tls_get_info(void)
return info;
}
#endif /* !CONFIG_TLS_ALIGNED || __KERNEL__ */
#endif /* !defined(up_tls_info) && !defined(CONFIG_TLS_ALIGNED) */