Skip to content

Commit e15a451

Browse files
committed
Code: "Enegry" -> "Energy"
1 parent 04c518c commit e15a451

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

AMDRyzenCPUPowerManagement/AMDRyzenCPUPMUserClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ IOReturn AMDRyzenCPUPMUserClient::externalMethod(uint32_t selector, IOExternalMe
160160

161161
float *dataOut = (float*) arguments->structureOutput;
162162

163-
dataOut[0] = (float)fProvider->uniPackageEnegry;
163+
dataOut[0] = (float)fProvider->uniPackageEnergy;
164164
dataOut[1] = fProvider->PACKAGE_TEMPERATURE_perPackage[0];
165165
dataOut[2] = fProvider->PStateCtl;
166166

AMDRyzenCPUPowerManagement/AMDRyzenCPUPowerManagement.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ bool AMDRyzenCPUPowerManagement::start(IOService *provider){
160160
panic("AMDCPUSupport: unable to read power unit\n");
161161

162162
pwrTimeUnit = pow((double)0.5, (double)((rapl >> 16) & 0xf));
163-
pwrEnegryUnit = pow((double)0.5, (double)((rapl >> 8) & 0x1f));
163+
pwrEnergyUnit = pow((double)0.5, (double)((rapl >> 8) & 0x1f));
164164
IOLog("a %lld\n", (long long)(pwrTimeUnit * 10000000000));
165-
IOLog("b %lld\n", (long long)(pwrEnegryUnit * 10000000000));
165+
IOLog("b %lld\n", (long long)(pwrEnergyUnit * 10000000000));
166166

167167
fetchOEMBaseBoardInfo();
168168

@@ -578,18 +578,18 @@ void AMDRyzenCPUPowerManagement::updatePackageEnergy(){
578578
uint64_t msr_value_buf = 0;
579579
read_msr(kMSR_PKG_ENERGY_STAT, &msr_value_buf);
580580

581-
uint32_t enegryValue = (uint32_t)(msr_value_buf & 0xffffffff);
581+
uint32_t energyValue = (uint32_t)(msr_value_buf & 0xffffffff);
582582

583-
uint64_t enegryDelta = (lastUpdateEnergyValue <= enegryValue) ?
584-
enegryValue - lastUpdateEnergyValue : UINT32_MAX - lastUpdateEnergyValue;
583+
uint64_t energyDelta = (lastUpdateEnergyValue <= energyValue) ?
584+
energyValue - lastUpdateEnergyValue : UINT32_MAX - lastUpdateEnergyValue;
585585

586586
double seconds = (ctsc - pwrLastTSC) / (double)(xnuTSCFreq);
587-
double e = (pwrEnegryUnit * enegryDelta) / (seconds);
587+
double e = (pwrEnergyUnit * energyDelta) / (seconds);
588588
e *= pwrTimeUnit * 1000;
589-
uniPackageEnegry = e;
589+
uniPackageEnergy = e;
590590

591591

592-
lastUpdateEnergyValue = enegryValue;
592+
lastUpdateEnergyValue = energyValue;
593593
pwrLastTSC = rdtsc64();
594594
}
595595

AMDRyzenCPUPowerManagement/AMDRyzenCPUPowerManagement.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class AMDRyzenCPUPowerManagement : public IOService {
200200
uint64_t lastUpdateTime;
201201
uint64_t lastUpdateEnergyValue;
202202

203-
double uniPackageEnegry;
203+
double uniPackageEnergy;
204204

205205
bool disablePrivilegeCheck = false;
206206

@@ -224,7 +224,7 @@ class AMDRyzenCPUPowerManagement : public IOService {
224224

225225
float tempOffset = 0;
226226
double pwrTimeUnit = 0;
227-
double pwrEnegryUnit = 0;
227+
double pwrEnergyUnit = 0;
228228
uint64_t pwrLastTSC = 0;
229229

230230
uint64_t xnuTSCFreq = 1;

SMCAMDProcessor/KeyImplementations.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AMDSupportVsmcValue : public VirtualSMCValue {
3232
class TempPackage : public AMDSupportVsmcValue { using AMDSupportVsmcValue::AMDSupportVsmcValue; protected: SMC_RESULT readAccess() override; };
3333
class TempCore : public AMDSupportVsmcValue { using AMDSupportVsmcValue::AMDSupportVsmcValue; protected: SMC_RESULT readAccess() override; };
3434

35-
class EnegryPackage: public AMDSupportVsmcValue
35+
class EnergyPackage: public AMDSupportVsmcValue
3636
{ using AMDSupportVsmcValue::AMDSupportVsmcValue; protected: SMC_RESULT readAccess() override; };
3737

3838
#endif /* KeyImplementations_hpp */

SMCAMDProcessor/Keyimplementations.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ SMC_RESULT TempCore::readAccess() {
2323
return SmcSuccess;
2424
}
2525

26-
SMC_RESULT EnegryPackage::readAccess(){
26+
SMC_RESULT EnergyPackage::readAccess(){
2727
if (type == SmcKeyTypeFloat)
28-
*reinterpret_cast<uint32_t *>(data) = VirtualSMCAPI::encodeFlt(provider->uniPackageEnegry);
28+
*reinterpret_cast<uint32_t *>(data) = VirtualSMCAPI::encodeFlt(provider->uniPackageEnergy);
2929
else
30-
*reinterpret_cast<uint16_t *>(data) = VirtualSMCAPI::encodeSp(type, provider->uniPackageEnegry);
30+
*reinterpret_cast<uint16_t *>(data) = VirtualSMCAPI::encodeSp(type, provider->uniPackageEnergy);
3131

3232
return SmcSuccess;
3333
}

SMCAMDProcessor/SMCAMDProcessor.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ bool SMCAMDProcessor::setupKeysVsmc(){
2525
suc &= VirtualSMCAPI::addKey(KeyTCxp(0), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new TempPackage(fProvider, 0)));
2626

2727

28-
suc &= VirtualSMCAPI::addKey(KeyPCPR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(fProvider, 0)));
29-
suc &= VirtualSMCAPI::addKey(KeyPSTR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(fProvider, 0)));
30-
// suc &= VirtualSMCAPI::addKey(KeyPCPT, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
31-
// suc &= VirtualSMCAPI::addKey(KeyPCTR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
28+
suc &= VirtualSMCAPI::addKey(KeyPCPR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(fProvider, 0)));
29+
suc &= VirtualSMCAPI::addKey(KeyPSTR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(fProvider, 0)));
30+
// suc &= VirtualSMCAPI::addKey(KeyPCPT, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
31+
// suc &= VirtualSMCAPI::addKey(KeyPCTR, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
3232

3333

34-
// VirtualSMCAPI::addKey(KeyPC0C, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
35-
// VirtualSMCAPI::addKey(KeyPC0R, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
36-
// VirtualSMCAPI::addKey(KeyPCAM, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnegryPackage(this, 0)));
37-
// VirtualSMCAPI::addKey(KeyPCPC, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
34+
// VirtualSMCAPI::addKey(KeyPC0C, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
35+
// VirtualSMCAPI::addKey(KeyPC0R, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
36+
// VirtualSMCAPI::addKey(KeyPCAM, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnergyPackage(this, 0)));
37+
// VirtualSMCAPI::addKey(KeyPCPC, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
3838
//
39-
// VirtualSMCAPI::addKey(KeyPC0G, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
40-
// VirtualSMCAPI::addKey(KeyPCGC, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnegryPackage(this, 0)));
41-
// VirtualSMCAPI::addKey(KeyPCGM, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnegryPackage(this, 0)));
42-
// VirtualSMCAPI::addKey(KeyPCPG, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnegryPackage(this, 0)));
39+
// VirtualSMCAPI::addKey(KeyPC0G, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
40+
// VirtualSMCAPI::addKey(KeyPCGC, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnergyPackage(this, 0)));
41+
// VirtualSMCAPI::addKey(KeyPCGM, vsmcPlugin.data, VirtualSMCAPI::valueWithFlt(0, new EnergyPackage(this, 0)));
42+
// VirtualSMCAPI::addKey(KeyPCPG, vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp96, new EnergyPackage(this, 0)));
4343

4444
//Since AMD cpu dont have temperature MSR for each core, we simply report the same package temperature for all cores.
4545
// for(int core = 0; core < totalNumberOfPhysicalCores; core++){

0 commit comments

Comments
 (0)