From b8daec434168037144ea4c07ce06f2cd4ca681f3 Mon Sep 17 00:00:00 2001 From: Tulio A M Mendes Date: Thu, 5 Feb 2026 19:41:25 -0300 Subject: [PATCH] kernel: use hal_cpu_idle for idle loop --- src/kernel/main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/kernel/main.c b/src/kernel/main.c index 74f347fc..e53b2935 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -27,6 +27,8 @@ #include "syscall.h" +#include "hal/cpu.h" + /* Check if the compiler thinks we are targeting the wrong operating system. */ #if defined(__linux__) #error "You are not using a cross-compiler, you will run into trouble" @@ -125,12 +127,6 @@ void kernel_main(unsigned long magic, unsigned long addr) { // Infinite loop acting as Idle Task for(;;) { - #if defined(__i386__) || defined(__x86_64__) - __asm__("hlt"); - #elif defined(__aarch64__) - __asm__("wfi"); - #elif defined(__riscv) - __asm__("wfi"); - #endif + hal_cpu_idle(); } } -- 2.43.0