sched: Move argv from tcb_s to task_info_s

argv is allocated from stack and then belong to userspace,
so task_info_s is a best location to hold this information.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-11-29 11:00:27 +08:00
committed by Xiang Xiao
parent 3d6a5a2d0d
commit 1af8cd4de8
12 changed files with 35 additions and 45 deletions
+1 -19
View File
@@ -33,11 +33,11 @@
#include <sched.h>
#include <signal.h>
#include <semaphore.h>
#include <pthread.h>
#include <time.h>
#include <nuttx/clock.h>
#include <nuttx/irq.h>
#include <nuttx/tls.h>
#include <nuttx/wdog.h>
#include <nuttx/mm/shm.h>
#include <nuttx/fs/fs.h>
@@ -347,18 +347,6 @@ struct child_status_s
};
#endif
/* struct pthread_cleanup_s *************************************************/
/* This structure describes one element of the pthread cleanup stack */
#ifdef CONFIG_PTHREAD_CLEANUP
struct pthread_cleanup_s
{
pthread_cleanup_t pc_cleaner; /* Cleanup callback address */
FAR void *pc_arg; /* Argument that accompanies the callback */
};
#endif
/* struct dspace_s **********************************************************/
/* This structure describes a reference counted D-Space region.
@@ -420,8 +408,6 @@ struct exitinfo_s
#endif
};
struct task_info_s;
/* struct task_group_s ******************************************************/
/* All threads created by pthread_create belong in the same task group (along
@@ -742,10 +728,6 @@ struct task_tcb_s
starthook_t starthook; /* Task startup function */
FAR void *starthookarg; /* The argument passed to the function */
#endif
/* [Re-]start name + start-up parameters **********************************/
FAR char **argv; /* Name+start-up parameters */
};
/* struct pthread_tcb_s *****************************************************/
+14 -2
View File
@@ -27,9 +27,8 @@
#include <nuttx/config.h>
#include <nuttx/sched.h>
#include <nuttx/arch.h>
#include <sys/types.h>
#include <pthread.h>
/****************************************************************************
* Pre-processor Definitions
@@ -102,6 +101,7 @@ struct getopt_s
struct task_info_s
{
sem_t ta_sem;
FAR char **argv; /* Name+start-up parameters */
#if CONFIG_TLS_NELEM > 0
tls_ndxset_t ta_tlsset; /* Set of TLS indexes allocated */
tls_dtor_t ta_tlsdtor[CONFIG_TLS_NELEM]; /* List of TLS destructors */
@@ -115,6 +115,18 @@ struct task_info_s
#endif
};
/* struct pthread_cleanup_s *************************************************/
/* This structure describes one element of the pthread cleanup stack */
#ifdef CONFIG_PTHREAD_CLEANUP
struct pthread_cleanup_s
{
pthread_cleanup_t pc_cleaner; /* Cleanup callback address */
FAR void *pc_arg; /* Argument that accompanies the callback */
};
#endif
/* When TLS is enabled, up_createstack() will align allocated stacks to the
* TLS_STACK_ALIGN value. An instance of the following structure will be
* implicitly positioned at the "lower" end of the stack. Assuming a