feat: further kernel power and power optimizations
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "SmpBoot.hpp"
|
||||
#include <ACPI/CpuIdle.hpp>
|
||||
#include <Hal/Apic/Apic.hpp>
|
||||
#include <Hal/Apic/Interrupts.hpp>
|
||||
#include <Hal/IDT.hpp>
|
||||
@@ -212,16 +213,9 @@ namespace Smp {
|
||||
// --- Enable interrupts and enter idle loop ---
|
||||
asm volatile("sti");
|
||||
|
||||
// Use MWAIT for deeper C-states if available, otherwise HLT.
|
||||
static volatile uint64_t s_idleMonitor = 0;
|
||||
if (cpu->hasMwait) {
|
||||
for (;;) {
|
||||
Hal::IdleWait(&s_idleMonitor);
|
||||
}
|
||||
} else {
|
||||
for (;;) {
|
||||
asm volatile("hlt");
|
||||
}
|
||||
for (;;) {
|
||||
Hal::CpuIdle::Wait(10, cpu->hasMwait, &s_idleMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user