kernel: do not use k_busy_wait when on single thread

k_busy_wait() does not work when multithreading is disabled, so do not
try to wait during boot.

Fixes #14454

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2019-03-26 12:01:44 -04:00
commit 42f4538e40

View file

@ -41,7 +41,8 @@
LOG_MODULE_REGISTER(kernel); LOG_MODULE_REGISTER(kernel);
/* boot banner items */ /* boot banner items */
#if defined(CONFIG_BOOT_DELAY) && CONFIG_BOOT_DELAY > 0 #if defined(CONFIG_MULTITHREADING) && defined(CONFIG_BOOT_DELAY) \
&& CONFIG_BOOT_DELAY > 0
#define BOOT_DELAY_BANNER " (delayed boot " \ #define BOOT_DELAY_BANNER " (delayed boot " \
STRINGIFY(CONFIG_BOOT_DELAY) "ms)" STRINGIFY(CONFIG_BOOT_DELAY) "ms)"
#else #else
@ -242,7 +243,7 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
#if CONFIG_STACK_POINTER_RANDOM #if CONFIG_STACK_POINTER_RANDOM
z_stack_adjust_initialized = 1; z_stack_adjust_initialized = 1;
#endif #endif
if (boot_delay > 0) { if (boot_delay > 0 && IS_ENABLED(CONFIG_MULTITHREADING)) {
printk("***** delaying boot " STRINGIFY(CONFIG_BOOT_DELAY) printk("***** delaying boot " STRINGIFY(CONFIG_BOOT_DELAY)
"ms (per build configuration) *****\n"); "ms (per build configuration) *****\n");
k_busy_wait(CONFIG_BOOT_DELAY * USEC_PER_MSEC); k_busy_wait(CONFIG_BOOT_DELAY * USEC_PER_MSEC);