mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Explicitly save previous power limits
This commit is contained in:
@@ -27,6 +27,14 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
ReadPowerUnit();
|
||||
}
|
||||
|
||||
public void SavePowerLimits()
|
||||
{
|
||||
DefaultEax = 0;
|
||||
DefaultEdx = 0;
|
||||
|
||||
ols.Rdmsr(MSR_PKG_POWER_LIMIT, ref DefaultEax, ref DefaultEdx);
|
||||
}
|
||||
|
||||
public void ReadPowerUnit()
|
||||
{
|
||||
uint eax = 0;
|
||||
@@ -72,13 +80,6 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
|
||||
ols.Rdmsr(MSR_PKG_POWER_LIMIT, ref eax, ref edx);
|
||||
|
||||
if (DefaultEax == 0)
|
||||
{
|
||||
//Store default settings to reset them on exit
|
||||
DefaultEax = eax;
|
||||
DefaultEdx = edx;
|
||||
}
|
||||
|
||||
uint pl1 = eax & PL1_MASK;
|
||||
uint pl2 = edx & PL2_MASK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user