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:
Xiang Xiao
2020-07-01 07:55:33 -06:00
committed by patacongo
parent e9c7df4769
commit 8153e31753
6 changed files with 125 additions and 30 deletions
+20
View File
@@ -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:
*
+1 -23
View File
@@ -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
*