diff options
| author | Richard J. Knight <rjknight@us.ibm.com> | 2015-12-07 16:02:33 -0600 |
|---|---|---|
| committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-02-19 15:32:01 -0600 |
| commit | 0542be2bd93801e3a9e6f4e7c56eecb32f007a05 (patch) | |
| tree | 1e63aa83fcd4b4385e5991f60f33d6bc857ee0a4 /src/import/hwpf | |
| parent | 505893d625748df21c2841b4ad588016ca510b79 (diff) | |
| download | blackbird-hostboot-0542be2bd93801e3a9e6f4e7c56eecb32f007a05.tar.gz blackbird-hostboot-0542be2bd93801e3a9e6f4e7c56eecb32f007a05.zip | |
Need an option to allow HWP to return an error log to platform code.
-Update ReturnCode object to include plat err pointer.
-Modify FFDC code to capture error log pointer
-Add FAPI_ASSERT_NO_EXIT macro
Change-Id: I9d69535416be9d09434766cc15f7db447a72aa60
RTC:13220
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22572
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23334
Diffstat (limited to 'src/import/hwpf')
| -rw-r--r-- | src/import/hwpf/fapi2/include/fapi2_error_scope.H | 15 | ||||
| -rw-r--r-- | src/import/hwpf/fapi2/include/ffdc.H | 45 | ||||
| -rw-r--r-- | src/import/hwpf/fapi2/include/utils.H | 21 | ||||
| -rwxr-xr-x | src/import/hwpf/fapi2/tools/parseErrorInfo.pl | 34 |
4 files changed, 91 insertions, 24 deletions
diff --git a/src/import/hwpf/fapi2/include/fapi2_error_scope.H b/src/import/hwpf/fapi2/include/fapi2_error_scope.H index c78bb0518..af1c4a84c 100644 --- a/src/import/hwpf/fapi2/include/fapi2_error_scope.H +++ b/src/import/hwpf/fapi2/include/fapi2_error_scope.H @@ -7,7 +7,7 @@ /* */ /* EKB Project */ /* */ -/* COPYRIGHT 2012,2015 */ +/* COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -67,6 +67,17 @@ /// @param[in] \__ffdc__ the FFDC gathering function /// @param[in] ... varargs, as input to FAPI_ERR /// -#define FAPI_ASSERT( __conditional__, __ffdc__, ... ) PLAT_FAPI_ASSERT( __conditional__, __ffdc__, __VA_ARGS__ ) +#define FAPI_ASSERT( __conditional__, __ffdc__, ... ) \ + PLAT_FAPI_ASSERT( __conditional__, __ffdc__, __VA_ARGS__ ) + +/// +/// @brief Create an eror log, commit it, but do not exit the hwp because of +/// the error condition. +/// @param[in] \__conditional__ the condition to assert +/// @param[in] \__ffdc__ the FFDC gathering function +/// @param[in] ... varargs, as input to FAPI_ERR +/// +#define FAPI_ASSERT_NOEXIT( __conditional__, __ffdc__, ... ) \ + PLAT_FAPI_ASSERT_NOEXIT( __conditional__, __ffdc__, __VA_ARGS__ ) #endif diff --git a/src/import/hwpf/fapi2/include/ffdc.H b/src/import/hwpf/fapi2/include/ffdc.H index 2134e018f..167e6f876 100644 --- a/src/import/hwpf/fapi2/include/ffdc.H +++ b/src/import/hwpf/fapi2/include/ffdc.H @@ -7,7 +7,7 @@ /* */ /* EKB Project */ /* */ -/* COPYRIGHT 2011,2015 */ +/* COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -63,12 +63,13 @@ class FirstFailureData /// /// @brief Default constructor. - /// @note We don't create our error info be default. It will be created + /// @note We don't create our error info by default. It will be created /// when its needed in the setHwpError() method. Note that dereferencing - /// the error info without will create a problem. + /// the error info without first calling setHwpError() will create a + // problem. /// FirstFailureData(void): - iv_info( nullptr ) + iv_info( nullptr ), iv_platDataPtr(nullptr) {} /// @@ -115,26 +116,18 @@ class FirstFailureData } /// - /// @brief Get a pointer to any PlatData. FirstFailureData is still - /// responsible for deletion of the data. The caller must not - /// delete - /// - /// This is called by PLAT. The expected use-case is to get a pointer to - /// a platform error log. The data pointer should be used immediately in - /// the same thread. - /// - /// @return void *. Pointer to any PlatData. If NULL then no data + /// @return void *. Pointer to error info data. If NULL then no data /// void* getData(void) const; /// - /// @brief Get a pointer to any PlatData and release ownership from + /// @brief Get a pointer to any error info and release ownership from /// FirstFailureData. The caller is responsible for deletion. /// /// This is called by PLAT. The expected use-case is to retrieve a /// platform error log. /// - /// @return void*. Pointer to any PlatData. If NULL then no data + /// @return void*. Pointer to any Error data. If NULL then no data /// inline void* releaseData(void) { @@ -185,10 +178,30 @@ class FirstFailureData iv_info = nullptr; } + /// + /// @brief Returns the platform data pointer value to the caller. + /// + inline void* getPlatDataPtr() + { + return iv_platDataPtr; + }; + + /// + /// @brief Sets objects platform data pointer to the passed in value. + /// + /// + inline void setPlatDataPtr( void* i_ptr ) + { + iv_platDataPtr = i_ptr; + }; + private: - // Pointer to the data + // Pointer to the error info std::shared_ptr<ErrorInfo> iv_info; + + // free format data, to be used by the platform + void* iv_platDataPtr; }; } diff --git a/src/import/hwpf/fapi2/include/utils.H b/src/import/hwpf/fapi2/include/utils.H index ee15b50db..95a4e5f1f 100644 --- a/src/import/hwpf/fapi2/include/utils.H +++ b/src/import/hwpf/fapi2/include/utils.H @@ -7,7 +7,7 @@ /* */ /* EKB Project */ /* */ -/* COPYRIGHT 2011,2015 */ +/* COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,6 +50,25 @@ void logError( bool i_unitTestError = false ); /// +/// @brief Create a platform error log +/// +/// This function will create a platform error log from the passed in +/// return code value and will populate the iv_platDataPtr of the return code +/// with a pointer to the newly created log. +/// +/// @param[in,out] io_rc - Reference to ReturnCode +/// +/// @param[in] i_sev Fapi error log severity defaulted to unrecoverable +// +// +/// @note Implemented by platform code +/// +void createPlatLog( + fapi2::ReturnCode& io_rc, + fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE +); + +/// /// @brief Delay this thread. Hostboot will use the nanoseconds parameter /// and make a syscall to nanosleep. While in the syscall, the hostboot /// kernel will continue to consume CPU cycles as it looks for a runnable diff --git a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl index e192f1802..106bd1b3a 100755 --- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl +++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl @@ -8,7 +8,7 @@ # # EKB Project # -# COPYRIGHT 2015 +# COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # @@ -1183,16 +1183,40 @@ foreach my $argnum (0 .. $#ARGV) print ECFILE $methods{$key}{method}; } + # add a method to adjust the severity if desired + print ECFILE " inline void setSev(const fapi2::errlSeverity_t i_sev)\n" . + " { iv_sev = i_sev; };\n\n"; + + # add a method to read the severity if desired + print ECFILE " inline fapi2::errlSeverity_t getSev() const\n" . + " { return iv_sev; };\n\n"; + + + # # Stick the execute method at the end of the other methods. We allow # passing in of the severity so that macros which call execute() can over-ride # the default severity. - print ECFILE " void execute(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNDEFINED)\n"; + print ECFILE " void execute(fapi2::errlSeverity_t" . + " i_sev = fapi2::FAPI2_ERRL_SEV_UNDEFINED," . + "bool commit = true )\n"; if ($arg_empty_ffdc eq undef) { print ECFILE " {\n"; - print ECFILE " FAPI_SET_HWP_ERROR(iv_rc, $err->{rc});\n"; - print ECFILE " fapi2::logError(iv_rc, (i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED) ? iv_sev : i_sev);\n"; - print ECFILE " }\n\n"; + print ECFILE " FAPI_SET_HWP_ERROR(iv_rc, $err->{rc});\n"; + print ECFILE " if( commit )\n"; + print ECFILE " {\n"; + print ECFILE " fapi2::logError(iv_rc, " . + "(i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED)" . + " ? iv_sev : i_sev);\n"; + print ECFILE " }\n"; + print ECFILE " else\n"; + print ECFILE " {\n"; + print ECFILE " fapi2::createPlatLog(iv_rc, " . + "(i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED)". + " ? iv_sev : i_sev);\n"; + print ECFILE " }\n\n"; + print ECFILE " }\n"; + } else { |

