summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-04-16 17:52:29 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-19 17:52:33 -0400
commit2154ad02364923d5b158825729d6e630ec7cc529 (patch)
tree7f7c5dc9b411ea75086a96828ca0a358553f52c1
parent47d4e4119f6a196dd61c1b93237d3ff4af7f0cd3 (diff)
downloadtalos-hostboot-2154ad02364923d5b158825729d6e630ec7cc529.tar.gz
talos-hostboot-2154ad02364923d5b158825729d6e630ec7cc529.zip
Create new HWP Invoker macro that returns the RC
Allow the RC of a HWP to be returned along with the associated error log. This allows logic to be based on the specific RC if needed. Change-Id: I90a78ace2cc4263265940764dffd0691dd56e2f5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57302 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/fapi2/plat_hwp_invoker.H28
-rwxr-xr-xsrc/usr/fapi2/test/rcTest.C17
2 files changed, 43 insertions, 2 deletions
diff --git a/src/include/usr/fapi2/plat_hwp_invoker.H b/src/include/usr/fapi2/plat_hwp_invoker.H
index a0b335a1e..c19812620 100644
--- a/src/include/usr/fapi2/plat_hwp_invoker.H
+++ b/src/include/usr/fapi2/plat_hwp_invoker.H
@@ -61,7 +61,7 @@ void hwpLock( bool i_lock );
* parameters. This macro simply calls the FAPI HWP executor macro and converts
* the returned fapi::Return code to a HostBoot error log
*
- * ERRHNDL - errlHndl_t
+ * ERRHNDL - local errlHndl_t
* FUNC - HWP function name
* _args_... - Any additional arguments that the HWP requires
*/
@@ -80,6 +80,32 @@ void hwpLock( bool i_lock );
}
/**
+ * @brief HWP Invoker macro that returns the fapi RC
+ *
+ * This macro is called by HostBoot PLAT code to invoke a HW Procedure (HWP).
+ * The caller must create any necessary fapi::Targets and pass them as
+ * parameters. This macro simply calls the FAPI HWP executor macro and converts
+ * the returned fapi::Return code to a HostBoot error log
+ *
+ * ERRHNDL - local errlHndl_t
+ * _RC - local fapi2::ReturnCode
+ * FUNC - HWP function name
+ * _args_... - Any additional arguments that the HWP requires
+ */
+
+#define FAPI_INVOKE_HWP_RC(ERRHNDL, _RC, FUNC, _args_...) \
+ {\
+ fapi2::hwpLock(true); \
+ FAPI_EXEC_HWP(_RC, FUNC, ##_args_); \
+ ERRHNDL = fapi2::rcToErrl(_RC);\
+ if( ERRHNDL ) {\
+ ERRHNDL->collectTrace(FAPI_IMP_TRACE_NAME,256);\
+ ERRHNDL->collectTrace(FAPI_TRACE_NAME,384);\
+ }\
+ fapi2::hwpLock(false); \
+ }
+
+/**
* @brief Pseudo-HWP Invoker macro
*
* This macro is called by HostBoot PLAT code to invoke a HW Procedure (HWP)
diff --git a/src/usr/fapi2/test/rcTest.C b/src/usr/fapi2/test/rcTest.C
index 353eebbdf..4893aef95 100755
--- a/src/usr/fapi2/test/rcTest.C
+++ b/src/usr/fapi2/test/rcTest.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2017 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -1750,6 +1750,21 @@ uint32_t rcTestReturnCodeAttrErrls()
TS_FAIL("No error from p9_registerFfdc_fail !!");
numFails++;
}
+
+ numTests++;
+ fapi2::ReturnCode l_rc;
+ FAPI_INVOKE_HWP_RC(l_errl, l_rc, p9_registerFfdc_fail, fapi2_procTarget);
+ if( (l_errl != NULL) && (l_rc == (fapi2::ReturnCode)fapi2::RC_TEST_ERROR_A) )
+ {
+ FAPI_INF("p9_registerFfdc_fail returned correct RC");
+ delete l_errl;
+ l_errl = NULL;
+ }
+ else
+ {
+ TS_FAIL("Wrong RC from p9_registerFfdc_fail !!");
+ numFails++;
+ }
} while (0);
FAPI_INF("rcTestReturnCodeAttrErrls Test Complete. %d/%d fails",
OpenPOWER on IntegriCloud