From 36a3989842bf813bd807a0be6ba6f6ebee684872 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 22 Nov 2024 16:14:25 +0100 Subject: Add a 'wfi' instruction on the main loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The actual work is done somewhere else, there is no need to constantly run the main thread. Signed-off-by: Miquel Sabaté Solà --- kernel/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kernel') 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"); + } } -- cgit v1.2.3