feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs

This commit is contained in:
2026-07-05 10:51:11 +02:00
parent daa17a325f
commit 70702a21b0
19 changed files with 903 additions and 9 deletions
+25
View File
@@ -12,6 +12,8 @@
#include <Graphics/Framebuffer.hpp>
#include <ACPI/AcpiShutdown.hpp>
#include <ACPI/AcpiSleep.hpp>
#include <ACPI/CpuIdle.hpp>
#include <Hal/CpuPower.hpp>
#include "Syscall.hpp"
@@ -71,4 +73,27 @@ namespace montauk::abi {
}
return (int64_t)Hal::AcpiSleep::Suspend();
}
// SYS_POWERINFO. Fills a CPU power/thermal snapshot. Returns -1 when the
// CPU exposes no power management features (e.g. under QEMU).
static int64_t Sys_PowerInfo(PowerInfo* out) {
Hal::CpuPower::Snapshot s{};
if (!Hal::CpuPower::GetSnapshot(s)) {
return -1;
}
out->hwpActive = s.HwpActive ? 1 : 0;
out->throttling = s.Throttling ? 1 : 0;
out->tempC = s.TempC;
out->tjMaxC = s.TjMaxC;
out->highestPerf = s.HighestPerf;
out->lowestPerf = s.LowestPerf;
out->curMaxPerf = s.CurMaxPerf;
out->epp = s.Epp;
out->baseMHz = s.BaseMHz;
out->maxMHz = s.MaxMHz;
out->effMHz = s.EffMHz;
out->apIdleHint = Hal::CpuIdle::GetApIdleHint();
return 0;
}
};