diff options
-rw-r--r-- | src/build/mkrules/dist.targets.mk | 3 | ||||
-rwxr-xr-x | src/usr/fapi2/fapi2.mk | 12 | ||||
-rwxr-xr-x | src/usr/fapi2/platCreateHwpErrParser.pl | 56 | ||||
-rw-r--r-- | src/usr/fapi2/plat_utils.C | 2 | ||||
-rw-r--r-- | src/usr/isteps/plugins/HWPF_COMP_ID_Parse.C | 2 | ||||
-rw-r--r-- | src/usr/isteps/plugins/fapi2PlatUdParserHwp.H (renamed from src/usr/isteps/plugins/fapiPlatUdParserHwp.H) | 47 | ||||
-rw-r--r-- | src/usr/isteps/plugins/hwpfUdParserFactory.H | 10 |
7 files changed, 87 insertions, 45 deletions
diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk index 2ad7ca224..e01834e22 100644 --- a/src/build/mkrules/dist.targets.mk +++ b/src/build/mkrules/dist.targets.mk @@ -253,7 +253,8 @@ fsp.tar_CONTENTS = \ obj/genfiles/attrInfo.csv \ obj/genfiles/attrEnumInfo.csv \ obj/genfiles/targAttrInfo.csv\ - obj/genfiles/plugins/platHwpErrParser.H:plugins + obj/genfiles/plugins/hbfwPlatHwpErrParser.H:plugins/ \ + obj/genfiles/plugins/hbfwPlatHwpErrParserFFDC.H:plugins # # Portions of the FSP sandbox which must be rebuilt based on file changes. diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk index 89f00e9c7..a94852a06 100755 --- a/src/usr/fapi2/fapi2.mk +++ b/src/usr/fapi2/fapi2.mk @@ -103,11 +103,17 @@ FAPI2_PLAT_INCLUDE += $(addsuffix /common/include, \ #------------------------------------------------------------------------------ # The PLAT HWP RC and FFDC parser file generated from Error XML files #------------------------------------------------------------------------------ -PLAT_HWP_ERR_PARSER = platHwpErrParser.H +PLAT_HWP_ERR_PARSER_TARGET = hbfwPlatHwpErrParser.H +PLAT_HWP_ERR_PARSER_FFDC_TARGET = hbfwPlatHwpErrParserFFDC.H + GENDIR_PLUGINS = $(ROOTPATH)/obj/genfiles/plugins GENPLUGINTARGET = $(addprefix $(GENDIR_PLUGINS)/, $(1)) -GENFILES_PLUGINS = ${PLAT_HWP_ERR_PARSER} -$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER}) : \ +GENFILES_PLUGINS = ${PLAT_HWP_ERR_PARSER_TARGET} +GENFILES_PLUGINS += ${PLAT_HWP_ERR_PARSER_FFDC_TARGET} + + +$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER_TARGET}) \ +$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER_FFDC_TARGET}) : \ $(ROOTPATH)/src/usr/fapi2/platCreateHwpErrParser.pl ${FAPI2_ERROR_XML} $< $(dir $@) ${FAPI2_ERROR_XML} diff --git a/src/usr/fapi2/platCreateHwpErrParser.pl b/src/usr/fapi2/platCreateHwpErrParser.pl index ec002ac59..62ea13a5b 100755 --- a/src/usr/fapi2/platCreateHwpErrParser.pl +++ b/src/usr/fapi2/platCreateHwpErrParser.pl @@ -42,7 +42,7 @@ if ($numArgs < 2) { print ("Usage: platCreateHwpErrParser.pl <output dir> <filename1> <filename2> ...\n"); print (" This perl script will parse HWP Error XML files and create\n"); - print (" a file called fapiPlatHwpErrParser.H that contains functions to\n"); + print (" two files hbfwPlatHwpErrParser.H and hbfwPlatHwpErrParserFFDC.H that\n"); print (" parse the return code and FFDC data in HWP error logs\n"); exit(1); } @@ -62,24 +62,24 @@ my $xml = new XML::Simple (KeyAttr=>[]); #------------------------------------------------------------------------------ my $rcFile = $ARGV[0]; $rcFile .= "/"; -$rcFile .= "platHwpErrParser.H"; +$rcFile .= "hbfwPlatHwpErrParser.H"; open(TGFILE, ">", $rcFile); #------------------------------------------------------------------------------ # Print start of file information #------------------------------------------------------------------------------ -print TGFILE "// platHwpErrParser.H\n"; +print TGFILE "// hbfwPlatHwpErrParser.H\n"; print TGFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n"; -print TGFILE "#ifndef PLATHWPERRPARSER_H_\n"; -print TGFILE "#define PLATHWPERRPARSER_H_\n\n"; +print TGFILE "#ifndef HBFWPLATHWPERRPARSER_H_\n"; +print TGFILE "#define HBFWPLATHWPERRPARSER_H_\n\n"; print TGFILE "#ifdef PARSER\n\n"; print TGFILE "namespace fapi2\n"; print TGFILE "{\n\n"; -print TGFILE "void parseHwpRc(ErrlUsrParser & i_parser,\n"; +print TGFILE "void hbfwParseHwpRc(ErrlUsrParser & i_parser,\n"; print TGFILE " void * i_pBuffer,\n"; print TGFILE " const uint32_t i_buflen)\n"; print TGFILE "{\n"; -print TGFILE " uint32_t l_rc = ntohll(*(static_cast<uint32_t *>(i_pBuffer)));\n"; +print TGFILE " uint32_t l_rc = ntohl(*(static_cast<uint32_t *>(i_pBuffer)));\n"; print TGFILE " switch(l_rc)\n"; print TGFILE " {\n"; @@ -133,15 +133,49 @@ foreach my $argnum (1 .. $#ARGV) #------------------------------------------------------------------------------ print TGFILE " default:\n"; print TGFILE " i_parser.PrintNumber(\"Unrecognized Error ID\", \"0x%x\", l_rc);\n"; +print TGFILE " if (i_buflen) {i_parser.PrintHexDump(i_pBuffer, i_buflen);}\n"; print TGFILE " }\n"; print TGFILE "}\n\n"; #------------------------------------------------------------------------------ -# Print start of fapiParseHwpFfdc function +# Print end of file info +#------------------------------------------------------------------------------ +print TGFILE "}\n\n"; +print TGFILE "#endif\n"; +print TGFILE "#endif\n"; + +#------------------------------------------------------------------------------ +# Close output file +#------------------------------------------------------------------------------ +close(TGFILE); + + +#------------------------------------------------------------------------------ +# Open output files for writing +#------------------------------------------------------------------------------ +my $rcFile = $ARGV[0]; +$rcFile .= "/"; +$rcFile .= "hbfwPlatHwpErrParserFFDC.H"; +open(TGFILE, ">", $rcFile); + +#------------------------------------------------------------------------------ +# Print start of file information +#------------------------------------------------------------------------------ +print TGFILE "// hbfwPlatHwpErrParserFFDC.H\n"; +print TGFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n"; +print TGFILE "#ifndef HBFWPLATHWPERRPARSERFFDC_H_\n"; +print TGFILE "#define HBFWPLATHWPERRPARSERFFDC_H_\n\n"; +print TGFILE "#ifdef PARSER\n\n"; +print TGFILE "#include <netinet/in.h>\n\n"; +print TGFILE "namespace fapi2\n"; +print TGFILE "{\n\n"; + +#------------------------------------------------------------------------------ +# Print start of hbfwParseHwpFfdc function #------------------------------------------------------------------------------ -print TGFILE "void parseHwpFfdc(ErrlUsrParser & i_parser,\n"; -print TGFILE " void * i_pBuffer,\n"; -print TGFILE " const uint32_t i_buflen)\n"; +print TGFILE "void hbfwParseHwpFfdc(ErrlUsrParser & i_parser,\n"; +print TGFILE " void * i_pBuffer,\n"; +print TGFILE " const uint32_t i_buflen)\n"; print TGFILE "{\n"; print TGFILE " const uint32_t CFAM_DATA_LEN = 4;\n"; print TGFILE " const uint32_t SCOM_DATA_LEN = 8;\n"; diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C index c9f0a1d93..596e139df 100644 --- a/src/usr/fapi2/plat_utils.C +++ b/src/usr/fapi2/plat_utils.C @@ -809,7 +809,7 @@ errlHndl_t rcToErrl(ReturnCode & io_rc, if (io_rc) { - uint64_t l_rcValue = io_rc; + uint32_t l_rcValue = io_rc; // ReturnCode contains an error. Find out which component of the HWPF // created the error diff --git a/src/usr/isteps/plugins/HWPF_COMP_ID_Parse.C b/src/usr/isteps/plugins/HWPF_COMP_ID_Parse.C index 311704425..a25ff215c 100644 --- a/src/usr/isteps/plugins/HWPF_COMP_ID_Parse.C +++ b/src/usr/isteps/plugins/HWPF_COMP_ID_Parse.C @@ -30,5 +30,5 @@ #include "errludparser.H" #include "hwpfUdParserFactory.H" -ERRL_MAKE_UD_PARSER(fapi::HwpfUserDetailsParserFactory, hbfw::HWPF_COMP_ID) +ERRL_MAKE_UD_PARSER(fapi2::HwpfUserDetailsParserFactory, hbfw::HWPF_COMP_ID) diff --git a/src/usr/isteps/plugins/fapiPlatUdParserHwp.H b/src/usr/isteps/plugins/fapi2PlatUdParserHwp.H index 12c85e7c6..d1e1c657a 100644 --- a/src/usr/isteps/plugins/fapiPlatUdParserHwp.H +++ b/src/usr/isteps/plugins/fapi2PlatUdParserHwp.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/isteps/plugins/fapiPlatUdParserHwp.H $ */ +/* $Source: src/usr/isteps/plugins/fapi2PlatUdParserHwp.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ @@ -22,42 +22,43 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -#ifndef FAPIPLATUDPARSERHWP_H -#define FAPIPLATUDPARSERHWP_H +#ifndef FAPI2PLATUDPARSERHWP_H +#define FAPI2PLATUDPARSERHWP_H /** - * @file fapiPlatUdParserHwp.H + * @file fapi2PlatUdParserHwp.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 + * fapi2::ReturnCode */ #include "errluserdetails.H" -//TODO-RTC:151336 #include "platHwpErrParser.H" +#include "hbfwPlatHwpErrParser.H" +#include "hbfwPlatHwpErrParserFFDC.H" -namespace fapi +namespace fapi2 { /** - * @class PlatUserDetailsParserHwpRcValue + * @class HbfwPlatUserDetailsParserHwpRcValue * * Parses the HWP RcValue in an error log. */ -class PlatUserDetailsParserHwpRcValue : public ERRORLOG::ErrlUserDetailsParser +class HbfwPlatUserDetailsParserHwpRcValue : public ERRORLOG::ErrlUserDetailsParser { public: /** * @brief Constructor */ - PlatUserDetailsParserHwpRcValue() {} + HbfwPlatUserDetailsParserHwpRcValue() {} /** * @brief Destructor */ - virtual ~PlatUserDetailsParserHwpRcValue() {} + virtual ~HbfwPlatUserDetailsParserHwpRcValue() {} /** * @brief Parses the HWP RcValue in an error log. @@ -73,33 +74,33 @@ public: const uint32_t i_buflen) const { // Call a FAPI generated function to parse the return code - //TODO-RTC:151336 fapi2::parseHwpRc(i_parser, i_pBuffer, i_buflen); + hbfwParseHwpRc(i_parser, i_pBuffer, i_buflen); } private: // Disabled - PlatUserDetailsParserHwpRcValue(const PlatUserDetailsParserHwpRcValue &); - PlatUserDetailsParserHwpRcValue & operator=( - const PlatUserDetailsParserHwpRcValue &); + HbfwPlatUserDetailsParserHwpRcValue(const HbfwPlatUserDetailsParserHwpRcValue &); + HbfwPlatUserDetailsParserHwpRcValue & operator=( + const HbfwPlatUserDetailsParserHwpRcValue &); }; /** - * @class PlatUserDetailsParserHwpTarget + * @class HbfwPlatUserDetailsParserHwpTarget * * Parses HWP FFDC in an error log. */ -class PlatUserDetailsParserHwpFfdc : public ERRORLOG::ErrlUserDetailsParser +class HbfwPlatUserDetailsParserHwpFfdc : public ERRORLOG::ErrlUserDetailsParser { public: /** * @brief Constructor */ - PlatUserDetailsParserHwpFfdc() {} + HbfwPlatUserDetailsParserHwpFfdc() {} /** * @brief Destructor */ - virtual ~PlatUserDetailsParserHwpFfdc() {} + virtual ~HbfwPlatUserDetailsParserHwpFfdc() {} /** * @brief Parses HWP FFDC in an error log. @@ -115,14 +116,14 @@ public: const uint32_t i_buflen) const { // Call a FAPI generated function to parse the FFDC - fapiParseHwpFfdc(i_parser, i_pBuffer, i_buflen); + hbfwParseHwpFfdc(i_parser, i_pBuffer, i_buflen); } private: // Disabled - PlatUserDetailsParserHwpFfdc(const PlatUserDetailsParserHwpFfdc &); - PlatUserDetailsParserHwpFfdc & operator=( - const PlatUserDetailsParserHwpFfdc &); + HbfwPlatUserDetailsParserHwpFfdc(const HbfwPlatUserDetailsParserHwpFfdc &); + HbfwPlatUserDetailsParserHwpFfdc & operator=( + const HbfwPlatUserDetailsParserHwpFfdc &); }; } diff --git a/src/usr/isteps/plugins/hwpfUdParserFactory.H b/src/usr/isteps/plugins/hwpfUdParserFactory.H index f5515e464..ab2b49359 100644 --- a/src/usr/isteps/plugins/hwpfUdParserFactory.H +++ b/src/usr/isteps/plugins/hwpfUdParserFactory.H @@ -26,15 +26,15 @@ #define HWPFUDPARSERFACTORY_H /** - * @file fapiPlatHwpUdDecode.H + * @file hwpfUdParserFactory.H * * Defines the PlatUserDetailsParserFactory class */ #include "errludparserfactory.H" -//TODO-RTC:151336 #include "fapiPlatUdParserHwp.H" +#include "fapi2PlatUdParserHwp.H" #include "hwpistepud.H" -namespace fapi +namespace fapi2 { /** @@ -52,8 +52,8 @@ public: */ HwpfUserDetailsParserFactory() { - //TODO-RTC:151336 registerParser<PlatUserDetailsParserHwpRcValue>(HWPF_UDT_HWP_RCVALUE); - //TODO-RTC:151336 registerParser<PlatUserDetailsParserHwpFfdc>(HWPF_UDT_HWP_FFDC); + registerParser<HbfwPlatUserDetailsParserHwpRcValue>(HWPF_UDT_HWP_RCVALUE); + registerParser<HbfwPlatUserDetailsParserHwpFfdc>(HWPF_UDT_HWP_FFDC); registerParser<ISTEP_ERROR::HwpUserDetailsParserIstep> (HWPF_UDT_STEP_ERROR_DETAILS); } |