aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-22 16:14:25 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-22 16:14:25 +0100
commit36a3989842bf813bd807a0be6ba6f6ebee684872 (patch)
tree7b74a9493896c07a2c32838ab4225055093a16ec
parent573a8c6b490a080cf728cdcb11e5a14ddf50556d (diff)
downloadfbos-36a3989842bf813bd807a0be6ba6f6ebee684872.tar.gz
fbos-36a3989842bf813bd807a0be6ba6f6ebee684872.zip
Add a 'wfi' instruction on the main loop
The actual work is done somewhere else, there is no need to constantly run the main thread. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
-rw-r--r--kernel/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 9cdb61e..ec8fabd 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -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");
+ }
}