diff options
author | Mike Jones <mjjones@us.ibm.com> | 2012-03-16 11:30:45 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-03-21 16:41:45 -0500 |
commit | 13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade (patch) | |
tree | 121076fad6e415df8cccd7cecac7f729cdc437e0 /src/include/usr/errl | |
parent | 0c281617a249edc58f4b615355ab0221084b1330 (diff) | |
download | talos-hostboot-13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade.tar.gz talos-hostboot-13cba5a729ae4e0f7e6f0f23b6b302e63e1f2ade.zip |
HWPF: Decode HWP FFDC in error logs
RTC: 37921
Change-Id: I6c8bbe5e92eb6e22eb18cba3529128ae70a9786f
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/768
Tested-by: Jenkins Server
Reviewed-by: Mark W. Wenning <wenning@us.ibm.com>
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/errl')
-rw-r--r-- | src/include/usr/errl/errlentry.H | 4 | ||||
-rwxr-xr-x | src/include/usr/errl/errludparser.H | 91 |
2 files changed, 93 insertions, 2 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 + |