diff options
| author | Richard J. Knight <rjknight@us.ibm.com> | 2016-02-03 15:39:30 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-02-26 16:23:15 -0600 |
| commit | 65bc26d54dcffb32bd1959f1447b8dba79627e0f (patch) | |
| tree | 476dc4ea74b8342aa62bc7625185af2d190aa9df /src/include/usr/fapi2 | |
| parent | da0248159af1297255bd018180b1f8b3e220503c (diff) | |
| download | talos-hostboot-65bc26d54dcffb32bd1959f1447b8dba79627e0f.tar.gz talos-hostboot-65bc26d54dcffb32bd1959f1447b8dba79627e0f.zip | |
Need an option to allow a HWP to return an error log to platform code.
-Modify FFDC code to capture error log pointer in RC plat pointer
Change-Id: I02266468795ea345610f237b50b14d79cbaef202
RTC:132220
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23663
Tested-by: Jenkins Server
Reviewed-by: Christian Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/fapi2')
| -rw-r--r-- | src/include/usr/fapi2/plat_error_scope.H | 26 | ||||
| -rw-r--r-- | src/include/usr/fapi2/plat_hw_access.H | 59 |
2 files changed, 46 insertions, 39 deletions
diff --git a/src/include/usr/fapi2/plat_error_scope.H b/src/include/usr/fapi2/plat_error_scope.H index 1b47aa40d..fea65c98a 100644 --- a/src/include/usr/fapi2/plat_error_scope.H +++ b/src/include/usr/fapi2/plat_error_scope.H @@ -47,11 +47,14 @@ /// /// @brief Assert a conditional is true. /// If it is not, the FFDC gathering function is called and the -/// trace is output as a FAPI error trace. +/// trace is output as a FAPI error trace. A platform error is +/// created and commited. /// @param[in] __conditional__ the condition to assert /// @param[in] __ffdc__ the FFDC gathering function /// @param[in] ... varargs, as input to FAPI_ERR /// +/// @note: Plat error is stored in RC object +/// #define PLAT_FAPI_ASSERT( __conditional__, __ffdc__, ... ) \ if (! (__conditional__)) \ { \ @@ -60,6 +63,27 @@ goto fapi_try_exit; \ } +/// +/// @brief Assert a conditional is true. +/// If it is not, the FFDC gathering function is called and the +/// trace is output as a FAPI error trace. A platform error is +/// created but will not be committed. +/// @param[in] __conditional__ the condition to assert +/// @param[in] __ffdc__ the FFDC gathering function +/// @param[in] ... varargs, as input to FAPI_ERR +/// +/// @note: Plat error, if supported, is stored in RC object. In +/// addition, this assert does not cause a branch to the +/// fapi_try_exit lable. +/// +#define PLAT_FAPI_ASSERT_NOEXIT( __conditional__, __ffdc__, ... ) \ + if (! (__conditional__)) \ + { \ + __ffdc__.execute( \ + fapi2::FAPI2_ERRL_SEV_UNDEFINED, false); \ + FAPI_ERR(__VA_ARGS__); \ + } \ + /// @endcond #endif diff --git a/src/include/usr/fapi2/plat_hw_access.H b/src/include/usr/fapi2/plat_hw_access.H index febfb5c3e..8ed41a326 100644 --- a/src/include/usr/fapi2/plat_hw_access.H +++ b/src/include/usr/fapi2/plat_hw_access.H @@ -92,9 +92,8 @@ inline ReturnCode platGetScom(const Target<K>& i_target, FAPI_ERR("platGetScom: deviceRead returns error!"); FAPI_ERR("fapiGetScom failed - Target %s, Addr %.16llX", tmpScomStr, i_address); -// Add the error log pointer as data to the ReturnCode -//@TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + // Add the error log pointer as data to the ReturnCode + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); } if (l_traceit) @@ -148,9 +147,8 @@ inline ReturnCode platPutScom(const Target<K>& i_target, FAPI_ERR("platPutScom: deviceRead returns error!"); FAPI_ERR("platPutScom failed - Target %s, Addr %.16llX", tmpScomStr, i_address); -// Add the error log pointer as data to the ReturnCode -//@TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + // Add the error log pointer as data to the ReturnCode + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); } if (l_traceit) @@ -205,9 +203,8 @@ inline ReturnCode platPutScomUnderMask(const Target<K>& i_target, if (l_err) { FAPI_ERR("platPutScomUnderMask: deviceRead returns error!"); -// Add the error log pointer as data to the ReturnCode -//@TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + // Add the error log pointer as data to the ReturnCode + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -229,9 +226,8 @@ inline ReturnCode platPutScomUnderMask(const Target<K>& i_target, if (l_err) { FAPI_ERR("platPutScomUnderMask: deviceWrite returns error!"); -// Add the error log pointer as data to the ReturnCode -//@TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + // Add the error log pointer as data to the ReturnCode + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -279,12 +275,10 @@ inline ReturnCode platModifyScom(const Target<K>& i_target, FAPI_DBG(ENTER_MRK "platModifyScom"); ReturnCode l_rc; - + errlHndl_t l_err = NULL; FAPI_ERR("platModifyScom: Error: Hostboot not yet support modifyScom function!"); -// Add the error log pointer as data to the ReturnCode -//@TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + // Add the error log pointer as data and set the ReturnCode as needed FAPI_DBG(EXIT_MRK "platModifyScom"); return l_rc; @@ -400,8 +394,7 @@ inline ReturnCode platGetCfamRegister(const Target<K>& i_target, { FAPI_ERR("platGetCfamRegister: verifyCfamAccessTarget returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127 Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -418,8 +411,7 @@ inline ReturnCode platGetCfamRegister(const Target<K>& i_target, FAPI_ERR("fapiGetCfamRegister failed - Target %s, Addr %.8X", tmpScomStr, i_address); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -437,8 +429,7 @@ inline ReturnCode platGetCfamRegister(const Target<K>& i_target, { FAPI_ERR("platGetCfamRegister: deviceRead returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -493,8 +484,7 @@ inline ReturnCode platPutCfamRegister(const Target<K>& i_target, { FAPI_ERR("platPutCfamRegister: verifyCfamAccessTarget returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -509,8 +499,7 @@ inline ReturnCode platPutCfamRegister(const Target<K>& i_target, { FAPI_ERR("platPutCfamRegister: getCfamChipTarget returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -529,8 +518,7 @@ inline ReturnCode platPutCfamRegister(const Target<K>& i_target, { FAPI_ERR("platPutCfamRegister: deviceWrite returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -625,8 +613,7 @@ inline ReturnCode platModifyCfamRegister(const Target<K>& i_target, { FAPI_ERR("platModifyCfamRegister: verifyCfamAccessTarget returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -641,8 +628,7 @@ inline ReturnCode platModifyCfamRegister(const Target<K>& i_target, { FAPI_ERR("platModifyCfamRegister: getCfamChipTarget returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -661,8 +647,7 @@ inline ReturnCode platModifyCfamRegister(const Target<K>& i_target, { FAPI_ERR("platModifyCfamRegister: deviceRead returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -678,8 +663,7 @@ inline ReturnCode platModifyCfamRegister(const Target<K>& i_target, { FAPI_ERR("platModifyCfamRegister: deviceWrite returns error!"); // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); break; } @@ -764,8 +748,7 @@ inline ReturnCode platGetRing(const Target<K>& i_target, if (l_err) { // Add the error log pointer as data to the ReturnCode - //TODO RTC:143127: Need fapi2 support in ReturnCode class - //l_rc.setPlatError(reinterpret_cast<void *> (l_err)); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_err)); } FAPI_DBG(EXIT_MRK "platGetRing"); |

