mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 18:37:58 +03:00
Kernel: Add Processor::wait_for_interrupt and use it in Scheduler
This removes the x86 specific hlt instruction from the scheduler, and allows us to run the scheduler code for aarch64 by implementing Processor::wait_for_interrupt for aarch64.
This commit is contained in:
parent
f232133f65
commit
f6f43fd65e
Notes:
sideshowbarker
2024-07-17 02:28:45 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/f6f43fd65e Pull-request: https://github.com/SerenityOS/serenity/pull/16690 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/nico ✅
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user