Implement Inventory.Item for CPU presence

Bmcweb Redfish code now relies on the xyz.openbmc_project.Inventory.Item
interface to determine Processor presence status. And if this interface
does not exist, CPUs are shown as Present by default. Therefore, to
avoid false positive presence, this commit fills out the interface based
on Status field of the Type 4 table.

Tested:
GET /redfish/v1/Systems/system/Processor/cpu1 (unpopulated socket)
-> Before change:
{
    ...
    "Manufacturer": "CPU1",
    "MaxSpeedMHz": 4000,
    "ProcessorId": {
        "EffectiveFamily": "Unknown Processor Family"
    },
    "Socket": "CPU1",
    "Status": {
        "Health": "OK",
        "State": "Enabled"
    },
    "Version": "CPU1"
    ...
}
-> After change:
{
    ...
    "Manufacturer": "",
    "MaxSpeedMHz": 0,
    "ProcessorId": {
        "EffectiveFamily": ""
    },
    "Socket": "CPU1",
    "Status": {
        "Health": "OK",
        "State": "Absent"
    },
    "Version": ""
    ...
}

GET /redfish/v1/Systems/system/Processor/cpu0 (populated socket)
-> Before/after change:
{
    ...
    "Status": {
        "Health": "OK",
        "State": "Enabled"
    },
    ...
}

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: I8868919e3f919d774b8bedb6c48cc6e4bc764c26
diff --git a/src/cpu.cpp b/src/cpu.cpp
index 90c1191..9eb90f4 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -110,8 +110,17 @@
 
     auto cpuInfo = reinterpret_cast<struct ProcessorInfo*>(dataIn);
 
-    socket(cpuInfo->socketDesignation, cpuInfo->length,
-           dataIn); // offset 4h
+    socket(cpuInfo->socketDesignation, cpuInfo->length, dataIn); // offset 4h
+
+    constexpr uint32_t socketPopulatedMask = 1 << 6;
+    if ((cpuInfo->status & socketPopulatedMask) == 0)
+    {
+        // Don't attempt to fill in any other details if the CPU is not present.
+        present(false);
+        return;
+    }
+    present(true);
+
     // this class is for type CPU  //offset 5h
     family(cpuInfo->family); // offset 6h
     manufacturer(cpuInfo->manufacturer, cpuInfo->length,