diff options
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/errl/errlentry.H | 4 | ||||
-rwxr-xr-x | src/include/usr/errl/errludparser.H | 91 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiErrorInfo.H | 49 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCode.H | 16 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatReasonCodes.H | 26 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H | 71 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H | 172 |
7 files changed, 398 insertions, 31 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index 1b71aa39d..de63212a1 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -302,8 +302,8 @@ public: ErrlUD * addFFDC(const compId_t i_compId, const void * i_dataPtr, const uint32_t i_ffdcLen, - const uint8_t i_ffdcVer = 0, - const uint8_t i_ffdcSubSect = 0); + const uint8_t i_ffdcVer, + const uint8_t i_ffdcSubSect); /** * @brief Append more data to an FFDC section. diff --git a/src/include/usr/errl/errludparser.H b/src/include/usr/errl/errludparser.H new file mode 100755 index 000000000..e80a3d9c8 --- /dev/null +++ b/src/include/usr/errl/errludparser.H @@ -0,0 +1,91 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/errl/errludparser.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef ERRL_UDPARSER_H +#define ERRL_UDPARSER_H + +#ifdef PARSER + +/** + * @file errludparser.H + * + * To create a function that errl calls to parse user detail data, a + * component's plugin/<comp>Parse.C file should include this file and call the + * ERRL_MAKE_UD_PARSER macro + */ + +#include <netinet/in.h> + +/** + * @brief Endian swap a uint64_t. This is not provided by in.h + */ +inline uint64_t ntohll( uint64_t i ) +#if __BYTE_ORDER == __LITTLE_ENDIAN +{ + // CONTEXT_x86_nfp + uint64_t hi; + uint64_t lo; + uint32_t * pword = reinterpret_cast<uint32_t*>(&i); + + hi = ntohl( *pword ); + lo = ntohl( *(pword+1) ); + + return (hi<<32)|lo; +} +#elif __BYTE_ORDER == __BIG_ENDIAN +{ + // CONTEXT_ppc (or maybe CONTEXT_aix_nfp) + return i; +} +#else +#error Unexpected endian context. +#endif + +// FSP includes +#include <errlplugins.H> +#include <errlusrparser.H> + +/** + * @brief Macro that generates a function and plugin object to parse a + * component's error log user detail data + */ +#define ERRL_MAKE_UD_PARSER(FACTORY, COMPID) \ +static bool myDataParse(\ + ErrlUsrParser& i_parser, void* i_buffer, uint32_t i_buflen,\ + errlver_t i_ver, errlsubsec_t i_sst)\ +{\ + bool l_rc = false;\ + FACTORY l_factory;\ + ERRORLOG::ErrlUserDetailsParser * l_pParser =\ + l_factory.createParser(i_sst);\ + if (l_pParser)\ + {\ + l_rc = true;\ + l_pParser->parse(i_ver, i_parser, i_buffer, i_buflen);\ + }\ + return l_rc;\ +}\ +static errl::DataPlugin g_DataPlugin(COMPID, myDataParse); + +#endif +#endif + diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H index 59f9d8b28..73512f5d0 100644 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H @@ -33,6 +33,8 @@ * mjjones 08/09/2011 Created. * mjjones 08/24/2011 Added ErrorInfoGard. * mjjones 09/22/2011 Major updates + * mjjones 03/16/2012 Add FfdcType. Remove copy + * ctor and assignment operator */ #ifndef FAPIERRORINFO_H_ @@ -46,6 +48,19 @@ namespace fapi { /** + * @enum FfdcType + * + * This enumeration defines the possible types of FFDC data + */ +enum FfdcType +{ + FFDC_TYPE_NONE = 0, + FFDC_TYPE_TARGET = 1, // FFDC data is a Target ecmd-string + FFDC_TYPE_ECMDDBB = 2, // FFDC data is the contents of an ecmdDataBaseBuffer + FFDC_TYPE_DATA = 3, // FFDC data is just raw data +}; + +/** * @class ErrorInfoFfdc * * This class contains a copy of some FFDC data @@ -58,16 +73,11 @@ public: * * @param[in] i_pFfdc Pointer to the FFDC to copy * @param[in] i_size Size of the FFDC to copy + * @param[in] i_type Type of the FFDC to copy */ ErrorInfoFfdc(const void * i_pFfdc, - const uint32_t i_size); - - /** - * @brief Copy Constructor - * - * @param[in] i_right Reference to ErrorInfoFfdc to copy from - */ - ErrorInfoFfdc(const ErrorInfoFfdc & i_right); + const uint32_t i_size, + const FfdcType i_type); /** * @brief Destructor @@ -75,15 +85,6 @@ public: ~ErrorInfoFfdc(); /** - * @brief Assignment Operator - * - * @param[in] i_right Reference to ErrorInfoFfdc to assign from - * - * @return ErrorInfoFfdc &. Reference to this ErrorInfoFfdc - */ - ErrorInfoFfdc & operator=(const ErrorInfoFfdc & i_right); - - /** * @brief Get a pointer to the FfdcData * * @param[out] o_size Reference to uint32_t that is filled in with the FFDC @@ -93,6 +94,13 @@ public: */ const void * getData(uint32_t & o_size) const; + /** + * @brief Get the FfdcData type + * + * @return FfdcType. FFDC type + */ + FfdcType getType() const; + private: // Pointer to the FFDC @@ -100,6 +108,13 @@ private: // Size of the FFDC uint32_t iv_size; + + // Type of the FFDC + FfdcType iv_type; + + // Disabled + ErrorInfoFfdc(const ErrorInfoFfdc &); + ErrorInfoFfdc & operator=(const ErrorInfoFfdc &); }; /** diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H index 504e82c9a..34271c1a9 100644 --- a/src/include/usr/hwpf/fapi/fapiReturnCode.H +++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H @@ -40,6 +40,7 @@ * mjjones 11/10/2011 Use ecmdDataBufferBase * mjjones 01/12/2012 Enforce correct usage * mjjones 02/22/2012 Allow user to add Target FFDC + * mjjones 03/16/2012 Add type to FFDC data */ #ifndef FAPIRETURNCODE_H_ @@ -296,15 +297,14 @@ public: * This is called by: * - addErrorInfo * - ReturnCodeFfdc::addEIFfdc (function template) - * - FFDC HWPs (HWPs written to collect FFDC) - * - * Use ReturnCodeFfdc::addEIFfdc to add FFDC data using the data identifier * * @param[in] i_pFfdc Pointer to the FFDC to copy * @param[in] i_size Size of the FFDC to copy + * @param[in] i_type Type of the FFDC to copy */ void addEIFfdc(const void * i_pFfdc, - const uint32_t i_size); + const uint32_t i_size, + const FfdcType i_type); /** * @brief Get a pointer to any ErrorInfo @@ -464,7 +464,7 @@ namespace ReturnCodeFfdc void addEIFfdc(ReturnCode & o_rc, const T & i_ffdc) { - o_rc.addEIFfdc(&i_ffdc, sizeof(T)); + o_rc.addEIFfdc(&i_ffdc, sizeof(T), FFDC_TYPE_DATA); } /** @@ -485,7 +485,8 @@ namespace ReturnCodeFfdc // Deliberately not checking return code from extract to save code space i_ffdc.extract(l_pData, 0, i_ffdc.getBitLength()); - o_rc.addEIFfdc(l_pData, (i_ffdc.getWordLength() * 4)); + o_rc.addEIFfdc(l_pData, (i_ffdc.getWordLength() * 4), + FFDC_TYPE_ECMDDBB); delete [] l_pData; } @@ -500,7 +501,8 @@ namespace ReturnCodeFfdc const fapi::Target & i_ffdc) { const char * l_ecmdString = i_ffdc.toEcmdString(); - o_rc.addEIFfdc(l_ecmdString, (strlen(l_ecmdString) + 1)); + o_rc.addEIFfdc(l_ecmdString, (strlen(l_ecmdString) + 1), + FFDC_TYPE_TARGET); } /** diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H index 9afc348fc..5d37d1ad5 100644 --- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H +++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H @@ -27,6 +27,9 @@ namespace fapi { + /** + * @brief Defines the HWPF::PLAT error log module IDs + */ enum hwpfModuleId { // HWP generated errors @@ -47,11 +50,14 @@ namespace fapi }; - // Note that for HWP generated errors (MOD_HWP_RC_TO_ERRL), the - // reason code is in the generated fapiHwpReasonCodes.H file - + /** + * @brief Defines the HWPF::PLAT error log reason codes + */ 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) RC_INVALID_ATTR_GET = HWPF_COMP_ID | 0x01, @@ -65,9 +71,20 @@ namespace fapi RC_ATTR_BASE_BAD_PARAM = HWPF_COMP_ID | 0x16, RC_INVALID_NUM_PARENT_CHIP = HWPF_COMP_ID | 0x17, }; + + /** + * @brief Defines the HWPF::PLAT (Hostboot) error log user detail data + * sections + */ + enum hwpfUserDetailDataSubSection + { + HWPF_UDT_HWP_TARGET = 1, + HWPF_UDT_HWP_ECMDDBB = 2, + HWPF_UDT_HWP_DATA = 3, + }; }; -// HostBoot ErrorLog tags for FAPI errors +// HostBoot ErrorLog tags for FAPI errors (see fapiReturnCodes.H) /*@ * @errortype * @moduleid MOD_FAPI_RC_TO_ERRL @@ -75,5 +92,4 @@ namespace fapi * @devdesc InitFile HW Procedure requested an invalid attribute */ - #endif diff --git a/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H b/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H new file mode 100644 index 000000000..e9db032a4 --- /dev/null +++ b/src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H @@ -0,0 +1,71 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/plat/fapiPlatUdParserFactory.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef FAPIPLATUDPARSERFACTORY_H +#define FAPIPLATUDPARSERFACTORY_H + +#ifdef PARSER + +/** + * @file fapiPlatHwpUdDecode.H + * + * Defines the PlatUserDetailsParserFactory class + */ +#include <hwpf/plat/fapiPlatUdParserHwp.H> +#include <hwpf/plat/fapiPlatReasonCodes.H> +#include <errl/errludparserfactory.H> + +namespace fapi +{ + +/** + * @class PlatUserDetailsParserFactory + * + * This factory produces ErrlUserDetailsParser objects to parse the specified + * PLAT user detail data. +*/ +class PlatUserDetailsParserFactory : public ERRORLOG::ErrlUserDetailsParserFactory +{ +public: + + /** + * @brief Constructor + */ + PlatUserDetailsParserFactory() + { + registerParser<PlatUserDetailsParserHwpTarget>(HWPF_UDT_HWP_TARGET); + registerParser<PlatUserDetailsParserHwpEcmddbb>(HWPF_UDT_HWP_ECMDDBB); + registerParser<PlatUserDetailsParserHwpData>(HWPF_UDT_HWP_DATA); + } + +private: + // Disabled + PlatUserDetailsParserFactory(const PlatUserDetailsParserFactory &); + PlatUserDetailsParserFactory & operator=( + const PlatUserDetailsParserFactory &); +}; + +} + +#endif +#endif + diff --git a/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H b/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H new file mode 100644 index 000000000..a5b3e8190 --- /dev/null +++ b/src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H @@ -0,0 +1,172 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/plat/fapiPlatUdParserHwp.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef FAPIPLATUDPARSERHWP_H +#define FAPIPLATUDPARSERHWP_H + +#ifdef PARSER + +/** + * @file fapiPlatUdParserHwp.H + * + * Defines ErrlUserDetailsParser subclasses to parse the different types of HWP + * FFDC added as user detail data to an error log. + * + * Note that there are no corresponding ErrlUserDetails subclasses to create + * the user detail data because it is created by the platform neutral + * fapi::ReturnCode + */ +#include <errl/errluserdetails.H> + +namespace fapi +{ + +/** + * @class PlatUserDetailsParserHwpTarget + * + * Parses HWP target string user detail in an error log. + */ +class PlatUserDetailsParserHwpTarget : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpTarget() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpTarget() {} + + /** + * @brief Parses HWP target string user detail 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 + { + i_parser.PrintString("Target ecmd string", static_cast<char *>(i_pBuffer)); + } + +private: + // Disabled + PlatUserDetailsParserHwpTarget(const PlatUserDetailsParserHwpTarget &); + PlatUserDetailsParserHwpTarget & operator=( + const PlatUserDetailsParserHwpTarget &); +}; + +/** + * @class PlatUserDetailsParserHwpEcmddbb + * + * Parses HWP ecmdDataBufferBase user detail in an error log. +*/ +class PlatUserDetailsParserHwpEcmddbb : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpEcmddbb() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpEcmddbb() {} + + /** + * @brief Parses HWP ecmdDataBufferBase user detail 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 + { + i_parser.PrintString("ecmd data buffer data", NULL); + i_parser.PrintHexDump(i_pBuffer, i_buflen); + } + +private: + // Disabled + PlatUserDetailsParserHwpEcmddbb(const PlatUserDetailsParserHwpEcmddbb &); + PlatUserDetailsParserHwpEcmddbb & operator=( + const PlatUserDetailsParserHwpEcmddbb &); +}; + +/** + * @class PlatUserDetailsParserHwpData + * + * Parses HWP raw data user detail in an error log. +*/ +class PlatUserDetailsParserHwpData : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpData() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpData() {} + + /** + * @brief Parses HWP raw data user detail 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 + { + i_parser.PrintString("HWP FFDC data", NULL); + i_parser.PrintHexDump(i_pBuffer, i_buflen); + } + +private: + // Disabled + PlatUserDetailsParserHwpData(const PlatUserDetailsParserHwpData &); + PlatUserDetailsParserHwpData & operator=( + const PlatUserDetailsParserHwpData &); +}; + +} + +#endif +#endif + |