sched/sched: Add sched_get_stackinfo()

The new OS interface, sched_get_stackinfo() combines two pthread-specific interfaces into a single generic interface.  The existing pthread_get_stackaddr_np() and pthread_get_stacksize_np() are moved from sched/pthread to libs/libc/pthread.

There are two motivations for this change:  First, it reduces the number of system calls.  Secondly, it adds a common hook that is going to used for a future implementation of TLS.
This commit is contained in:
Gregory Nutt
2020-05-03 14:16:36 -06:00
committed by Abdelatif Guettouche
parent f03ed73f91
commit 00933cfece
11 changed files with 186 additions and 123 deletions
+1 -2
View File
@@ -88,8 +88,6 @@
"pthread_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_t*","FAR const pthread_attr_t*","pthread_startroutine_t","pthread_addr_t"
"pthread_detach","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t"
"pthread_exit","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void","pthread_addr_t"
"pthread_get_stackaddr_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void*","pthread_t"
"pthread_get_stacksize_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","ssize_t","pthread_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"
@@ -123,6 +121,7 @@
"sched_getparam","sched.h","","int","pid_t","struct sched_param*"
"sched_getscheduler","sched.h","","int","pid_t"
"sched_getstreams","nuttx/sched.h","CONFIG_NFILE_STREAMS > 0","FAR struct streamlist*"
"sched_get_stackinfo","nuttx/sched.h","","int","pid_t","struct stackinfo_s*"
"sched_lock","sched.h","","int"
"sched_lockcount","sched.h","","int32_t"
"sched_rr_get_interval","sched.h","","int","pid_t","struct timespec*"
1 _exit unistd.h void int
88 pthread_create pthread.h !defined(CONFIG_DISABLE_PTHREAD) int FAR pthread_t*
89 pthread_detach pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
90 pthread_exit pthread.h !defined(CONFIG_DISABLE_PTHREAD) void pthread_addr_t
pthread_get_stackaddr_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) void* pthread_t
pthread_get_stacksize_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) ssize_t pthread_t
91 pthread_getaffinity_np pthread.h !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP) int pthread_t
92 pthread_getschedparam pthread.h !defined(CONFIG_DISABLE_PTHREAD) int pthread_t
93 pthread_getspecific pthread.h !defined(CONFIG_DISABLE_PTHREAD) FAR void* pthread_key_t
121 sched_getparam sched.h int pid_t
122 sched_getscheduler sched.h int pid_t
123 sched_getstreams nuttx/sched.h CONFIG_NFILE_STREAMS > 0 FAR struct streamlist*
124 sched_get_stackinfo nuttx/sched.h int pid_t
125 sched_lock sched.h int
126 sched_lockcount sched.h int32_t
127 sched_rr_get_interval sched.h int pid_t