mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
sched/init/nx_bringup.c: Add support for CONFIG_INIT_NONE in a flat build
In a flat build, a separate init thread should not be mandatory, users can create a user task in the board early initialization or late initialization hook.
This commit is contained in:
+12
-4
@@ -65,10 +65,9 @@
|
||||
/* Configuration */
|
||||
|
||||
#if defined(CONFIG_INIT_NONE)
|
||||
/* Kconfig logic will set CONFIG_INIT_NONE if dependencies are not met */
|
||||
|
||||
# error No initialization mechanism selected (CONFIG_INIT_NONE)
|
||||
|
||||
# ifndef CONFIG_BUILD_FLAT
|
||||
# error No initialization mechanism selected (CONFIG_INIT_NONE)
|
||||
# endif
|
||||
#else
|
||||
# if !defined(CONFIG_INIT_ENTRY) && !defined(CONFIG_INIT_FILE)
|
||||
/* For backward compatibility with older defconfig files when this was
|
||||
@@ -326,6 +325,14 @@ static inline void nx_start_application(void)
|
||||
coredump_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INIT_NONE
|
||||
|
||||
UNUSED(ret);
|
||||
|
||||
/* In a flat build, init thread is not mandatory */
|
||||
|
||||
sinfo("No init thread\n");
|
||||
#else
|
||||
posix_spawnattr_init(&attr);
|
||||
attr.priority = CONFIG_INIT_PRIORITY;
|
||||
attr.stacksize = CONFIG_INIT_STACKSIZE;
|
||||
@@ -378,6 +385,7 @@ static inline void nx_start_application(void)
|
||||
#endif
|
||||
posix_spawnattr_destroy(&attr);
|
||||
DEBUGASSERT(ret > 0);
|
||||
#endif /* CONFIG_INIT_NONE */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user