Skip to content

Commit

Permalink
Add a 'wfi' instruction on the main loop
Browse files Browse the repository at this point in the history
The actual work is done somewhere else, there is no need to constantly
run the main thread.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Nov 22, 2024
1 parent 573a8c6 commit 36a3989
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ __noreturn __kernel void start_kernel(void *dtb)
seconds_elapsed = 0;
setup_interrupts();

for (;;)
;
for (;;) {
// Put the machine on low power consumption since we are not doing
// anything fancy here.
asm volatile("wfi");
}
}

0 comments on commit 36a3989

Please sign in to comment.