init: move USERMAIN_XX out of INIT_ENTRYPOINT

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2021-12-20 12:21:47 +08:00
committed by Xiang Xiao
parent 36389dab76
commit 10ccba6671
8 changed files with 52 additions and 52 deletions
+21 -21
View File
@@ -301,18 +301,18 @@ endif # SMP
choice
prompt "Initialization Task"
default INIT_ENTRYPOINT if !BUILD_KERNEL
default INIT_FILEPATH if !BINFMT_DISABLE
default INIT_ENTRY if !BUILD_KERNEL
default INIT_FILE if !BINFMT_DISABLE
default INIT_NONE if BINFMT_DISABLE
config INIT_NONE
bool "None"
config INIT_ENTRYPOINT
bool "Via application entry point"
config INIT_ENTRY
bool "Via application entry"
depends on !BUILD_KERNEL
config INIT_FILEPATH
config INIT_FILE
bool "Via executable file"
depends on !BINFMT_DISABLE
@@ -325,39 +325,39 @@ config INIT_ARGS
The argument list for user applications. e.g.:
"\"arg1\",\"arg2\",\"arg3\""
if INIT_ENTRYPOINT
config USER_ENTRYPOINT
string "Application entry point"
default "main"
---help---
The name of the entry point for user applications. For the example
applications this is of the form 'app_main' where 'app' is the application
name. If not defined, USER_ENTRYPOINT defaults to "main".
config USERMAIN_STACKSIZE
config INIT_STACKSIZE
int "Main thread stack size"
default DEFAULT_TASK_STACKSIZE
---help---
The size of the stack to allocate for the user initialization thread
that is started as soon as the OS completes its initialization.
config USERMAIN_PRIORITY
config INIT_PRIORITY
int "init thread priority"
default 100
---help---
The priority of the user initialization thread.
endif # INIT_ENTRYPOINT
if INIT_ENTRY
config INIT_ENTRYPOINT
string "Application entry point"
default "main"
---help---
The name of the entry point for user applications. For the example
applications this is of the form 'app_main' where 'app' is the application
name. If not defined, INIT_ENTRYPOINT defaults to "main".
if INIT_FILEPATH
endif # INIT_ENTRY
config USER_INITPATH
if INIT_FILE
config INIT_FILEPATH
string "Application initialization path"
default "/bin/init"
---help---
The name of the entry point for user applications. For the example
applications this is of the form 'app_main' where 'app' is the application
name. If not defined, USER_ENTRYPOINT defaults to "main".
name. If not defined, INIT_ENTRYPOINT defaults to "main".
config INIT_SYMTAB
string "Symbol table"
@@ -423,7 +423,7 @@ config INIT_MOUNT_DATA
default ""
endif # INIT_MOUNT
endif # INIT_FILEPATH
endif # INIT_FILE
config RR_INTERVAL
int "Round robin timeslice (MSEC)"
+1 -1
View File
@@ -107,7 +107,7 @@ void nx_idle_trampoline(void);
* And the main application entry point:
* symbols:
*
* - USER_ENTRYPOINT: This is the default user application entry point.
* - INIT_ENTRYPOINT: This is the default user application entry point.
*
* Input Parameters:
* None
+22 -22
View File
@@ -58,34 +58,34 @@
# error No initialization mechanism selected (CONFIG_INIT_NONE)
#else
# if !defined(CONFIG_INIT_ENTRYPOINT) && !defined(CONFIG_INIT_FILEPATH)
# if !defined(CONFIG_INIT_ENTRY) && !defined(CONFIG_INIT_FILE)
/* For backward compatibility with older defconfig files when this was
* the way things were done.
*/
# define CONFIG_INIT_ENTRYPOINT 1
# define CONFIG_INIT_ENTRY 1
# endif
# if defined(CONFIG_INIT_ENTRYPOINT)
# if defined(CONFIG_INIT_ENTRY)
/* Initialize by starting a task at an entry point */
# ifndef CONFIG_USER_ENTRYPOINT
# ifndef CONFIG_INIT_ENTRYPOINT
/* Entry point name must have been provided */
# error CONFIG_USER_ENTRYPOINT must be defined
# error CONFIG_INIT_ENTRYPOINT must be defined
# endif
# elif defined(CONFIG_INIT_FILEPATH)
# elif defined(CONFIG_INIT_FILE)
/* Initialize by running an initialization program in the file system.
* Presumably the user has configured a board initialization function
* that will mount the file system containing the initialization
* program.
*/
# ifndef CONFIG_USER_INITPATH
# ifndef CONFIG_INIT_FILEPATH
/* Path to the initialization program must have been provided */
# error CONFIG_USER_INITPATH must be defined
# error CONFIG_INT_FILEPATH must be defined
# endif
# if !defined(CONFIG_INIT_SYMTAB) || !defined(CONFIG_INIT_NEXPORTS)
@@ -108,8 +108,8 @@ extern const int CONFIG_INIT_NEXPORTS;
# undef CONFIG_LIBC_USRWORK
#endif
#if !defined(CONFIG_USERMAIN_PRIORITY)
# define CONFIG_USERMAIN_PRIORITY SCHED_PRIORITY_DEFAULT
#if !defined(CONFIG_INIT_PRIORITY)
# define CONFIG_INIT_PRIORITY SCHED_PRIORITY_DEFAULT
#endif
/****************************************************************************
@@ -243,10 +243,10 @@ static inline void nx_start_application(void)
board_late_initialize();
#endif
#if defined(CONFIG_INIT_ENTRYPOINT)
#if defined(CONFIG_INIT_ENTRY)
/* Start the application initialization task. In a flat build, this is
* entrypoint is given by the definitions, CONFIG_USER_ENTRYPOINT. In
* entrypoint is given by the definitions, CONFIG_INIT_ENTRYPOINT. In
* the protected build, however, we must get the address of the
* entrypoint from the header at the beginning of the user-space blob.
*/
@@ -255,17 +255,17 @@ static inline void nx_start_application(void)
#ifdef CONFIG_BUILD_PROTECTED
DEBUGASSERT(USERSPACE->us_entrypoint != NULL);
ret = nxtask_create("init", CONFIG_USERMAIN_PRIORITY,
CONFIG_USERMAIN_STACKSIZE,
ret = nxtask_create("init", CONFIG_INIT_PRIORITY,
CONFIG_INIT_STACKSIZE,
USERSPACE->us_entrypoint, argv);
#else
ret = nxtask_create("init", CONFIG_USERMAIN_PRIORITY,
CONFIG_USERMAIN_STACKSIZE,
(main_t)CONFIG_USER_ENTRYPOINT, argv);
ret = nxtask_create("init", CONFIG_INIT_PRIORITY,
CONFIG_INIT_STACKSIZE,
(main_t)CONFIG_INIT_ENTRYPOINT, argv);
#endif
DEBUGASSERT(ret > 0);
#elif defined(CONFIG_INIT_FILEPATH)
#elif defined(CONFIG_INIT_FILE)
#ifdef CONFIG_INIT_MOUNT
/* Mount the file system containing the init program. */
@@ -281,9 +281,9 @@ static inline void nx_start_application(void)
* of the board_late_initialize() operation.
*/
sinfo("Starting init task: %s\n", CONFIG_USER_INITPATH);
sinfo("Starting init task: %s\n", CONFIG_INIT_FILEPATH);
ret = exec(CONFIG_USER_INITPATH, argv,
ret = exec(CONFIG_INIT_FILEPATH, argv,
CONFIG_INIT_SYMTAB, CONFIG_INIT_NEXPORTS);
DEBUGASSERT(ret >= 0);
#endif
@@ -377,9 +377,9 @@ static inline void nx_create_initthread(void)
* And the main application entry point:
* symbols, either:
*
* - CONFIG_USER_ENTRYPOINT: This is the default user application entry
* - CONFIG_INIT_ENTRYPOINT: This is the default user application entry
* point, or
* - CONFIG_USER_INITPATH: The full path to the location in a mounted
* - CONFIG_INIT_FILEPATH: The full path to the location in a mounted
* file system where we can expect to find the
* initialization program. Presumably, this file system
* was mounted by board-specific logic when