]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
kernel: use hal_cpu_idle for idle loop
authorTulio A M Mendes <[email protected]>
Thu, 5 Feb 2026 22:41:25 +0000 (19:41 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 5 Feb 2026 22:41:25 +0000 (19:41 -0300)
src/kernel/main.c

index 74f347fc101d8b6f85178a341ef69e0a6c49edf9..e53b2935db84fc9b404d5d18d488d922dc4099fe 100644 (file)
@@ -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();
     }
 }