]> 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 05d88bcdd97e0edcbce763c78b2a038d2842f519..aa54bd7b5b61191c73063bedd74ebd6ec66947ca 100644 (file)
@@ -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();
     }
 }