mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +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 */
|
/* Configuration */
|
||||||
|
|
||||||
#if defined(CONFIG_INIT_NONE)
|
#if defined(CONFIG_INIT_NONE)
|
||||||
/* Kconfig logic will set CONFIG_INIT_NONE if dependencies are not met */
|
# ifndef CONFIG_BUILD_FLAT
|
||||||
|
# error No initialization mechanism selected (CONFIG_INIT_NONE)
|
||||||
# error No initialization mechanism selected (CONFIG_INIT_NONE)
|
# endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# if !defined(CONFIG_INIT_ENTRY) && !defined(CONFIG_INIT_FILE)
|
# if !defined(CONFIG_INIT_ENTRY) && !defined(CONFIG_INIT_FILE)
|
||||||
/* For backward compatibility with older defconfig files when this was
|
/* For backward compatibility with older defconfig files when this was
|
||||||
@@ -326,6 +325,14 @@ static inline void nx_start_application(void)
|
|||||||
coredump_initialize();
|
coredump_initialize();
|
||||||
#endif
|
#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);
|
posix_spawnattr_init(&attr);
|
||||||
attr.priority = CONFIG_INIT_PRIORITY;
|
attr.priority = CONFIG_INIT_PRIORITY;
|
||||||
attr.stacksize = CONFIG_INIT_STACKSIZE;
|
attr.stacksize = CONFIG_INIT_STACKSIZE;
|
||||||
@@ -378,6 +385,7 @@ static inline void nx_start_application(void)
|
|||||||
#endif
|
#endif
|
||||||
posix_spawnattr_destroy(&attr);
|
posix_spawnattr_destroy(&attr);
|
||||||
DEBUGASSERT(ret > 0);
|
DEBUGASSERT(ret > 0);
|
||||||
|
#endif /* CONFIG_INIT_NONE */
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user