summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCode.H17
-rw-r--r--src/include/usr/hwpf/fapi/fapiUtil.H24
2 files changed, 41 insertions, 0 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H
index 7f9a6ff32..fb218e560 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCode.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H
@@ -34,6 +34,8 @@
* mjjones 07/05/2011 Removed const from data
* mjjones 07/25/2011 Added support for FFDC and
* Error Target
+ * camvanng 09/06/2011 Added function template for
+ * setHwpFfdc
*/
#ifndef FAPIRETURNCODE_H_
@@ -209,6 +211,21 @@ public:
void setHwpFfdc(const void * i_pFfdc, const uint32_t i_size);
/**
+ * @brief Stores a copy of the provided HwpFfdc
+ *
+ * param[in] i_data FFDC data, which can be any type
+ *
+ * Example usage:
+ * uint32_t l_data = 0x12345678;
+ * fapi::ReturnCode l_rc;
+ * l_rc.setHwpFfdc(l_data);
+ */
+ template<class T> void setHwpFfdc(const T & i_data)
+ {
+ setHwpFfdc(&i_data, sizeof(T));
+ }
+
+ /**
* @brief Gets the creator of the return code
*
* @return ReturnCodeCreator
diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H
index ad0c7a364..ad1532699 100644
--- a/src/include/usr/hwpf/fapi/fapiUtil.H
+++ b/src/include/usr/hwpf/fapi/fapiUtil.H
@@ -34,6 +34,7 @@
* camvanng 05/31/2011 Removed fapiOutputx macros
* mjjones 06/30/2011 Removed #include
* mjjones 07/05/2011 Removed rogue tab
+ * camvanng 09/06/2011 Added fapiLogError
*
*/
@@ -85,6 +86,29 @@ void fapiAssert(bool i_expression);
fapi::ReturnCode delay( uint64_t i_nanoSeconds, uint64_t i_simCycles );
+/**
+ * @brief Log an error.
+ *
+ * This function can be called by HWP to log an error.
+ *
+ * @note Implemented by platform code
+ *
+ * @param[io] Reference to ReturnCode (Any references to data and error
+ * target are removed and rc value is set to success after
+ * function ends.)
+ *
+ * Example usage:
+ * fapi::ReturnCode l_rc;
+ * FAPI_EXEC_HWP(l_rc, function1, i_target);
+ * if (!l_rc)
+ * {
+ * fapiLogError(l_rc);
+ * }
+ *
+ * FAPI_EXEC_HWP(l_rc, function2, i_target)
+ * return rc;
+ */
+void fapiLogError(ReturnCode & io_rc);
}
OpenPOWER on IntegriCloud