Skip to content

Commit

Permalink
kernel: Final spin in !MULTITHREADING should be locked
Browse files Browse the repository at this point in the history
Now that we call main() with interrupts enabled in !MULTITHREADING, we
need to disable them again for the final fallback "loop-forever
because user code returned" state.  Otherwise some architectures will
toss interrupts into a context where we obviously aren't prepared.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
  • Loading branch information
Andy Ross authored and nashif committed Aug 30, 2018
1 parent 2f95e24 commit 8daafd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ FUNC_NORETURN void _Cstart(void)
enable_interrupts();
bg_thread_main(NULL, NULL, NULL);

irq_lock();
while (1) {
}
#endif
Expand Down

0 comments on commit 8daafd4

Please sign in to comment.