tls: Merge tls_xxx into pthread_keyxxx

it's always better to provide the standard api directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-05-27 04:55:42 +08:00
committed by Petro Karashchenko
parent c19d37adf0
commit bd76e69f8d
10 changed files with 128 additions and 432 deletions
-82
View File
@@ -209,88 +209,6 @@ struct tls_info_s
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: tls_alloc
*
* Description:
* Allocate a group-unique TLS data index
*
* Input Parameters:
* dtor - The destructor of TLS data element
*
* Returned Value:
* A TLS index that is unique for use within this task group.
*
****************************************************************************/
#if CONFIG_TLS_NELEM > 0
int tls_alloc(CODE void (*dtor)(FAR void *));
#endif
/****************************************************************************
* Name: tls_free
*
* Description:
* Release a group-unique TLS data index previous obtained by tls_alloc()
*
* Input Parameters:
* tlsindex - The previously allocated TLS index to be freed
*
* Returned Value:
* OK is returned on success; a negated errno value will be returned on
* failure:
*
* -EINVAL - the index to be freed is out of range.
*
****************************************************************************/
#if CONFIG_TLS_NELEM > 0
int tls_free(int tlsindex);
#endif
/****************************************************************************
* Name: tls_get_value
*
* Description:
* Return an the TLS data value associated with the 'tlsindx'
*
* Input Parameters:
* tlsindex - Index of TLS data element to return
*
* Returned Value:
* The value of TLS element associated with 'tlsindex'. Errors are not
* reported. Zero is returned in the event of an error, but zero may also
* be valid value and returned when there is no error. The only possible
* error would be if tlsindex < 0 or tlsindex >=CONFIG_TLS_NELEM.
*
****************************************************************************/
#if CONFIG_TLS_NELEM > 0
uintptr_t tls_get_value(int tlsindex);
#endif
/****************************************************************************
* Name: tls_set_value
*
* Description:
* Set the TLS element associated with the 'tlsindex' to 'tlsvalue'
*
* Input Parameters:
* tlsindex - Index of TLS data element to set
* tlsvalue - The new value of the TLS data element
*
* Returned Value:
* Zero is returned on success, a negated errno value is return on
* failure:
*
* EINVAL - tlsindex is not in range.
*
****************************************************************************/
#if CONFIG_TLS_NELEM > 0
int tls_set_value(int tlsindex, uintptr_t tlsvalue);
#endif
#if CONFIG_TLS_TASK_NELEM > 0
/****************************************************************************