summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/platCreateHwpErrParser.pl
diff options
context:
space:
mode:
authorMatt Derksen <v2cibmd@us.ibm.com>2016-07-21 15:04:02 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-08-02 17:40:56 -0400
commit40247b31479f4c3d784e1a15a2b1b2b2375fb1df (patch)
tree8059ff885462bdb2dbbeea767906ee62286057c1 /src/usr/fapi2/platCreateHwpErrParser.pl
parent5320654ff092cedeac94b65cfd70b88de72807ec (diff)
downloadtalos-hostboot-40247b31479f4c3d784e1a15a2b1b2b2375fb1df.tar.gz
talos-hostboot-40247b31479f4c3d784e1a15a2b1b2b2375fb1df.zip
Parse HWP errors
Change-Id: I2c12557c60cb903d8ab0e79d31074c2d249fd846 RTC:151336 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27340 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/platCreateHwpErrParser.pl')
-rwxr-xr-xsrc/usr/fapi2/platCreateHwpErrParser.pl56
1 files changed, 45 insertions, 11 deletions
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";
OpenPOWER on IntegriCloud