From: Tulio A M Mendes Date: Thu, 5 Feb 2026 22:41:25 +0000 (-0300) Subject: kernel: use hal_cpu_idle for idle loop X-Git-Url: https://projects.tadryanom.me/?a=commitdiff_plain;h=899d0f65a35bc3dd1baa9ae30df2511dafc1680b;p=AdrOS.git kernel: use hal_cpu_idle for idle loop --- diff --git a/src/kernel/main.c b/src/kernel/main.c index 05d88bc..aa54bd7 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -18,6 +18,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" @@ -116,12 +118,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(); } }