summaryrefslogtreecommitdiff
path: root/src/cpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu.cpp')
-rw-r--r--src/cpu.cpp66
1 files changed, 21 insertions, 45 deletions
diff --git a/src/cpu.cpp b/src/cpu.cpp
index 552a781..8f4fd49 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -26,7 +26,7 @@ namespace phosphor
namespace smbios
{
-void Cpu::cpuSocket(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
+void Cpu::socket(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
{
std::string result;
@@ -37,12 +37,7 @@ void Cpu::cpuSocket(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
location::locationCode(result);
}
-std::string Cpu::processorSocket(std::string value)
-{
- return processor::socket(value);
-}
-
-void Cpu::cpuFamily(uint8_t value)
+void Cpu::family(uint8_t value)
{
std::map<uint8_t, std::string>::const_iterator it = familyTable.find(value);
if (it == familyTable.end())
@@ -55,7 +50,7 @@ void Cpu::cpuFamily(uint8_t value)
}
}
-void Cpu::cpuManufacturer(uint8_t positionNum, uint8_t structLen,
+void Cpu::manufacturer(uint8_t positionNum, uint8_t structLen,
uint8_t *dataIn)
{
std::string result;
@@ -65,12 +60,7 @@ void Cpu::cpuManufacturer(uint8_t positionNum, uint8_t structLen,
asset::manufacturer(result);
}
-uint32_t Cpu::processorId(uint32_t value)
-{
- return processor::id(value);
-}
-
-void Cpu::cpuVersion(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
+void Cpu::version(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
{
std::string result;
@@ -80,12 +70,7 @@ void Cpu::cpuVersion(uint8_t positionNum, uint8_t structLen, uint8_t *dataIn)
rev::version(result);
}
-uint16_t Cpu::processorMaxSpeed(uint16_t value)
-{
- return processor::maxSpeedInMhz(value);
-}
-
-void Cpu::cpuCharacteristics(uint16_t value)
+void Cpu::characteristics(uint16_t value)
{
std::vector<processor::Capability> result;
std::optional<processor::Capability> cap;
@@ -105,18 +90,8 @@ void Cpu::cpuCharacteristics(uint16_t value)
processor::characteristics(result);
}
-uint16_t Cpu::processorCoreCount(uint16_t value)
-{
- return processor::coreCount(value);
-}
-
-uint16_t Cpu::processorThreadCount(uint16_t value)
-{
- return processor::threadCount(value);
-}
-
static constexpr uint8_t maxOldVersionCount = 0xff;
-void Cpu::processorInfoUpdate(void)
+void Cpu::infoUpdate(void)
{
uint8_t *dataIn = regionS[0].regionData;
@@ -146,37 +121,38 @@ void Cpu::processorInfoUpdate(void)
if ((cpuInfo->status & socketPopulatedMask) == 0)
{
// Don't attempt to fill in any other details if the CPU is not present.
- present(false);
+ item::present(false);
return;
}
- present(true);
-
- cpuSocket(cpuInfo->socketDesignation, cpuInfo->length, dataIn); // offset 4h
- cpuFamily(cpuInfo->family); // offset 6h
- cpuManufacturer(cpuInfo->manufacturer, cpuInfo->length, dataIn);// offset 7h
- processorId(cpuInfo->id); // offset 8h
- cpuVersion(cpuInfo->version, cpuInfo->length, dataIn); // offset 10h
- processorMaxSpeed(cpuInfo->maxSpeed); // offset 14h
+ item::present(true);
+ operstatus::functional(true);
+
+ socket(cpuInfo->socketDesignation, cpuInfo->length, dataIn); // offset 4h
+ family(cpuInfo->family); // offset 6h
+ manufacturer(cpuInfo->manufacturer, cpuInfo->length, dataIn);// offset 7h
+ processor::id(cpuInfo->id); // offset 8h
+ version(cpuInfo->version, cpuInfo->length, dataIn); // offset 10h
+ processor::maxSpeedInMhz(cpuInfo->maxSpeed); // offset 14h
if (cpuInfo->coreCount < maxOldVersionCount) // offset 23h or 2Ah
{
- processorCoreCount((uint16_t)cpuInfo->coreCount);
+ processor::coreCount((uint16_t)cpuInfo->coreCount);
}
else
{
- processorCoreCount(cpuInfo->coreCount2);
+ processor::coreCount(cpuInfo->coreCount2);
}
if (cpuInfo->threadCount < maxOldVersionCount) // offset 25h or 2Eh)
{
- processorThreadCount((uint16_t)cpuInfo->threadCount);
+ processor::coreCount((uint16_t)cpuInfo->threadCount);
}
else
{
- processorThreadCount(cpuInfo->threadCount2);
+ processor::coreCount(cpuInfo->threadCount2);
}
- cpuCharacteristics(cpuInfo->characteristics); // offset 26h
+ characteristics(cpuInfo->characteristics); // offset 26h
}
} // namespace smbios