mirror of
https://github.com/apache/nuttx.git
synced 2026-09-26 09:54:24 +08:00
sched: Call c++ global variables constructor inside nxtask_startup
to avoid the similar code spread around each application Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
This commit is contained in:
@@ -1033,6 +1033,26 @@ void nxtask_starthook(FAR struct task_tcb_s *tcb, starthook_t starthook,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Name: nxtask_startup
|
||||
*
|
||||
* Description:
|
||||
* This function is the user-space, task startup function. It is called
|
||||
* from up_task_start() in user-mode.
|
||||
*
|
||||
* Input Parameters:
|
||||
* entrypt - The user-space address of the task entry point
|
||||
* argc and argv - Standard arguments for the task entry point
|
||||
*
|
||||
* Returned Value:
|
||||
* None. This function does not return.
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
void nxtask_startup(main_t entrypt, int argc, FAR char *argv[]);
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Internal vfork support. The overall sequence is:
|
||||
*
|
||||
|
||||
@@ -117,8 +117,7 @@ struct userspace_s
|
||||
|
||||
/* Task/thread startup routines */
|
||||
|
||||
CODE void (*task_startup)(main_t entrypt, int argc, FAR char *argv[])
|
||||
noreturn_function;
|
||||
CODE void (*task_startup)(main_t entrypt, int argc, FAR char *argv[]);
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
CODE void (*pthread_startup)(pthread_startroutine_t entrypt,
|
||||
pthread_addr_t arg);
|
||||
@@ -152,27 +151,6 @@ extern "C"
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxtask_startup
|
||||
*
|
||||
* Description:
|
||||
* This function is the user-space, task startup function. It is called
|
||||
* from up_task_start() in user-mode.
|
||||
*
|
||||
* Input Parameters:
|
||||
* entrypt - The user-space address of the task entry point
|
||||
* argc and argv - Standard arguments for the task entry point
|
||||
*
|
||||
* Returned Value:
|
||||
* None. This function does not return.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __KERNEL__
|
||||
void nxtask_startup(main_t entrypt, int argc, FAR char *argv[])
|
||||
noreturn_function;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pthread_startup
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user