mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
sched: move process ID from kernel to TLS for faster access
Add pid field to task_info_s and move getpid() implementation to user space TLS access. Remove getpid from syscall interface as it now returns cached PID from thread local storage instead of kernel lookup. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -149,6 +149,7 @@ struct task_info_s
|
||||
#ifdef CONFIG_PTHREAD_ATFORK
|
||||
struct list_node ta_atfork; /* Holds the pthread_atfork_s list */
|
||||
#endif
|
||||
pid_t ta_pid; /* Process ID */
|
||||
};
|
||||
|
||||
/* struct tls_cleanup_s *****************************************************/
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
SYSCALL_LOOKUP1(_exit, 1)
|
||||
SYSCALL_LOOKUP(_assert, 4)
|
||||
SYSCALL_LOOKUP(getpid, 0)
|
||||
SYSCALL_LOOKUP(prctl, 2)
|
||||
|
||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||
|
||||
Reference in New Issue
Block a user