From 2154ad02364923d5b158825729d6e630ec7cc529 Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 16 Apr 2018 17:52:29 -0500 Subject: 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 Reviewed-by: Caleb N. Palmer Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/include/usr/fapi2/plat_hwp_invoker.H | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/include/usr') 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 */ @@ -79,6 +79,32 @@ void hwpLock( bool i_lock ); fapi2::hwpLock(false); \ } +/** + * @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 * -- cgit v1.2.1