summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2013-09-16 15:19:11 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-03 11:29:02 -0500
commit31c08a8a79c92f52b10fbeb32928aa88a5968cee (patch)
tree92fa82c04294a4e6d5a4d9be2074acb80ad980f8
parent2005f2b4c6d477e5dafa16c447c8d7f43ae16c19 (diff)
downloadblackbird-hostboot-31c08a8a79c92f52b10fbeb32928aa88a5968cee.tar.gz
blackbird-hostboot-31c08a8a79c92f52b10fbeb32928aa88a5968cee.zip
Add severity parameters to fapiLogError
RTC:80889 Change-Id: I7474e5a44cbc44151224a26ae60153b9a0160b29 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6240 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/errl/hberrltypes.H2
-rw-r--r--src/include/usr/hwpf/fapi/fapiUtil.H39
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H49
-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
6 files changed, 88 insertions, 46 deletions
diff --git a/src/include/usr/errl/hberrltypes.H b/src/include/usr/errl/hberrltypes.H
index a54683de8..78e01dba0 100644
--- a/src/include/usr/errl/hberrltypes.H
+++ b/src/include/usr/errl/hberrltypes.H
@@ -167,6 +167,8 @@ enum errlSectionId_t
enum errlSeverity_t
{
ERRL_SEV_INFORMATIONAL = 0x00, //Information
+ ERRL_SEV_RECOVERED = 0x10, //Recovered
+ ERRL_SEV_PREDICTIVE = 0x20, //Predictive Error, general
ERRL_SEV_UNRECOVERABLE = 0x40, //Unrecoverable, general
ERRL_SEV_CRITICAL_SYS_TERM = 0x51, //Critical, System Termination
ERRL_SEV_UNKNOWN = 0xFF //Reserved
diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H
index fa7728271..9d149de63 100644
--- a/src/include/usr/hwpf/fapi/fapiUtil.H
+++ b/src/include/usr/hwpf/fapi/fapiUtil.H
@@ -54,7 +54,7 @@
#include <fapiReturnCode.H>
#include <fapiPlatUtil.H>
-// Defines for endian convertion
+// Defines for endian convertion
#define FAPI_BE16TOH(x) FAPI_PLAT_BE16TOH(x)
#define FAPI_LE16TOH(x) FAPI_PLAT_LE16TOH(x)
#define FAPI_HTOBE16(x) FAPI_PLAT_HTOBE16(x)
@@ -95,27 +95,41 @@ void fapiAssert(bool i_expression);
* task. When the delay time expires, the task becomes runnable and will soon
* return from the syscall. Callers of delay() in the hostboot environment
* will likely have to know the mHz clock speed they are running on and
- * compute a non-zero value for i_nanoSeconds.
- *
+ * compute a non-zero value for i_nanoSeconds.
+ *
* On the FSP, it was sometimes acceptable to just provide zero for the
* sleep delay time, causing the task to yield its time slice. By the
* time the calling task could run again, it was pretty certain enough
* host cycles had past. This is probably not acceptable in
* the hostboot environment. Callers should calculate and provide a
- * sleep value in nanoseconds relative to host clock speed.
+ * sleep value in nanoseconds relative to host clock speed.
*
* On FSP when VBU is the target, then the i_simCycles parameter will be
* used instead. The FSP needs to use the simdispatcher client/server
* API and issue a command to the awan to advance the simulation the
- * specified number of cycles.
- *
- * @param[in] i_nanoSeconds nanoseconds to sleep
+ * specified number of cycles.
+ *
+ * @param[in] i_nanoSeconds nanoseconds to sleep
* @param[in] i_simCycles count of Awan cycles to advance
- *
+ *
* @return ReturnCode. Zero on success, else platform specified error.
*/
fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles);
+namespace fapi
+{
+/**
+ * @brief Enumeration of error log severity.
+ */
+enum fapiErrlSeverity_t
+{
+ FAPI_ERRL_SEV_RECOVERED = 0x10, //Not seen by customer
+ FAPI_ERRL_SEV_PREDICTIVE = 0x20, //Error recovered but customer will see
+ FAPI_ERRL_SEV_UNRECOVERABLE = 0x40 //Unrecoverable, general
+};
+
+}
+
/**
* @brief Log an error.
*
@@ -126,6 +140,7 @@ fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles);
* @param[in,out] io_rc Reference to ReturnCode (Any references to data and error
* target are removed and rc value is set to success after
* function ends.)
+ * @param[in] i_sev Fapi error log severity defaulted to unrecoverable
*
* Example usage: <br>
* fapi::ReturnCode l_rc; <br>
@@ -138,7 +153,9 @@ fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles);
* FAPI_EXEC_HWP(l_rc, function2, i_target) <br>
* return rc; <br>
*/
-void fapiLogError(fapi::ReturnCode & io_rc);
+void fapiLogError(fapi::ReturnCode & io_rc,
+ fapi::fapiErrlSeverity_t i_sev =
+ fapi::FAPI_ERRL_SEV_UNRECOVERABLE);
/** @brief This function answers the question, is scand tracing turned on?
* The implementation of this function is specific to the platform.
@@ -160,7 +177,7 @@ void platSetScanTrace(bool i_enable);
* This function can be called by a HWP to load an initfile.
*
* @note Implemented by platform code. Platform code is
- * responsible for allocating any memory needed to load
+ * responsible for allocating any memory needed to load
* the initfile.
*
* @param[in] i_Target reference to the target
@@ -188,7 +205,7 @@ fapi::ReturnCode fapiLoadInitFile(const fapi::Target & i_Target,
*
* @return ReturnCode. Zero on success, else platform specified error.
*/
-fapi::ReturnCode fapiUnloadInitFile(const char * i_file, const char *& io_addr,
+fapi::ReturnCode fapiUnloadInitFile(const char * i_file, const char *& io_addr,
size_t & io_size);
/** @brief Set a break point in the current procedure
diff --git a/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H b/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
index 3f9c78777..100f33245 100644
--- a/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
+++ b/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file fapiPlatHwpInvoker.H
*
@@ -60,10 +60,13 @@ namespace fapi
* @brief Converts a fapi::ReturnCode to a HostBoot PLAT error log
*
* @param[io] io_rc Reference to ReturnCode (set to success after function ends)
+ * @param[in] i_sev Error log severity defaulted to unrecoverable
*
* @return errlHndl_t (NULL if Return Code contained success)
*/
-errlHndl_t fapiRcToErrl(ReturnCode & io_rc);
+errlHndl_t fapiRcToErrl(ReturnCode & io_rc,
+ ERRORLOG::errlSeverity_t i_sev =
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE);
}
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