sched/Kconfig and sched/init/os_bringup.c: Allow the init task priority to be set.

This commit is contained in:
David Sidrane
2018-12-20 10:49:10 -06:00
committed by Gregory Nutt
parent f37202cbc0
commit bf6f44dec8
2 changed files with 12 additions and 2 deletions
+6
View File
@@ -346,6 +346,12 @@ config USER_ENTRYPOINT
applications this is of the form 'app_main' where 'app' is the application 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, USER_ENTRYPOINT defaults to "main".
config USERMAIN_PRIORITY
int "init thread priority"
default 100
---help---
The priority of the user initialization thread.
endif # INIT_ENTRYPOINT endif # INIT_ENTRYPOINT
if INIT_FILEPATH if INIT_FILEPATH
+6 -2
View File
@@ -126,6 +126,10 @@ extern const int CONFIG_INIT_NEXPORTS;
# undef CONFIG_LIB_USRWORK # undef CONFIG_LIB_USRWORK
#endif #endif
#if !defined(CONFIG_USERMAIN_PRIORITY)
# define CONFIG_USERMAIN_PRIORITY SCHED_PRIORITY_DEFAULT
#endif
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
@@ -259,11 +263,11 @@ static inline void os_do_appstart(void)
#ifdef CONFIG_BUILD_PROTECTED #ifdef CONFIG_BUILD_PROTECTED
DEBUGASSERT(USERSPACE->us_entrypoint != NULL); DEBUGASSERT(USERSPACE->us_entrypoint != NULL);
pid = nxtask_create("init", SCHED_PRIORITY_DEFAULT, pid = nxtask_create("init", CONFIG_USERMAIN_PRIORITY,
CONFIG_USERMAIN_STACKSIZE, USERSPACE->us_entrypoint, CONFIG_USERMAIN_STACKSIZE, USERSPACE->us_entrypoint,
(FAR char * const *)NULL); (FAR char * const *)NULL);
#else #else
pid = nxtask_create("init", SCHED_PRIORITY_DEFAULT, pid = nxtask_create("init", CONFIG_USERMAIN_PRIORITY,
CONFIG_USERMAIN_STACKSIZE, CONFIG_USERMAIN_STACKSIZE,
(main_t)CONFIG_USER_ENTRYPOINT, (main_t)CONFIG_USER_ENTRYPOINT,
(FAR char * const *)NULL); (FAR char * const *)NULL);