diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index 4b8a30b907..1603196ccf 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -56,12 +56,17 @@ public: void idle_begin() const { - TODO_AARCH64(); + // FIXME: Implement this when SMP for aarch64 is supported. } void idle_end() const { - TODO_AARCH64(); + // FIXME: Implement this when SMP for aarch64 is supported. + } + + void wait_for_interrupt() const + { + asm("wfi"); } ALWAYS_INLINE static void pause() diff --git a/Kernel/Arch/x86_64/Processor.h b/Kernel/Arch/x86_64/Processor.h index 5f2f32d1fa..1303ebe0aa 100644 --- a/Kernel/Arch/x86_64/Processor.h +++ b/Kernel/Arch/x86_64/Processor.h @@ -150,6 +150,11 @@ public: s_idle_cpu_mask.fetch_and(~(1u << m_cpu), AK::MemoryOrder::memory_order_relaxed); } + void wait_for_interrupt() const + { + asm("hlt"); + } + static Processor& by_id(u32); static u32 count() diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 4d0a76d921..817e02288b 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -479,8 +479,7 @@ void Scheduler::idle_loop(void*) for (;;) { proc.idle_begin(); - asm("hlt"); - + proc.wait_for_interrupt(); proc.idle_end(); VERIFY_INTERRUPTS_ENABLED(); yield();