diff options
author | Mike Jones <mjjones@us.ibm.com> | 2013-03-22 16:00:47 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-04-04 17:08:36 -0500 |
commit | d80544e716c93297feb4c64fceabcdec6c2efbc7 (patch) | |
tree | c1652e24fd8487cbf5ce6fdc67734938c2f28a4e /src/usr/hwpf/plat | |
parent | f3af02b13688f74136c9983fb9919bf64b9eb304 (diff) | |
download | talos-hostboot-d80544e716c93297feb4c64fceabcdec6c2efbc7.tar.gz talos-hostboot-d80544e716c93297feb4c64fceabcdec6c2efbc7.zip |
HWPF: Support Procedure Callouts
Change-Id: I250472ba4125944ba17433c759c915b30a9bc93e
RTC: 50323
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3699
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/plat')
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatHwpInvoker.C | 132 |
1 files changed, 112 insertions, 20 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C index 66753c655..dd392dc7e 100644 --- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C +++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C @@ -36,10 +36,78 @@ namespace fapi { -//****************************************************************************** -// processEIFfdcs. -// Processes any FFDC in the ReturnCode Error Information -//****************************************************************************** +/** + * @brief Translates a FAPI callout priority to an HWAS callout priority + * + * @param[i] i_fapiPri FAPI callout priority + * + * @return HWAS callout priority + */ +HWAS::callOutPriority xlateCalloutPriority( + const fapi::CalloutPriorities::CalloutPriority i_fapiPri) +{ + // Use the CalloutPriority enum value as an index + HWAS::callOutPriority l_priority = HWAS::SRCI_PRIORITY_HIGH; + size_t l_index = i_fapiPri; + + const HWAS::callOutPriority HWAS_PRI[] = {HWAS::SRCI_PRIORITY_LOW, + HWAS::SRCI_PRIORITY_MED, + HWAS::SRCI_PRIORITY_HIGH}; + + if (l_index < (sizeof(HWAS_PRI)/sizeof(HWAS::callOutPriority))) + { + l_priority = HWAS_PRI[i_fapiPri]; + } + else + { + FAPI_ERR( + "fapi::xlateCalloutPriority: Unknown priority 0x%x, assuming HIGH", + i_fapiPri); + } + + return l_priority; +} + +/** + * @brief Translates a FAPI procedure callout to an HWAS procedure callout + * + * @param[i] i_fapiProc FAPI procedure callout + * + * @return HWAS procedure callout + */ +HWAS::epubProcedureID xlateProcedureCallout( + const fapi::ProcedureCallouts::ProcedureCallout i_fapiProc) +{ + // Use the ProcedureCallout enum value as an index + HWAS::epubProcedureID l_proc = HWAS::EPUB_PRC_HB_CODE; + size_t l_index = i_fapiProc; + + const HWAS::epubProcedureID HWAS_PROC[] = { + HWAS::EPUB_PRC_HB_CODE, + HWAS::EPUB_PRC_LVL_SUPP, + HWAS::EPUB_PRC_MEMORY_PLUGGING_ERROR}; + + if (l_index < (sizeof(HWAS_PROC)/sizeof(HWAS::epubProcedureID))) + { + l_proc = HWAS_PROC[i_fapiProc]; + } + else + { + FAPI_ERR( + "fapi::xlateProcedureCallout: Unknown proc 0x%x, assuming CODE", + i_fapiProc); + } + + return l_proc; +} + +/** + * @brief Processes any FFDC in the ReturnCode Error Information and adds them + * to the error log + * + * @param[i] i_errInfo Reference to ReturnCode Error Information + * @param[io] io_pError Errorlog Handle + */ void processEIFfdcs(const ErrorInfo & i_errInfo, errlHndl_t io_pError) { @@ -63,11 +131,39 @@ void processEIFfdcs(const ErrorInfo & i_errInfo, } } -//****************************************************************************** -// processEICDGs -// Processes any Callout/Deconfigure/GARD requests in the ReturnCode Error -// Information -//****************************************************************************** +/** + * @brief Processes any Procedure callouts requests in the ReturnCode Error + * Information and adds them to the error log + * + * @param[i] i_errInfo Reference to ReturnCode Error Information + * @param[io] io_pError Errorlog Handle + */ +void processEIProcCallouts(const ErrorInfo & i_errInfo, + errlHndl_t io_pError) +{ + // Iterate through the procedure callout requests, adding each to the error + // log + for (ErrorInfo::ErrorInfoProcedureCalloutCItr_t l_itr = + i_errInfo.iv_procedureCallouts.begin(); + l_itr != i_errInfo.iv_procedureCallouts.end(); ++l_itr) + { + HWAS::epubProcedureID l_procedure = + xlateProcedureCallout((*l_itr)->iv_procedure); + + HWAS::callOutPriority l_priority = + xlateCalloutPriority((*l_itr)->iv_calloutPriority); + + io_pError->addProcedureCallout(l_procedure, l_priority); + } +} + +/** + * @brief Processes any Callout/Deconfigure/GARD requests in the ReturnCode Error + * Information and adds them to the error log + * + * @param[i] i_errInfo Reference to ReturnCode Error Information + * @param[io] io_pError Errorlog Handle + */ void processEICDGs(const ErrorInfo & i_errInfo, errlHndl_t io_pError) { @@ -76,22 +172,15 @@ void processEICDGs(const ErrorInfo & i_errInfo, // by calling out Target pairs, then the HWAS::SRCI_PRIORITY will need to // be a 'grouping' priority (MEDA/B/C) - // Iterate through the CGD requests, adding each to the error log + // Iterate through the CGD requests, adding each to the error log for (ErrorInfo::ErrorInfoCDGCItr_t l_itr = i_errInfo.iv_CDGs.begin(); l_itr != i_errInfo.iv_CDGs.end(); ++l_itr) { TARGETING::Target * l_pTarget = reinterpret_cast<TARGETING::Target*>((*l_itr)->iv_target.get()); - HWAS::callOutPriority l_priority = HWAS::SRCI_PRIORITY_HIGH; - if ((*l_itr)->iv_calloutPriority == fapi::PRI_MEDIUM) - { - l_priority = HWAS::SRCI_PRIORITY_MED; - } - else if ((*l_itr)->iv_calloutPriority == fapi::PRI_LOW) - { - l_priority = HWAS::SRCI_PRIORITY_LOW; - } + HWAS::callOutPriority l_priority = + xlateCalloutPriority((*l_itr)->iv_calloutPriority); HWAS::DeconfigEnum l_deconfig = HWAS::NO_DECONFIG; if ((*l_itr)->iv_deconfigure) @@ -161,6 +250,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc) { // There is error information associated with the ReturnCode processEIFfdcs(*l_pErrorInfo, l_pError); + processEIProcCallouts(*l_pErrorInfo, l_pError); processEICDGs(*l_pErrorInfo, l_pError); } else @@ -185,13 +275,15 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc) MOD_FAPI_RC_TO_ERRL, l_reasonCode); - // FAPI may have added FFDC Error Information. + // FAPI may have added Error Information. // Get the Error Information Pointer const ErrorInfo * l_pErrorInfo = io_rc.getErrorInfo(); if (l_pErrorInfo) { processEIFfdcs(*l_pErrorInfo, l_pError); + processEIProcCallouts(*l_pErrorInfo, l_pError); + processEICDGs(*l_pErrorInfo, l_pError); } } |