summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/hwpf')
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpError.C4
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C15
-rw-r--r--src/usr/hwpf/plat/fapiPlatUtil.C25
3 files changed, 32 insertions, 12 deletions
diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C
index ea1662dca..b7e1119c1 100644
--- a/src/usr/hwpf/hwp/fapiTestHwpError.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpError.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -68,7 +68,7 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
// Log the error
- fapiLogError(l_rc);
+ fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE);
// Check that the return code is set to success
if (!l_rc.ok())
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index a8c0f6122..f23a76931 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -64,7 +64,7 @@ HWAS::callOutPriority xlateCalloutPriority(
FAPI_ERR("fapi::xlateCalloutPriority: Unknown priority 0x%x, assuming HIGH",
i_fapiPri);
}
-
+
return l_priority;
}
@@ -131,7 +131,7 @@ HWAS::epubProcedureID xlateProcedureCallout(
FAPI_ERR("fapi::xlateProcedureCallout: Unknown proc 0x%x, assuming CODE",
i_fapiProc);
}
-
+
return l_proc;
}
@@ -213,7 +213,7 @@ void processEIFfdcs(const ErrorInfo & i_errInfo,
HWPF_COMP_ID, &l_ffdcId, sizeof(l_ffdcId), 1, HWPF_UDT_HWP_FFDC);
if (l_pUD)
- {
+ {
io_pError->appendToFFDC(l_pUD, l_pFfdc, l_size);
}
}
@@ -459,7 +459,8 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo,
//******************************************************************************
// fapiRcToErrl function. Converts a fapi::ReturnCode to an error log
//******************************************************************************
-errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
+errlHndl_t fapiRcToErrl(ReturnCode & io_rc,
+ ERRORLOG::errlSeverity_t i_sev)
{
errlHndl_t l_pError = NULL;
@@ -482,8 +483,6 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
uint32_t l_rcValue = static_cast<uint32_t>(io_rc);
FAPI_ERR("fapiRcToErrl: HWP error: 0x%08x", l_rcValue);
- // TODO What should the severity be? Should it be in the error info?
-
/*@
* @errortype
* @moduleid MOD_HWP_RC_TO_ERRL
@@ -492,7 +491,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
* @userdata2 <unused>
* @devdesc HW Procedure generated error. See User Data.
*/
- l_pError = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ l_pError = new ERRORLOG::ErrlEntry(i_sev,
MOD_HWP_RC_TO_ERRL,
RC_HWP_GENERATED_ERROR,
TO_UINT64(l_rcValue));
@@ -532,7 +531,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc)
l_reasonCode |= HWPF_COMP_ID;
// HostBoot errlog tags for FAPI errors are in hwpfReasonCodes.H
- l_pError = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ l_pError = new ERRORLOG::ErrlEntry(i_sev,
MOD_FAPI_RC_TO_ERRL,
l_reasonCode);
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C
index 1b8575c9e..939f695cf 100644
--- a/src/usr/hwpf/plat/fapiPlatUtil.C
+++ b/src/usr/hwpf/plat/fapiPlatUtil.C
@@ -36,6 +36,7 @@
#include <fapiPlatHwpInvoker.H>
#include <vfs/vfs.H>
#include <initservice/initsvcbreakpoint.H>
+#include <errl/errlentry.H>
//******************************************************************************
@@ -90,8 +91,11 @@ fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles)
//******************************************************************************
// fapiLogError
//******************************************************************************
-void fapiLogError(fapi::ReturnCode & io_rc)
+void fapiLogError(fapi::ReturnCode & io_rc,
+ fapi::fapiErrlSeverity_t i_sev)
{
+ // ENUM CONVERSION FAPI to PLATFORM
+
errlHndl_t l_pError = NULL;
bool l_unitTestError = false;
@@ -102,10 +106,27 @@ void fapiLogError(fapi::ReturnCode & io_rc)
l_unitTestError = true;
}
+ // Convert a FAPI severity to a ERRORLOG severity
+ ERRORLOG::errlSeverity_t l_sev = ERRORLOG::ERRL_SEV_UNRECOVERABLE;
+ switch (i_sev)
+ {
+ case fapi::FAPI_ERRL_SEV_RECOVERED:
+ l_sev = ERRORLOG::ERRL_SEV_RECOVERED;
+ break;
+ case fapi::FAPI_ERRL_SEV_PREDICTIVE:
+ l_sev = ERRORLOG::ERRL_SEV_PREDICTIVE;
+ break;
+ case fapi::FAPI_ERRL_SEV_UNRECOVERABLE:
+ // l_sev set above
+ break;
+ default:
+ FAPI_ERR("severity (i_sev) of %d is unknown",i_sev);
+ }
+
// Convert the return code to an error log.
// This will set the return code to FAPI_RC_SUCCESS and clear any PLAT Data,
// HWP FFDC data, and Error Target associated with it.
- l_pError = fapiRcToErrl(io_rc);
+ l_pError = fapiRcToErrl(io_rc, l_sev);
// Commit the error log. This will delete the error log and set the handle
// to NULL.
OpenPOWER on IntegriCloud