diff options
author | Mike Jones <mjjones@us.ibm.com> | 2012-03-23 16:04:35 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-03-27 12:21:51 -0500 |
commit | f037d0552a46caae37b0e7371fc6ce4837ecce1c (patch) | |
tree | a83b8582455f5777222ce6390effb8a64862f408 /src/include | |
parent | 6a4e3754a25659758af50f8036f2642077166f15 (diff) | |
download | talos-hostboot-f037d0552a46caae37b0e7371fc6ce4837ecce1c.tar.gz talos-hostboot-f037d0552a46caae37b0e7371fc6ce4837ecce1c.zip |
HWPF: Hostboot errlogs should cope with HWP error IDs greater than 255
RTC: 39175
This is **part** of the work required for RTC 39175.
When a HWP creates an error, the reason code is
(HWPF_COMP_ID | errID). The errID is a single byte. Error log
tags are automatically created so that the errors can be
parsed. However at some point there will be more than 255
HWP errors so this scheme will not work. And more pressing is
RTC 39175, the error IDs will change from 0, 1, 2, 3, to
32-bit hash codes. The new plan is to have a fixed reason
code for HWP errors (HWPF_COMP_ID | RC_HWP_GENERATED_ERROR),
the 32 bit error ID will be FFDC data which will be parsed
by an auto-generated function. This also changes the expected
HWPF unit test error to be committed by CXXTEST which is the
subject of a request by Dan.
Change-Id: I5669f2a53702649d4599556a9e380ec3725ca51b
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/792
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatReasonCodes.H | 23 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H | 1 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H | 53 |
3 files changed, 66 insertions, 11 deletions
diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H index 5d37d1ad5..b48d43623 100644 --- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H +++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H @@ -32,11 +32,11 @@ namespace fapi */ enum hwpfModuleId { - // HWP generated errors - MOD_HWP_RC_TO_ERRL = 0x01, - // FAPI generated errors - MOD_FAPI_RC_TO_ERRL = 0x02, + MOD_FAPI_RC_TO_ERRL = 0x01, + + // HWP generated errors + MOD_HWP_RC_TO_ERRL = 0x02, // PLAT generated errors MOD_FAPI_GET_CHILD_CHIPLETS = 0x03, @@ -55,12 +55,12 @@ namespace fapi */ enum hwpfReasonCode { - // Note that for HWP generated errors (MOD_HWP_RC_TO_ERRL), the - // reason code is in the generated fapiHwpReasonCodes.H file - - // FAPI generated errors (see fapiReturnCodes.H) + // FAPI generated errors (must match fapiReturnCodes.H) RC_INVALID_ATTR_GET = HWPF_COMP_ID | 0x01, + // HWP generated errors + RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f, + // PLAT Errors generated by HostBoot code RC_INVALID_REQUEST = HWPF_COMP_ID | 0x10, RC_UNSUPPORTED_REQUEST = HWPF_COMP_ID | 0x11, @@ -78,9 +78,10 @@ namespace fapi */ enum hwpfUserDetailDataSubSection { - HWPF_UDT_HWP_TARGET = 1, - HWPF_UDT_HWP_ECMDDBB = 2, - HWPF_UDT_HWP_DATA = 3, + HWPF_UDT_HWP_RCVALUE = 1, + HWPF_UDT_HWP_TARGET = 2, + HWPF_UDT_HWP_ECMDDBB = 3, + HWPF_UDT_HWP_DATA = 4, }; }; diff --git a/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H b/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H index e9db032a4..a8aab1817 100644 --- a/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H +++ b/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H @@ -52,6 +52,7 @@ public: */ PlatUserDetailsParserFactory() { + registerParser<PlatUserDetailsParserHwpRcValue>(HWPF_UDT_HWP_RCVALUE); registerParser<PlatUserDetailsParserHwpTarget>(HWPF_UDT_HWP_TARGET); registerParser<PlatUserDetailsParserHwpEcmddbb>(HWPF_UDT_HWP_ECMDDBB); registerParser<PlatUserDetailsParserHwpData>(HWPF_UDT_HWP_DATA); diff --git a/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H b/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H index a5b3e8190..f3cf8931e 100644 --- a/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H +++ b/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H @@ -36,11 +36,64 @@ * fapi::ReturnCode */ #include <errl/errluserdetails.H> +#include <fapiPlatHwpRcDecode.H> namespace fapi { /** + * @class PlatUserDetailsParserHwpRcValue + * + * Parses the HWP RcValue in an error log. + */ +class PlatUserDetailsParserHwpRcValue : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpRcValue() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpRcValue() {} + + /** + * @brief Parses the HWP RcValue in an error log. + * + * @param i_version Version of the data + * @param i_parse ErrlUsrParser object for outputting information + * @param i_pBuffer Pointer to buffer containing detail data + * @param i_buflen Length of the buffer + */ + virtual void parse(errlver_t i_version, + ErrlUsrParser & i_parser, + void * i_pBuffer, + const uint32_t i_buflen) const + { + uint32_t l_rcValue = ntohl(*(static_cast<uint32_t *>(i_pBuffer))); + + const char * l_pDesc = fapiDecodeHwpRc(l_rcValue); + + if (l_pDesc) + { + i_parser.PrintString("HWP Error description", l_pDesc); + } + else + { + i_parser.PrintNumber("Unrecognized Error ID", "0x%x", l_rcValue); + } + } + +private: + // Disabled + PlatUserDetailsParserHwpRcValue(const PlatUserDetailsParserHwpRcValue &); + PlatUserDetailsParserHwpRcValue & operator=( + const PlatUserDetailsParserHwpRcValue &); +}; + +/** * @class PlatUserDetailsParserHwpTarget * * Parses HWP target string user detail in an error log. |