Move pthread-specific data into TLS

1. Move pthread-specific data files from sched/pthread/ to libs/libc/pthread.
2. Remove pthread-specific data functions from syscalls.
3. Implement tls_alloc() and tls_free() with system calls.
4. Reimplement pthread_key_create() and pthread_key_free() using tls_alloc() and tls_free().
5. Reimplement pthread_set_specific() and pthread_get_specicif() using tls_set_value() and tls_get_value()
This commit is contained in:
Gregory Nutt
2020-05-08 07:23:26 -06:00
committed by Abdelatif Guettouche
parent a6c82a27db
commit 9ce03b1660
55 changed files with 685 additions and 647 deletions
+2 -4
View File
@@ -87,10 +87,7 @@
"pthread_exit","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void","pthread_addr_t"
"pthread_getaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR cpu_set_t*"
"pthread_getschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","FAR int *","FAR struct sched_param *"
"pthread_getspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","FAR void *","pthread_key_t"
"pthread_join","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","FAR pthread_addr_t *"
"pthread_key_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_key_t *","CODE void (*)(FAR void*)"
"pthread_key_delete","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t"
"pthread_kill","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int"
"pthread_mutex_consistent","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && !defined(CONFIG_PTHREAD_MUTEX_UNSAFE)","int","FAR pthread_mutex_t *"
"pthread_mutex_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutex_t *"
@@ -101,7 +98,6 @@
"pthread_setaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR const cpu_set_t *"
"pthread_setschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int","FAR const struct sched_param *"
"pthread_setschedprio","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int"
"pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void *"
"pthread_sigmask","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR const sigset_t *","FAR sigset_t *"
"putenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *"
"pwrite","unistd.h","","ssize_t","int","FAR const void *","size_t","off_t"
@@ -175,6 +171,8 @@
"timer_getoverrun","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t"
"timer_gettime","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t","FAR struct itimerspec *"
"timer_settime","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t","int","FAR const struct itimerspec *","FAR struct itimerspec *"
"tls_alloc","nuttx/tls.h","CONFIG_TLS_NELEM > 0","int"
"tls_free","nuttx/tls.h","CONFIG_TLS_NELEM > 0","int","int"
"umount2","sys/mount.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char *","unsigned int"
"uname","sys/utsname.h","","int","FAR struct utsname *"
"unlink","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char *"
1 _exit unistd.h void int
87 pthread_exit pthread.h !defined(CONFIG_DISABLE_PTHREAD) void pthread_addr_t
88 pthread_getaffinity_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP) int pthread_t
89 pthread_getschedparam pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
pthread_getspecific pthread.h !defined(CONFIG_DISABLE_PTHREAD) FAR void * pthread_key_t
90 pthread_join pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
pthread_key_create pthread.h !defined(CONFIG_DISABLE_PTHREAD) int FAR pthread_key_t *
pthread_key_delete pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_key_t
91 pthread_kill pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
92 pthread_mutex_consistent pthread.h !defined(CONFIG_DISABLE_PTHREAD) && !defined(CONFIG_PTHREAD_MUTEX_UNSAFE) int FAR pthread_mutex_t *
93 pthread_mutex_destroy pthread.h !defined(CONFIG_DISABLE_PTHREAD) int FAR pthread_mutex_t *
98 pthread_setaffinity_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP) int pthread_t
99 pthread_setschedparam pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
100 pthread_setschedprio pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
pthread_setspecific pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_key_t
101 pthread_sigmask pthread.h !defined(CONFIG_DISABLE_PTHREAD) int int
102 putenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) int FAR const char *
103 pwrite unistd.h ssize_t int
171 timer_getoverrun time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int timer_t
172 timer_gettime time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int timer_t
173 timer_settime time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int timer_t
174 tls_alloc nuttx/tls.h CONFIG_TLS_NELEM > 0 int
175 tls_free nuttx/tls.h CONFIG_TLS_NELEM > 0 int int
176 umount2 sys/mount.h !defined(CONFIG_DISABLE_MOUNTPOINT) int FAR const char *
177 uname sys/utsname.h int FAR struct utsname *
178 unlink unistd.h !defined(CONFIG_DISABLE_MOUNTPOINT) int FAR const char *