mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
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:
committed by
Petro Karashchenko
parent
33a6aa2f48
commit
3e32b605fe
@@ -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 */
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user