Skip to content

Commit 7949aad

Browse files
nordic-krchnordicjm
authored andcommitted
[nrf fromtree] arch: riscv: no_multithreading: CPU idle after return from main
So far, forever busy loop with interrupts disabled was executed when CONFIG_MULTITHREADING=n and main() returned. Change it to forever k_cpu_idle() which is better from power consumption perspective. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> (cherry picked from commit c7d12998426df8f57b3e9188fae1877bc9a889aa)
1 parent 27954cb commit 7949aad

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎arch/riscv/core/thread.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ FUNC_NORETURN void z_riscv_switch_to_main_no_multithreading(k_thread_entry_t mai
295295
/* infinite loop */
296296
irq_lock();
297297
while (true) {
298+
k_cpu_idle();
298299
}
299300

300301
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */

0 commit comments

Comments
 (0)