PHAL: Add procedure callout for hwp errors

Added infrastructure to enable procedure callout support
for the HWP failure related PEL

Tested:
User data 1
"HWP_PROC_CO_01_MAINT_PROCEDURE": "BMC0002",
"HWP_PROC_CO_01_PRIORITY": "MEDIUM",

"Callout Section": {
            "FRU Type":         "Maintenance Procedure Required",
            "Priority":         "Medium Priority",
            "Procedure":        "BMC0002"
        }

Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I25f7bed2817a767c219a7a4c2ad6d71ccb3bbf07
diff --git a/extensions/phal/phal_error.cpp b/extensions/phal/phal_error.cpp
index 259cf27..e775625 100644
--- a/extensions/phal/phal_error.cpp
+++ b/extensions/phal/phal_error.cpp
@@ -459,6 +459,33 @@
 
                          jsonCalloutDataList.emplace_back(jsonCalloutData);
                      });
+            // Adding procedure callout
+            calloutCount = 0;
+            for_each(
+                ffdc.hwp_errorinfo.procedures_callout.begin(),
+                ffdc.hwp_errorinfo.procedures_callout.end(),
+                [&pelAdditionalData, &calloutCount, &jsonCalloutDataList](
+                    const ProcedureCallout& procCallout) -> void {
+                    calloutCount++;
+                    std::stringstream keyPrefix;
+                    keyPrefix << "HWP_PROC_CO_" << std::setfill('0')
+                              << std::setw(2) << calloutCount << "_";
+
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("PRIORITY"),
+                        procCallout.callout_priority);
+
+                    pelAdditionalData.emplace_back(
+                        std::string(keyPrefix.str()).append("MAINT_PROCEDURE"),
+                        procCallout.proc_callout);
+
+                    json jsonCalloutData;
+                    jsonCalloutData["Procedure"] = procCallout.proc_callout;
+                    std::string pelPriority =
+                        getPelPriority(procCallout.callout_priority);
+                    jsonCalloutData["Priority"] = pelPriority;
+                    jsonCalloutDataList.emplace_back(jsonCalloutData);
+                });
         }
         else if ((ffdc.ffdc_type != FFDC_TYPE_NONE) &&
                  (ffdc.ffdc_type != FFDC_TYPE_UNSUPPORTED))