summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-09-24 20:38:58 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-04 16:51:04 -0500
commit9c88d3c004d60d016c4d3bf5a3c2988cce7121c9 (patch)
tree28eb4e6671d865a4c6897ab34ad1fee231a98202 /src/usr
parentd05fe5a6cb9d9dfa92954db9923603fdb6c8adca (diff)
downloadtalos-hostboot-9c88d3c004d60d016c4d3bf5a3c2988cce7121c9.tar.gz
talos-hostboot-9c88d3c004d60d016c4d3bf5a3c2988cce7121c9.zip
HWPF: Allow automatic collection of register FFDC data when HWP error created
If HWP Error XML contains an element called <collectRegisterFfdc> which identifies the registers to collect as FFDC then when the error is created, those registers are automatically collected and stored in the error log. Also create Hostboot parsers to parse the data. Change-Id: I521527b97e0db0c808db81773ba0fe9aa00477ad RTC: 46029 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1866 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiCreateIfAttrService.pl31
-rw-r--r--src/usr/hwpf/fapi/fapiErrorInfo.C62
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseAttributeInfo.pl31
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseErrorInfo.pl439
-rw-r--r--src/usr/hwpf/fapi/fapiReturnCode.C63
-rw-r--r--src/usr/hwpf/fapi/makefile31
-rw-r--r--src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_sbe_ffdc.C9
-rw-r--r--src/usr/hwpf/hwp/fapiHwpErrorInfo.xml101
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C75
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpError.C20
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpFfdc.C4
-rw-r--r--src/usr/hwpf/hwp/makefile1
-rw-r--r--src/usr/hwpf/makefile12
-rwxr-xr-xsrc/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl256
-rwxr-xr-xsrc/usr/hwpf/plat/fapiPlatCreateHwpRcDecoder.pl153
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C74
-rw-r--r--src/usr/mbox/plugins/mboxParse.C2
17 files changed, 827 insertions, 537 deletions
diff --git a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
index 912ba98a0..89c110c9d 100755
--- a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
+++ b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
@@ -1,26 +1,26 @@
#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/hwpf/fapi/fapiCreateIfAttrService.pl $
+# $Source: src/usr/hwpf/fapi/fapiCreateIfAttrService.pl $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011-2012
+# COPYRIGHT International Business Machines Corp. 2011,2012
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
#
# Purpose: This perl script will parse HWP Attribute XML files and
# initfile attr files and create the fapiGetInitFileAttr() function
@@ -38,6 +38,7 @@
# mjjones 01/13/12 Use new ReturnCode interfaces
# mjjones 02/08/12 Handle attribute files with 1 entry
# mjjones 06/12/12 Handle privileged attributes
+# mjjones 09/28/12 Minor change to add FFDC on error
#
# End Change Log ******************************************************
@@ -282,7 +283,7 @@ if ($attCount > 0)
print ASFILE " {\n";
print ASFILE " FAPI_ERR(\"fapiGetInitFileAttr: Unrecognized attr: %d\", i_id);\n";
print ASFILE " l_rc.setFapiError(FAPI_RC_INVALID_ATTR_GET);\n";
-print ASFILE " ReturnCodeFfdc::addEIFfdc(l_rc, static_cast<uint32_t>(i_id));\n";
+print ASFILE " l_rc.addEIFfdc(0, &i_id, sizeof(i_id));\n";
print ASFILE " }\n\n";
print ASFILE " if (l_rc)\n";
print ASFILE " {\n";
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C
index f1d5d81a0..5d4e9e716 100644
--- a/src/usr/hwpf/fapi/fapiErrorInfo.C
+++ b/src/usr/hwpf/fapi/fapiErrorInfo.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/hwpf/fapi/fapiErrorInfo.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2011-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_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/fapi/fapiErrorInfo.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file fapiErrorInfo.C
*
@@ -38,6 +37,7 @@
* ctor and assignment operator
* mjjones 08/14/2012 Merge Callout/Deconfig/Gard
* structures into one
+ * mjjones 09/19/2012 Replace FFDC type with ID
*/
#include <fapiErrorInfo.H>
@@ -49,10 +49,10 @@ namespace fapi
//******************************************************************************
// ErrorInfoFfdc Constructor
//******************************************************************************
-ErrorInfoFfdc::ErrorInfoFfdc(const void * i_pFfdc,
- const uint32_t i_size,
- const FfdcType i_type)
-: iv_size(i_size), iv_type(i_type)
+ErrorInfoFfdc::ErrorInfoFfdc(const uint32_t i_ffdcId,
+ const void * i_pFfdc,
+ const uint32_t i_size)
+: iv_ffdcId(i_ffdcId), iv_size(i_size)
{
iv_pFfdc = new uint8_t[i_size];
memcpy(iv_pFfdc, i_pFfdc, i_size);
@@ -77,14 +77,6 @@ const void * ErrorInfoFfdc::getData(uint32_t & o_size) const
}
//******************************************************************************
-// ErrorInfoFfdc getType function
-//******************************************************************************
-FfdcType ErrorInfoFfdc::getType() const
-{
- return iv_type;
-}
-
-//******************************************************************************
// ErrorInfoCDG Constructor
//******************************************************************************
ErrorInfoCDG::ErrorInfoCDG(const Target & i_target)
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
index 4e092f90f..3a0ab3bea 100755
--- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
@@ -1,26 +1,26 @@
#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/hwpf/fapi/fapiParseAttributeInfo.pl $
+# $Source: src/usr/hwpf/fapi/fapiParseAttributeInfo.pl $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011-2012
+# COPYRIGHT International Business Machines Corp. 2011,2012
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
#
# Purpose: This perl script will parse HWP Attribute XML files
# and add attribute information to a file called fapiAttributeIds.H
@@ -61,6 +61,7 @@
# parsing enumerations
# mjjones 06/12/12 Add new include file to fapiChipEcFeature.C
# mjjones 08/08/12 Output target types and if PlatInit
+# mjjones 09/28/12 Minor change to add FFDC on error
#
# End Change Log ******************************************************
@@ -593,7 +594,7 @@ print ECFILE " default:\n";
print ECFILE " FAPI_ERR(\"fapiQueryChipEcFeature: Unknown feature 0x%x\",\n";
print ECFILE " i_id);\n";
print ECFILE " l_rc.setFapiError(FAPI_RC_INVALID_CHIP_EC_FEATURE_GET);\n";
-print ECFILE " fapi::ReturnCodeFfdc::addEIFfdc(l_rc, i_id);\n";
+print ECFILE " l_rc.addEIFfdc(0, &i_id, sizeof(i_id));\n";
print ECFILE " break;\n";
print ECFILE " }\n\n";
print ECFILE " if (o_hasFeature)\n";
diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
index db8fa48e5..68055799d 100755
--- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
@@ -1,26 +1,26 @@
#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/hwpf/fapi/fapiParseErrorInfo.pl $
+# $Source: src/usr/hwpf/fapi/fapiParseErrorInfo.pl $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011-2012
+# COPYRIGHT International Business Machines Corp. 2011,2012
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
#
# Purpose: This perl script will parse HWP Error XML files and create required
# FAPI code. The FAPI files created are:
@@ -48,6 +48,8 @@
# mjjones 05/15/12 Detect duplicate error rcs
# mjjones 05/21/12 Detect duplicate ids/hashes across files
# mjjones 06/27/12 Add assembler output for SBE usage
+# mjjones 09/19/12 Generate FFDC ID enumeration
+# Generate fapiCollectRegFfdc.C file
#
# End Change Log ******************************************************
@@ -65,6 +67,44 @@ use strict;
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
#------------------------------------------------------------------------------
+# Specify perl modules to use
+#------------------------------------------------------------------------------
+use Digest::MD5 qw(md5_hex);
+use XML::Simple;
+my $xml = new XML::Simple (KeyAttr=>[]);
+
+# Uncomment to enable debug output
+#use Data::Dumper;
+
+#------------------------------------------------------------------------------
+# Print Command Line Help
+#------------------------------------------------------------------------------
+my $numArgs = $#ARGV + 1;
+if ($numArgs < 2)
+{
+ print ("Usage: fapiParseErrorInfo.pl <output dir> <filename1> <filename2> ...\n");
+ print (" This perl script will parse HWP Error XML files and create\n");
+ print (" the following files:\n");
+ print (" - fapiHwpReturnCodes.H. HwpReturnCode enumeration (HWP generated errors)\n");
+ print (" - fapiHwpErrorInfo.H. Error information (used by FAPI_SET_HWP_ERROR\n");
+ print (" when a HWP generates an error)\n");
+ print (" - fapiCollectRegFfdc.C. Function to collect register FFDC\n");
+ exit(1);
+}
+
+#------------------------------------------------------------------------------
+# Hashes containing error names/enum-values
+#------------------------------------------------------------------------------
+my %errNameToValueHash;
+my %errValuePresentHash;
+
+#------------------------------------------------------------------------------
+# Hashes containing ffdc names/enum-values
+#------------------------------------------------------------------------------
+my %ffdcNameToValueHash;
+my %ffdcValuePresentHash;
+
+#------------------------------------------------------------------------------
# Subroutine that checks if an entry exists in an array. If it doesn't exist
# then it is added. The index of the entry within the array is returned
#------------------------------------------------------------------------------
@@ -97,29 +137,93 @@ sub addEntryToArray
}
#------------------------------------------------------------------------------
-# Print Command Line Help
+# Subroutine that figures out an error enum value from an error name and stores
+# it in global hashes
#------------------------------------------------------------------------------
-my $numArgs = $#ARGV + 1;
-if ($numArgs < 2)
+sub setErrorEnumValue
{
- print ("Usage: fapiParseErrorInfo.pl <output dir> <filename1> <filename2> ...\n");
- print (" This perl script will parse HWP Error XML files and create\n");
- print (" the following files:\n");
- print (" - fapiHwpReturnCodes.H. HwpReturnCode enumeration (HWP generated errors)\n");
- print (" - fapiHwpErrorInfo.H. Error information (used by FAPI_SET_HWP_ERROR\n");
- print (" when a HWP generates an error)\n");
- exit(1);
+ my $name = $_[0];
+
+ #--------------------------------------------------------------------------
+ # Check that the error name is not a duplicate
+ #--------------------------------------------------------------------------
+ if (exists($errNameToValueHash{$name}))
+ {
+ # Two different errors with the same name!
+ print ("fapiParseErrorInfo.pl ERROR. Duplicate error name ", $name, "\n");
+ exit(1);
+ }
+
+ #--------------------------------------------------------------------------
+ # Figure out the error enum-value. This is a hash value generated from
+ # the error name. A hash is used for Cronus so that if a HWP is not
+ # recompiled against a new eCMD/Cronus version where the errors have
+ # changed then there will not be a mismatch in error values.
+ # This is a 24bit hash value because FAPI has a requirement that the
+ # top byte of the 32 bit error value be zero to store flags indicating
+ # the creator of the error
+ #--------------------------------------------------------------------------
+ my $errHash128Bit = md5_hex($name);
+ my $errHash24Bit = substr($errHash128Bit, 0, 6);
+
+ #--------------------------------------------------------------------------
+ # Check that the error enum-value is not a duplicate
+ #--------------------------------------------------------------------------
+ if (exists($errValuePresentHash{$errHash24Bit}))
+ {
+ # Two different errors generate the same hash-value!
+ print ("fapiParseAttributeInfo.pl ERROR. Duplicate error hash value\n");
+ exit(1);
+ }
+
+ #--------------------------------------------------------------------------
+ # Update the hashes with the error name and ID
+ #--------------------------------------------------------------------------
+ $errValuePresentHash{$errHash24Bit} = 1;
+ $errNameToValueHash{$name} = $errHash24Bit;
}
#------------------------------------------------------------------------------
-# Specify perl modules to use
+# Subroutine that figures out an FFDC enum value from an FFDC name and stores
+# it in global hashes
#------------------------------------------------------------------------------
-use Digest::MD5 qw(md5_hex);
-use XML::Simple;
-my $xml = new XML::Simple (KeyAttr=>[]);
+sub setFfdcEnumValue
+{
+ my $name = $_[0];
-# Uncomment to enable debug output
-#use Data::Dumper;
+ #--------------------------------------------------------------------------
+ # Check that the FFDC name is not a duplicate
+ #--------------------------------------------------------------------------
+ if (exists($ffdcNameToValueHash{$name}))
+ {
+ # Two different FFDCs with the same name!
+ print ("fapiParseErrorInfo.pl ERROR. Duplicate FFDC name ", $name, "\n");
+ exit(1);
+ }
+
+ #--------------------------------------------------------------------------
+ # Figure out the FFDC enum-value. This is a hash value generated from
+ # the FFDC name.
+ #--------------------------------------------------------------------------
+ my $ffdcHash128Bit = md5_hex($name);
+ my $ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8);
+
+ #--------------------------------------------------------------------------
+ # Check that the error enum-value is not a duplicate
+ #--------------------------------------------------------------------------
+ if (exists($ffdcValuePresentHash{$ffdcHash32Bit}))
+ {
+ # Two different FFDCs generate the same hash-value!
+ print ("fapiParseAttributeInfo.pl ERROR. Duplicate FFDC hash value\n");
+ exit(1);
+ }
+
+ #--------------------------------------------------------------------------
+ # Update the hashes with the error name and ID
+ #--------------------------------------------------------------------------
+ $ffdcValuePresentHash{$ffdcHash32Bit} = 1;
+ $ffdcNameToValueHash{$name} = $ffdcHash32Bit;
+}
#------------------------------------------------------------------------------
# Open output files for writing
@@ -134,6 +238,11 @@ $eiFile .= "/";
$eiFile .= "fapiHwpErrorInfo.H";
open(EIFILE, ">", $eiFile);
+my $crFile = $ARGV[0];
+$crFile .= "/";
+$crFile .= "fapiCollectRegFfdc.C";
+open(CRFILE, ">", $crFile);
+
#------------------------------------------------------------------------------
# Print start of file information to fapiHwpErrorInfo.H
#------------------------------------------------------------------------------
@@ -142,21 +251,37 @@ print EIFILE "// This file is generated by perl script fapiParseErrorInfo.pl\n\n
print EIFILE "#ifndef FAPIHWPERRORINFO_H_\n";
print EIFILE "#define FAPIHWPERRORINFO_H_\n\n";
print EIFILE "/**\n";
-print EIFILE " * \@brief Error Information macros\n";
+print EIFILE " * \@brief Error Information macros and HwpFfdcId enumeration\n";
print EIFILE " *\/\n";
#------------------------------------------------------------------------------
-# Element names
+# Print start of file information to fapiCollectRegFfdc.C
#------------------------------------------------------------------------------
-my $hwpError = 'hwpError';
-my $collectFfdc = 'collectFfdc';
-my $ffdc = 'ffdc';
-my $callout = 'callout';
-my $deconfigure = 'deconfigure';
-my $gard = 'gard';
-
-my %errNameToErrValueHash;
-my %errValuePresentHash;
+print CRFILE "// fapiCollectRegFfdc.C\n";
+print CRFILE "// This file is generated by perl script fapiParseErrorInfo.pl\n\n";
+print CRFILE "#include <stdint.h>\n";
+print CRFILE "#include <vector>\n";
+print CRFILE "#include <ecmdDataBufferBase.H>\n";
+print CRFILE "#include <fapiCollectRegFfdc.H>\n";
+print CRFILE "#include <fapiTarget.H>\n";
+print CRFILE "#include <fapiReturnCode.H>\n";
+print CRFILE "#include <fapiHwAccess.H>\n\n";
+print CRFILE "namespace fapi\n";
+print CRFILE "{\n";
+print CRFILE "void fapiCollectRegFfdc(const fapi::Target & i_target,\n";
+print CRFILE " const fapi::HwpFfdcId i_ffdcId,\n";
+print CRFILE " fapi::ReturnCode & o_rc)\n";
+print CRFILE "{\n";
+print CRFILE " FAPI_INF(\"fapiCollectRegFfdc. FFDC ID: 0x%x\", i_ffdcId);\n";
+print CRFILE " fapi::ReturnCode l_rc;\n";
+print CRFILE " ecmdDataBufferBase l_buf;\n";
+print CRFILE " uint32_t l_cfamData = 0;\n";
+print CRFILE " uint64_t l_scomData = 0;\n";
+print CRFILE " std::vector<uint32_t> l_cfamAddresses;\n";
+print CRFILE " std::vector<uint64_t> l_scomAddresses;\n";
+print CRFILE " uint32_t l_ffdcSize = 0;\n\n";
+print CRFILE " switch (i_ffdcId)\n";
+print CRFILE " {\n";
#------------------------------------------------------------------------------
# For each XML file
@@ -171,7 +296,8 @@ foreach my $argnum (1 .. $#ARGV)
# elements even if there is only one element
#--------------------------------------------------------------------------
my $errors = $xml->XMLin($infile, ForceArray =>
- [$hwpError, $collectFfdc, $ffdc, $callout, $deconfigure, $gard]);
+ ['hwpError', 'collectFfdc', 'ffdc', 'callout', 'deconfigure', 'gard',
+ 'registerFfdc', 'collectRegisterFfdc', 'cfamRegister', 'scomRegister']);
# Uncomment to get debug output of all errors
#print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
@@ -197,57 +323,9 @@ foreach my $argnum (1 .. $#ARGV)
}
#----------------------------------------------------------------------
- # Check that the error name is not a duplicate
- #----------------------------------------------------------------------
- if (exists($errNameToErrValueHash{$err->{rc}}))
- {
- # Two different errors with the same name!
- print ("fapiParseErrorInfo.pl ERROR. Duplicate error name ",
- $err->{rc}, "\n");
- exit(1);
- }
-
- #----------------------------------------------------------------------
- # Figure out the error value. This is a hash value generated from the
- # error name. This is done for Cronus so that if a HWP is not
- # recompiled against a new eCMD/Cronus version where the errors have
- # changed then there will not be a mismatch in error values.
- # This is a 24bit hash value because FAPI has a requirement that the
- # top byte of the 32 bit error value be zero to store flags indicating
- # the creator of the error
- #----------------------------------------------------------------------
- my $errHash128Bit = md5_hex($err->{rc});
- my $errHash24Bit = substr($errHash128Bit, 0, 6);
-
- #----------------------------------------------------------------------
- # Check that the error value is not a duplicate
- #----------------------------------------------------------------------
- if (exists($errValuePresentHash{$errHash24Bit}))
- {
- # Two different errors generate the same hash-value!
- print ("fapiParseAttributeInfo.pl ERROR. Duplicate error hash value\n");
- exit(1);
- }
-
- #----------------------------------------------------------------------
- # Update the hashes with the error name and ID
- #----------------------------------------------------------------------
- $errValuePresentHash{$errHash24Bit} = 1;
- $errNameToErrValueHash{$err->{rc}} = $errHash24Bit;
-
- #----------------------------------------------------------------------
- # Print the CALL_FUNC_TO_ANALYZE_ERROR macro to fapiHwpErrorInfo.H
- #----------------------------------------------------------------------
- print EIFILE "#define $err->{rc}_CALL_FUNC_TO_ANALYZE_ERROR(RC) ";
-
- if (exists $err->{callFunc})
- {
- print EIFILE "FAPI_EXEC_HWP(RC, $err->{callFunc})\n";
- }
- else
- {
- print EIFILE "\n";
- }
+ # Set the error enum value in a global hash
+ #---------------------------------------------------------------------
+ setErrorEnumValue($err->{rc});
#----------------------------------------------------------------------
# Print the CALL_FUNCS_TO_COLLECT_FFDC macro to fapiHwpErrorInfo.H
@@ -274,6 +352,34 @@ foreach my $argnum (1 .. $#ARGV)
print EIFILE "\n";
#----------------------------------------------------------------------
+ # Print the CALL_FUNCS_TO_COLLECT_REG_FFDC macro to fapiHwpErrorInfo.H
+ #----------------------------------------------------------------------
+ print EIFILE "#define $err->{rc}_CALL_FUNCS_TO_COLLECT_REG_FFDC(RC) ";
+
+ foreach my $collectRegisterFfdc (@{$err->{collectRegisterFfdc}})
+ {
+ #------------------------------------------------------------------
+ # Check that expected fields are present
+ #----------------------------------------------------------------------
+ if (! exists $collectRegisterFfdc->{id})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. id missing from collectRegisterFfdc\n");
+ exit(1);
+ }
+
+ if (! exists $collectRegisterFfdc->{target})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. target missing from collectRegisterFfdc\n");
+ exit(1);
+ }
+
+ print EIFILE "fapiCollectRegFfdc($collectRegisterFfdc->{target}, ";
+ print EIFILE "fapi::$collectRegisterFfdc->{id}, RC); ";
+ }
+
+ print EIFILE "\n";
+
+ #----------------------------------------------------------------------
# Print the ADD_ERROR_INFO macro to fapiHwpErrorInfo.H
#----------------------------------------------------------------------
print EIFILE "#define $err->{rc}_ADD_ERROR_INFO(RC) ";
@@ -288,6 +394,11 @@ foreach my $argnum (1 .. $#ARGV)
# Local FFDC
foreach my $ffdc (@{$err->{ffdc}})
{
+ # Set the FFDC enum value in a global hash. The name is <rc>_<ffdc>
+ my $ffdcName = $err->{rc} . "_";
+ $ffdcName = $ffdcName . $ffdc;
+ setFfdcEnumValue($ffdcName);
+
# Add the FFDC data to the EI Object array if it doesn't already exist
my $objNum = addEntryToArray(\@eiObjects, $ffdc);
@@ -296,7 +407,7 @@ foreach my $argnum (1 .. $#ARGV)
{
$eiEntryStr .= ", ";
}
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_FFDC, $objNum, fapi::ReturnCodeFfdc::getErrorInfoFfdcSize($ffdc)}";
+ $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_FFDC, $objNum, fapi::ReturnCodeFfdc::getErrorInfoFfdcSize($ffdc), fapi::$ffdcName}";
$eiEntryCount++;
}
@@ -326,7 +437,7 @@ foreach my $argnum (1 .. $#ARGV)
{
$eiEntryStr .= ", ";
}
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_CALLOUT, $objNum, fapi::PRI_$callout->{priority}}";
+ $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_CALLOUT, $objNum, fapi::PRI_$callout->{priority}, 0}";
$eiEntryCount++;
}
@@ -350,7 +461,7 @@ foreach my $argnum (1 .. $#ARGV)
{
$eiEntryStr .= ", ";
}
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_DECONF, $objNum}";
+ $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_DECONF, $objNum, 0, 0}";
$eiEntryCount++;
}
@@ -374,7 +485,7 @@ foreach my $argnum (1 .. $#ARGV)
{
$eiEntryStr .= ", ";
}
- $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_GARD, $objNum}";
+ $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_GARD, $objNum, 0, 0}";
$eiEntryCount++;
}
@@ -403,9 +514,116 @@ foreach my $argnum (1 .. $#ARGV)
}
print EIFILE "\n\n";
}
+
+ #--------------------------------------------------------------------------
+ # For each registerFfdc.
+ #--------------------------------------------------------------------------
+ foreach my $registerFfdc (@{$errors->{registerFfdc}})
+ {
+ #----------------------------------------------------------------------
+ # Check that expected fields are present
+ #----------------------------------------------------------------------
+ if (! exists $registerFfdc->{id})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. id missing from registerFfdc\n");
+ exit(1);
+ }
+
+ #----------------------------------------------------------------------
+ # Set the FFDC enum value in a global hash
+ #----------------------------------------------------------------------
+ setFfdcEnumValue($registerFfdc->{id});
+
+ #----------------------------------------------------------------------
+ # Generate code to capture the registers in fapiCollectRegFfdc.C
+ #----------------------------------------------------------------------
+ print CRFILE " case $registerFfdc->{id}:\n";
+
+ # Look for CFAM Register addresses
+ foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}})
+ {
+ # Extract the address
+ if ($cfamRegister =~ m/(0x\d+)/)
+ {
+ print CRFILE " l_cfamAddresses.push_back($1);\n";
+ print CRFILE " l_ffdcSize += sizeof(l_cfamData);\n";
+ }
+ else
+ {
+ print ("fapiParseErrorInfo.pl ERROR. CFAM address bad: $cfamRegister\n");
+ exit(1);
+ }
+ }
+
+ # Look for SCOM Register addresses
+ foreach my $scomRegister (@{$registerFfdc->{scomRegister}})
+ {
+ # Extract the address
+ if ($scomRegister =~ m/(0x[\dA-Za-z]+)/)
+ {
+ print CRFILE " l_scomAddresses.push_back($1);\n";
+ print CRFILE " l_ffdcSize += sizeof(l_scomData);\n";
+ }
+ else
+ {
+ print ("fapiParseErrorInfo.pl ERROR. SCOM address bad: $scomRegister\n");
+ exit(1);
+ }
+ }
+
+ print CRFILE " break;\n";
+ }
+
}
#------------------------------------------------------------------------------
+# Print end of file information to fapiCollectRegFfdc.C
+#------------------------------------------------------------------------------
+print CRFILE " default:\n";
+print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: Invalid FFDC ID 0x%x\", ";
+print CRFILE "i_ffdcId);\n";
+print CRFILE " return;\n";
+print CRFILE " }\n\n";
+print CRFILE " uint8_t * l_pBuf = new uint8_t[l_ffdcSize];\n";
+print CRFILE " uint8_t * l_pData = l_pBuf;\n\n";
+print CRFILE " for (uint32_t i = 0; i < l_cfamAddresses.size(); i++)\n";
+print CRFILE " {\n";
+print CRFILE " l_rc = fapiGetCfamRegister(i_target, l_cfamAddresses[i], l_buf);\n";
+print CRFILE " if (l_rc)\n";
+print CRFILE " {\n";
+print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: CFAM error for 0x%x\",";
+print CRFILE "l_cfamAddresses[i]);\n";
+print CRFILE " l_cfamData = 0xbaddbadd;\n";
+print CRFILE " }\n";
+print CRFILE " else\n";
+print CRFILE " {\n";
+print CRFILE " l_cfamData = l_buf.getWord(0);\n";
+print CRFILE " }\n";
+print CRFILE " *(reinterpret_cast<uint32_t *>(l_pData)) = l_cfamData;\n";
+print CRFILE " l_pData += sizeof(l_cfamData);\n";
+print CRFILE " }\n\n";
+print CRFILE " for (uint32_t i = 0; i < l_scomAddresses.size(); i++)\n";
+print CRFILE " {\n";
+print CRFILE " l_rc = fapiGetScom(i_target, l_scomAddresses[i], l_buf);\n";
+print CRFILE " if (l_rc)\n";
+print CRFILE " {\n";
+print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: SCOM error for 0x%x\",";
+print CRFILE "l_scomAddresses[i]);\n";
+print CRFILE " l_scomData = 0xbaddbaddbaddbadd;\n";
+print CRFILE " }\n";
+print CRFILE " else\n";
+print CRFILE " {\n";
+print CRFILE " l_scomData = l_buf.getDoubleWord(0);\n";
+print CRFILE " }\n";
+print CRFILE " *(reinterpret_cast<uint64_t *>(l_pData)) = l_scomData;\n";
+print CRFILE " l_pData += sizeof(l_scomData);\n";
+print CRFILE " }\n\n";
+print CRFILE " o_rc.addEIFfdc(i_ffdcId, l_pBuf, l_ffdcSize);\n";
+print CRFILE " delete [] l_pBuf;\n";
+print CRFILE "}\n";
+print CRFILE "}\n";
+
+#------------------------------------------------------------------------------
# Print the fapiHwpReturnCodes.H file
#------------------------------------------------------------------------------
print RCFILE "// fapiHwpReturnCodes.H\n";
@@ -420,21 +638,39 @@ print RCFILE " * \@brief Enumeration of HWP return codes\n";
print RCFILE " *\/\n";
print RCFILE "enum HwpReturnCode\n";
print RCFILE "{\n";
-foreach my $key (keys %errNameToErrValueHash)
+foreach my $key (keys %errNameToValueHash)
{
- print RCFILE " $key = 0x$errNameToErrValueHash{$key},\n";
+ print RCFILE " $key = 0x$errNameToValueHash{$key},\n";
}
print RCFILE "};\n\n";
print RCFILE "}\n\n";
print RCFILE "#else\n";
-foreach my $key (keys %errNameToErrValueHash)
+foreach my $key (keys %errNameToValueHash)
{
- print RCFILE " .set $key, 0x$errNameToErrValueHash{$key}\n";
+ print RCFILE " .set $key, 0x$errNameToValueHash{$key}\n";
}
print RCFILE "#endif\n";
print RCFILE "#endif\n";
#------------------------------------------------------------------------------
+# Print the HwpFfdcId enumeration to fapiHwpErrorInfo.H
+#------------------------------------------------------------------------------
+print EIFILE "namespace fapi\n";
+print EIFILE "{\n\n";
+print EIFILE "/**\n";
+print EIFILE " * \@brief Enumeration of FFDC identifiers\n";
+print EIFILE " *\/\n";
+print EIFILE "enum HwpFfdcId\n";
+print EIFILE "{\n";
+foreach my $key (keys %ffdcNameToValueHash)
+{
+ print EIFILE " $key = 0x$ffdcNameToValueHash{$key},\n";
+}
+print EIFILE "};\n\n";
+print EIFILE "}\n\n";
+
+
+#------------------------------------------------------------------------------
# Print end of file information to fapiHwpErrorInfo.H
#------------------------------------------------------------------------------
print EIFILE "\n\n#endif\n";
@@ -444,4 +680,5 @@ print EIFILE "\n\n#endif\n";
#------------------------------------------------------------------------------
close(RCFILE);
close(EIFILE);
+close(CRFILE);
diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C
index 97b923406..b8dae8bed 100644
--- a/src/usr/hwpf/fapi/fapiReturnCode.C
+++ b/src/usr/hwpf/fapi/fapiReturnCode.C
@@ -47,11 +47,13 @@
* mjjones 07/11/2012 Remove a trace
* brianh 07/31/2012 performance/size optimizations
* mjjones 08/14/2012 Use new ErrorInfo structure
+ * mjjones 09/19/2012 Add FFDC ID to error info
*/
#include <fapiReturnCode.H>
#include <fapiReturnCodeDataRef.H>
#include <fapiPlatTrace.H>
+#include <fapiTarget.H>
namespace fapi
{
@@ -228,42 +230,51 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
{
for (uint32_t i = 0; i < i_count; i++)
{
- // Figure out the object of this entry
+ // Figure out the object that this FFDC refers to
const void * l_pObject = i_pObjects[i_pEntries[i].iv_object];
if (i_pEntries[i].iv_type == EI_TYPE_FFDC)
{
// Get the size of the object to add as FFDC
int8_t l_size = i_pEntries[i].iv_data1;
+ uint32_t l_ffdcId = i_pEntries[i].iv_data2;
if (l_size > 0)
{
// This is a regular FFDC data object that can be directly
// memcopied
- addEIFfdc(l_pObject, l_size, FFDC_TYPE_DATA);
+ addEIFfdc(l_ffdcId, l_pObject, l_size);
+ }
+ else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_ECMDDB)
+ {
+ // The FFDC is a ecmdDataBufferBase
+ const ecmdDataBufferBase * l_pDb =
+ static_cast<const ecmdDataBufferBase *>(l_pObject);
+
+ uint32_t * l_pData = new uint32_t[l_pDb->getWordLength()];
+
+ // getWordLength rounds up to the next 32bit boundary, ensure
+ // that after extracting, any unset bits are zero
+ l_pData[l_pDb->getWordLength() - 1] = 0;
+
+ // Deliberately not checking return code from extract
+ l_pDb->extract(l_pData, 0, l_pDb->getBitLength());
+ addEIFfdc(l_ffdcId, l_pData, (l_pDb->getWordLength() * 4));
+
+ delete [] l_pData;
+ }
+ else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_TARGET)
+ {
+ // The FFDC is a fapi::Target
+ const fapi::Target * l_pTarget =
+ static_cast<const fapi::Target *>(l_pObject);
+
+ const char * l_ecmdString = l_pTarget->toEcmdString();
+ addEIFfdc(l_ffdcId, l_ecmdString, (strlen(l_ecmdString) + 1));
}
else
{
- // This is a special FFDC data object
- if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_ECMDDB)
- {
- // The FFDC is a ecmdDataBufferBase
- const ecmdDataBufferBase * l_pDb =
- static_cast<const ecmdDataBufferBase *>(l_pObject);
- ReturnCodeFfdc::addEIFfdc(*this, *l_pDb);
- }
- else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_TARGET)
- {
- // The FFDC is a fapi::Target
- const fapi::Target * l_pTarget =
- static_cast<const fapi::Target *>(l_pObject);
- ReturnCodeFfdc::addEIFfdc(*this, *l_pTarget);
- }
- else
- {
- FAPI_ERR("addErrorInfo: Unrecognized FFDC data: %d",
- l_size);
- }
+ FAPI_ERR("addErrorInfo: Unrecognized FFDC data: %d", l_size);
}
}
else if (i_pEntries[i].iv_type == EI_TYPE_CALLOUT)
@@ -306,12 +317,12 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
//******************************************************************************
// addEIFfdc function
//******************************************************************************
-void ReturnCode::addEIFfdc(const void * i_pFfdc,
- const uint32_t i_size,
- const FfdcType i_type)
+void ReturnCode::addEIFfdc(const uint32_t i_ffdcId,
+ const void * i_pFfdc,
+ const uint32_t i_size)
{
// Create a ErrorInfoFfdc object and add it to the Error Information
- ErrorInfoFfdc * l_pFfdc = new ErrorInfoFfdc(i_pFfdc, i_size, i_type);
+ ErrorInfoFfdc * l_pFfdc = new ErrorInfoFfdc(i_ffdcId, i_pFfdc, i_size);
getCreateReturnCodeDataRef().getCreateErrorInfo().
iv_ffdcs.push_back(l_pFfdc);
}
diff --git a/src/usr/hwpf/fapi/makefile b/src/usr/hwpf/fapi/makefile
index 5b3db9e72..ddb17b4b9 100644
--- a/src/usr/hwpf/fapi/makefile
+++ b/src/usr/hwpf/fapi/makefile
@@ -1,25 +1,25 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/hwpf/fapi/makefile $
+# $Source: src/usr/hwpf/fapi/makefile $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011-2012
+# COPYRIGHT International Business Machines Corp. 2011,2012
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
MODULE = fapi
@@ -36,7 +36,8 @@ OBJS = fapiReturnCode.o \
fapiErrorInfo.o \
fapiAttributeService.o \
fapiChipEcFeature.o \
- fapiAttributeOverride.o
+ fapiAttributeOverride.o \
+ fapiCollectRegFfdc.o
include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_sbe_ffdc.C b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_sbe_ffdc.C
index f5f1bb2b8..b22942403 100644
--- a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_sbe_ffdc.C
+++ b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_sbe_ffdc.C
@@ -97,7 +97,10 @@ extern "C" {
break;
}
data_32 = dataBuff.getWord( 0 );
- fapi::ReturnCodeFfdc::addEIFfdc(o_rc, data_32);
+ // TODO. When the new way to collect register FFDC is introduced in Cronus,
+ // this HWP will vanish and XML will be written to collect the data
+ // RTC Issue 50362
+ // fapi::ReturnCodeFfdc::addEIFfdc(o_rc, data_32);
cfam_index++;
} while (cfams[cfam_index] != END_CFAMS);
@@ -146,7 +149,9 @@ extern "C" {
break;
}
data_64 = dataBuff.getDoubleWord( 0 );
- fapi::ReturnCodeFfdc::addEIFfdc(o_rc, data_64);
+ // TODO. When the new way to collect register FFDC is introduced in Cronus,
+ // this HWP will vanish and XML will be written to collect the data
+ // fapi::ReturnCodeFfdc::addEIFfdc(o_rc, data_64);
scom_index++;
} while (scoms[scom_index] != END_SCOMS);
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
index 4293afaf4..c101ab0a3 100644
--- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
+++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
@@ -1,60 +1,77 @@
-<!-- IBM_PROLOG_BEGIN_TAG
- This is an automatically generated prolog.
-
- $Source: src/usr/hwpf/hwp/fapiHwpErrorInfo.xml $
-
- IBM CONFIDENTIAL
-
- COPYRIGHT International Business Machines Corp. 2011
-
- 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 -->
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/usr/hwpf/hwp/fapiHwpErrorInfo.xml $ -->
+<!-- -->
+<!-- IBM CONFIDENTIAL -->
+<!-- -->
+<!-- COPYRIGHT International Business Machines Corp. 2011,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 otherwise -->
+<!-- divested of its trade secrets, irrespective of what has been -->
+<!-- deposited with the U.S. Copyright Office. -->
+<!-- -->
+<!-- Origin: 30 -->
+<!-- -->
+<!-- IBM_PROLOG_END_TAG -->
<!-- XML file specifying Test HW Procedure generated errors. -->
<hwpErrors>
+ <registerFfdc>
+ <id>REG_FFDC_TEST_X_PROC_REGISTERS</id>
+ <cfamRegister>CFAM_FSI_GP8_0x00002817</cfamRegister>
+ <scomRegister>PORE_GPE0_STATUS_0x00060000</scomRegister>
+ <scomRegister>PORE_GPE0_CONTROL_0x00060001</scomRegister>
+ <scomRegister>PORE_GPE0_RESET_0x00060002</scomRegister>
+ <scomRegister>PORE_GPE0_ERROR_MASK_0x00060003</scomRegister>
+ </registerFfdc>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_TEST_ERROR_A</rc>
- <description>HWP Unit Test expected error A</description>
- <!-- Call hwpTestFfdc1 to collect FFDC from the master chip -->
- <collectFfdc>hwpTestFfdc1, MASTER_CHIP</collectFfdc>
- <!-- Add some data as FFDC -->
- <ffdc>FFDC_DATA_1</ffdc>
+ <description>HWP Error A generated by Unit Test</description>
+ <collectRegisterFfdc>
+ <id>REG_FFDC_TEST_X_PROC_REGISTERS</id>
+ <target>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</target>
+ </collectRegisterFfdc>
+ <!-- Call hwpTestFfdc1 to collect additional FFDC from the master chip -->
+ <collectFfdc>hwpTestFfdc1, UNIT_TEST_FFDC_MASTER_CHIP_TARGET</collectFfdc>
+ <!-- Add some integer data as FFDC -->
+ <ffdc>UNIT_TEST_FFDC_DATA_INTEGER</ffdc>
<!-- Add an ecmdDataBufferBase as FFDC -->
- <ffdc>FFDC_DATA_BUF</ffdc>
+ <ffdc>UNIT_TEST_FFDC_DATA_BUF</ffdc>
<!-- Add a Target as FFDC -->
- <ffdc>MASTER_CHIP</ffdc>
+ <ffdc>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</ffdc>
<!-- Callout MASTER_CHIP HIGH -->
- <callout>
- <target>MASTER_CHIP</target>
- <priority>HIGH</priority>
- </callout>
+ <!-- Commented out to avoid actually calling out a chip in UT
+ <callout>
+ <target>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</target>
+ <priority>HIGH</priority>
+ </callout>
+ -->
<!-- Deconfigure MASTER_CHIP -->
- <deconfigure>
- <target>MASTER_CHIP</target>
- </deconfigure>
+ <!-- Commented out to avoid actually deconfiuring a chip in UT
+ <deconfigure>
+ <target>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</target>
+ </deconfigure>
+ -->
<!-- Create GARD record for MASTER_CHIP -->
- <gard>
- <target>MASTER_CHIP</target>
- </gard>
+ <!-- Commented out to avoid actually GARDing a chip in UT
+ <gard>
+ <target>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</target>
+ </gard>
+ -->
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_TEST_ERROR_B</rc>
- <description>HWP Unit Test expected error B</description>
- <!-- Call hwpTestAnalyzeError on MASTER_CHIP to analyze the error -->
- <callFunc>hwpTestAnalyzeError, MASTER_CHIP</callFunc>
+ <description>HWP Error B used to add FFDC to an existing ReturnCode</description>
+ <ffdc>UNIT_TEST_FFDC_DATA</ffdc>
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
diff --git a/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C b/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C
deleted file mode 100644
index 761c9526e..000000000
--- a/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C
+++ /dev/null
@@ -1,75 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C $ */
-/* */
-/* IBM CONFIDENTIAL */
-/* */
-/* COPYRIGHT International Business Machines Corp. 2011,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 otherwise */
-/* divested of its trade secrets, irrespective of what has been */
-/* deposited with the U.S. Copyright Office. */
-/* */
-/* Origin: 30 */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file fapiTestHwpAnalyzeError.C
- *
- * @brief Implements a simple test Hardware Procedure that analyzes an error
- */
-
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 10/17/2011 Created (moved from other file)
- *
- * HWP_IGNORE_VERSION_CHECK
- */
-
-#include <fapiTestHwpAnalyzeError.H>
-
-extern "C"
-{
-
-//******************************************************************************
-// hwpTestAnalyzeError function
-//******************************************************************************
-fapi::ReturnCode hwpTestAnalyzeError(const fapi::Target & i_target)
-{
- FAPI_INF("hwpTestAnalyzeError: Start HWP (analysis HWP)");
-
- // This HWP analyses an error condition to decide what the error actually is
- // In real life, this HWP may look at chip error registers
- fapi::ReturnCode l_rc;
-
- // Local FFDC that needs to be captured
- uint32_t l_ffdc = 0x12345678;
-
- // Local ecmdDataBufferBase that needs to be captured
- ecmdDataBufferBase l_buf(65);
- l_buf.setBit(1);
- l_buf.setBit(64);
-
- // Analysis reveals that the error is RC_TEST_ERROR_A
- FAPI_ERR("hwpTestAnalyzeError: Generating RC_TEST_ERROR_A");
-
- // Generate error
- const fapi::Target & MASTER_CHIP = i_target;
- uint32_t & FFDC_DATA_1 = l_ffdc;
- ecmdDataBufferBase & FFDC_DATA_BUF = l_buf;
- FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
-
- FAPI_INF("hwpTestAnalyzeError: End HWP");
- return l_rc;
-}
-
-}
diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C
index 0c47cb2e2..ea1662dca 100644
--- a/src/usr/hwpf/hwp/fapiTestHwpError.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpError.C
@@ -55,11 +55,17 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
fapi::ReturnCode l_rc;
- // Error RC_TEST_ERROR_B encountered, the error information requests that
- // hwpTestAnalyzeError be called to analyze the error condition
- FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_B");
- const fapi::Target & MASTER_CHIP = i_target;
- FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_B);
+ // Local data that needs to be captured as FFDC
+ uint32_t l_ffdc = 0x12345678;
+ ecmdDataBufferBase l_buf(65);
+ l_buf.setBit(1);
+ l_buf.setBit(64);
+
+ FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A");
+ const fapi::Target & UNIT_TEST_FFDC_MASTER_CHIP_TARGET = i_target;
+ uint32_t & UNIT_TEST_FFDC_DATA_INTEGER = l_ffdc;
+ ecmdDataBufferBase & UNIT_TEST_FFDC_DATA_BUF = l_buf;
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
// Log the error
fapiLogError(l_rc);
@@ -72,8 +78,8 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
}
// Generate the same error again
- FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_B");
- FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_B);
+ FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A again");
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
FAPI_INF("hwpTestError: End HWP");
return l_rc;
diff --git a/src/usr/hwpf/hwp/fapiTestHwpFfdc.C b/src/usr/hwpf/hwp/fapiTestHwpFfdc.C
index f1f042966..f001ce28d 100644
--- a/src/usr/hwpf/hwp/fapiTestHwpFfdc.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpFfdc.C
@@ -54,7 +54,9 @@ fapi::ReturnCode hwpTestFfdc1(const fapi::Target & i_target,
// Collect a uint64_t worth of FFDC
uint64_t l_ffdc = 0x1122334455667788ULL;
- fapi::ReturnCodeFfdc::addEIFfdc(o_rc, l_ffdc);
+ // Add FFDC specified by RC_TEST_ERROR_B
+ uint64_t & UNIT_TEST_FFDC_DATA = l_ffdc;
+ FAPI_ADD_INFO_TO_HWP_ERROR(o_rc, RC_TEST_ERROR_B);
FAPI_INF("hwpTestFfdc1: End HWP");
return fapi::FAPI_RC_SUCCESS;
diff --git a/src/usr/hwpf/hwp/makefile b/src/usr/hwpf/hwp/makefile
index 757bcee45..760a09ccf 100644
--- a/src/usr/hwpf/hwp/makefile
+++ b/src/usr/hwpf/hwp/makefile
@@ -34,7 +34,6 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build
OBJS = fapiTestHwp.o \
fapiTestHwpError.o \
- fapiTestHwpAnalyzeError.o \
fapiTestHwpFfdc.o \
fapiTestHwpConfig.o \
fapiTestHwpAttr.o \
diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile
index e0d71a709..d97bc37cf 100644
--- a/src/usr/hwpf/makefile
+++ b/src/usr/hwpf/makefile
@@ -96,8 +96,8 @@ IF_CMP_COMPILER_TARGET = ifcompiler
# The FAPI return code and error info files generated from Error XML files
FAPI_ERROR_TARGETS = fapiHwpReturnCodes.H fapiHwpErrorInfo.H
-# The PLAT HWP RC Decoder file generated from Error XML files
-PLAT_ERROR_HWP_RC_DECODER = fapiPlatHwpRcDecode.H
+# The PLAT HWP Error Parser file generated from Error XML files
+PLAT_HWP_ERR_PARSER = fapiPlatHwpErrParser.H
# The FAPI attribute id file generated from Attribute XML files
FAPI_ATTR_ID_TARGET = fapiAttributeIds.H
@@ -127,7 +127,7 @@ GENFILES = ${IF_CMP_YACC_C_TARGET} \
${IF_CMP_FLEX_TARGET} \
${IF_CMP_COMPILER_TARGET} \
${FAPI_ERROR_TARGETS} \
- ${PLAT_ERROR_HWP_RC_DECODER} \
+ ${PLAT_HWP_ERR_PARSER} \
${FAPI_ATTR_ID_TARGET} \
${FAPI_ATTR_PLAT_CHECK_TARGET} \
${FAPI_ATTRS_SUPPORTED_TARGET} \
@@ -177,10 +177,10 @@ $(call GENTARGET, ${FAPI_ERROR_TARGETS}) : \
$< $(dir $@) ${HWP_ERROR_XML_FILES}
#------------------------------------------------------------------------------
-# The PLAT HWP RC Decoder file generated from Error XML files
+# The PLAT HWP RC and FFDC parser file generated from Error XML files
#------------------------------------------------------------------------------
-$(call GENTARGET, ${PLAT_ERROR_HWP_RC_DECODER}) : \
- plat/fapiPlatCreateHwpRcDecoder.pl ${HWP_ERROR_XML_FILES}
+$(call GENTARGET, ${PLAT_HWP_ERR_PARSER}) : \
+ plat/fapiPlatCreateHwpErrParser.pl ${HWP_ERROR_XML_FILES}
$< $(dir $@) ${HWP_ERROR_XML_FILES}
#------------------------------------------------------------------------------
diff --git a/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl b/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl
new file mode 100755
index 000000000..762e7280b
--- /dev/null
+++ b/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl
@@ -0,0 +1,256 @@
+#!/usr/bin/perl
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl $
+#
+# 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 otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+
+#
+# Purpose: This perl script will parse HWP Error XML files and create a
+# file containing functions that parses the return code and FFDC
+# data in HWP error logs
+#
+# Author: Mike Jones
+#
+
+use strict;
+
+#------------------------------------------------------------------------------
+# Print Command Line Help
+#------------------------------------------------------------------------------
+my $numArgs = $#ARGV + 1;
+if ($numArgs < 2)
+{
+ print ("Usage: fapiPlatCreateHwpErrParser.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 (" parse the return code and FFDC data in HWP error logs\n");
+ exit(1);
+}
+
+#------------------------------------------------------------------------------
+# Specify perl modules to use
+#------------------------------------------------------------------------------
+use Digest::MD5 qw(md5_hex);
+use XML::Simple;
+my $xml = new XML::Simple (KeyAttr=>[]);
+
+# Uncomment to enable debug output
+#use Data::Dumper;
+
+#------------------------------------------------------------------------------
+# Open output files for writing
+#------------------------------------------------------------------------------
+my $rcFile = $ARGV[0];
+$rcFile .= "/";
+$rcFile .= "fapiPlatHwpErrParser.H";
+open(TGFILE, ">", $rcFile);
+
+#------------------------------------------------------------------------------
+# Print start of file information
+#------------------------------------------------------------------------------
+print TGFILE "// fapiPlatHwpErrParser.H\n";
+print TGFILE "// This file is generated by perl script fapiPlatCreateHwpErrParser.pl\n\n";
+print TGFILE "#ifndef FAPIPLATHWPERRPARSER_H_\n";
+print TGFILE "#define FAPIPLATHWPERRPARSER_H_\n\n";
+print TGFILE "#ifdef PARSER\n\n";
+print TGFILE "namespace fapi\n";
+print TGFILE "{\n\n";
+print TGFILE "void fapiParseHwpRc(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 = ntohl(*(static_cast<uint32_t *>(i_pBuffer)));\n\n";
+print TGFILE " switch(l_rc)\n";
+print TGFILE " {\n";
+
+#------------------------------------------------------------------------------
+# For each XML file
+#------------------------------------------------------------------------------
+foreach my $argnum (1 .. $#ARGV)
+{
+ #--------------------------------------------------------------------------
+ # Read XML file
+ #--------------------------------------------------------------------------
+ my $infile = $ARGV[$argnum];
+ my $errors = $xml->XMLin($infile, ForceArray => ['hwpError']);
+
+ # Uncomment to get debug output of all errors
+ #print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
+
+ #--------------------------------------------------------------------------
+ # For each Error
+ #--------------------------------------------------------------------------
+ foreach my $err (@{$errors->{hwpError}})
+ {
+ #----------------------------------------------------------------------
+ # Get the description, remove newlines, leading and trailing spaces and
+ # multiple spaces
+ #----------------------------------------------------------------------
+ my $desc = $err->{description};
+ $desc =~ s/\n/ /g;
+ $desc =~ s/^ +//g;
+ $desc =~ s/ +$//g;
+ $desc =~ s/ +/ /g;
+
+ #----------------------------------------------------------------------
+ # Print the RC description
+ # Note that this uses the same code to calculate the error enum value
+ # as fapiParseErrorInfo.pl. This code must be kept in sync
+ #----------------------------------------------------------------------
+ my $errHash128Bit = md5_hex($err->{rc});
+ my $errHash24Bit = substr($errHash128Bit, 0, 6);
+
+ print TGFILE " case 0x$errHash24Bit:\n";
+ print TGFILE " i_parser.PrintString(\"HWP Error description\", \"$desc\");\n";
+ print TGFILE " break;\n";
+ }
+}
+
+#------------------------------------------------------------------------------
+# Print end of fapiParseHwpRc function
+#------------------------------------------------------------------------------
+print TGFILE " default:\n";
+print TGFILE " i_parser.PrintNumber(\"Unrecognized Error ID\", \"0x%x\", l_rc);\n";
+print TGFILE " }\n";
+print TGFILE "}\n\n";
+
+#------------------------------------------------------------------------------
+# Print start of fapiParseHwpFfdc function
+#------------------------------------------------------------------------------
+print TGFILE "void fapiParseHwpFfdc(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";
+print TGFILE " uint8_t * l_pBuffer = static_cast<uint8_t *>(i_pBuffer);\n";
+print TGFILE " int32_t l_buflen = i_buflen;\n\n";
+print TGFILE " // The first uint32_t is the FFDC ID\n";
+print TGFILE " uint32_t * l_pFfdcId = static_cast<uint32_t *>(i_pBuffer);\n";
+print TGFILE " uint32_t l_ffdcId = ntohl(*l_pFfdcId);\n";
+print TGFILE " l_pBuffer += sizeof(l_ffdcId);\n";
+print TGFILE " l_buflen -= sizeof(l_ffdcId);\n";
+print TGFILE " switch(l_ffdcId)\n";
+print TGFILE " {\n";
+
+#------------------------------------------------------------------------------
+# For each XML file
+#------------------------------------------------------------------------------
+foreach my $argnum (1 .. $#ARGV)
+{
+ #--------------------------------------------------------------------------
+ # Read XML file
+ #--------------------------------------------------------------------------
+ my $infile = $ARGV[$argnum];
+ my $errors = $xml->XMLin($infile, ForceArray =>
+ ['hwpError', 'ffdc', 'registerFfdc', 'cfamRegister', 'scomRegister']);
+
+ # Uncomment to get debug output of all errors
+ #print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
+
+ #--------------------------------------------------------------------------
+ # If it is an FFDC section resulting from a <hwpError><ffdc> element, print
+ # out the FFDC name and hexdump the data
+ #--------------------------------------------------------------------------
+ foreach my $err (@{$errors->{hwpError}})
+ {
+ foreach my $ffdc (@{$err->{ffdc}})
+ {
+ #------------------------------------------------------------------
+ # Figure out the FFDC ID stored in the data. This is calculated in
+ # the same way as fapiParseErrorInfo.pl. This code must be kept in
+ # sync
+ #------------------------------------------------------------------
+ my $ffdcName = $err->{rc} . "_";
+ $ffdcName = $ffdcName . $ffdc;
+ my $ffdcHash128Bit = md5_hex($ffdcName);
+ my $ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8);
+
+ print TGFILE " case 0x$ffdcHash32Bit:\n";
+ print TGFILE " i_parser.PrintString(\"FFDC:\", \"$ffdcName\");\n";
+ print TGFILE " if (l_buflen) ";
+ print TGFILE "{i_parser.PrintHexDump(l_pBuffer, l_buflen);}\n";
+ print TGFILE " break;\n";
+ }
+ }
+
+ #--------------------------------------------------------------------------
+ # If it is an FFDC section resulting from a <registerFfdc> element, print
+ # out the ID and walk through the registers, printing each out
+ #--------------------------------------------------------------------------
+ foreach my $registerFfdc (@{$errors->{registerFfdc}})
+ {
+ #----------------------------------------------------------------------
+ # Figure out the FFDC ID stored in the data. This is calculated in the
+ # same way as fapiParseErrorInfo.pl. This code must be kept in sync
+ #----------------------------------------------------------------------
+ my $ffdcName = $registerFfdc->{id};
+ my $ffdcHash128Bit = md5_hex($ffdcName);
+ my $ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8);
+ print TGFILE " case 0x$ffdcHash32Bit:\n";
+ print TGFILE " i_parser.PrintString(\"Register FFDC:\", \"$ffdcName\");\n";
+
+ foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}})
+ {
+ print TGFILE " l_buflen -= CFAM_DATA_LEN;\n";
+ print TGFILE " if (l_buflen)\n";
+ print TGFILE " {\n";
+ print TGFILE " i_parser.PrintString(NULL, \"$cfamRegister\");\n";
+ print TGFILE " i_parser.PrintHexDump(l_pBuffer, CFAM_DATA_LEN);\n";
+ print TGFILE " }\n";
+ print TGFILE " l_pBuffer+= CFAM_DATA_LEN;\n";
+ }
+
+ foreach my $scomRegister (@{$registerFfdc->{scomRegister}})
+ {
+ print TGFILE " l_buflen -= SCOM_DATA_LEN;\n";
+ print TGFILE " if (l_buflen)\n";
+ print TGFILE " {\n";
+ print TGFILE " i_parser.PrintString(NULL, \"$scomRegister\");\n";
+ print TGFILE " i_parser.PrintHexDump(l_pBuffer, SCOM_DATA_LEN);\n";
+ print TGFILE " }\n";
+ print TGFILE " l_pBuffer+= SCOM_DATA_LEN;\n";
+ }
+
+ print TGFILE " break;\n";
+ }
+}
+
+#------------------------------------------------------------------------------
+# Print end of fapiParseHwpFfdc function
+#------------------------------------------------------------------------------
+print TGFILE " default:\n";
+print TGFILE " i_parser.PrintNumber(\"Unrecognized FFDC\", \"0x%x\", l_ffdcId);\n";
+print TGFILE " }\n\n";
+print TGFILE "}\n\n";
+
+#------------------------------------------------------------------------------
+# Print end of file info
+#------------------------------------------------------------------------------
+print TGFILE "}\n\n";
+print TGFILE "#endif\n";
+print TGFILE "#endif\n";
+
+#------------------------------------------------------------------------------
+# Close output file
+#------------------------------------------------------------------------------
+close(TGFILE);
+
diff --git a/src/usr/hwpf/plat/fapiPlatCreateHwpRcDecoder.pl b/src/usr/hwpf/plat/fapiPlatCreateHwpRcDecoder.pl
deleted file mode 100755
index a73a1dd77..000000000
--- a/src/usr/hwpf/plat/fapiPlatCreateHwpRcDecoder.pl
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
-#
-# $Source: src/usr/hwpf/plat/fapiPlatCreateHwpRcDecoder.pl $
-#
-# 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 otherwise
-# divested of its trade secrets, irrespective of what has been
-# deposited with the U.S. Copyright Office.
-#
-# Origin: 30
-#
-# IBM_PROLOG_END_TAG
-
-#
-# Purpose: This perl script will parse HWP Error XML files and create a
-# file containing a function that decodes HWP RC values
-#
-# Author: Mike Jones
-#
-
-use strict;
-
-#------------------------------------------------------------------------------
-# Print Command Line Help
-#------------------------------------------------------------------------------
-my $numArgs = $#ARGV + 1;
-if ($numArgs < 2)
-{
- print ("Usage: fapiPlatCreateHwpRcDecoder.pl <output dir> <filename1> <filename2> ...\n");
- print (" This perl script will parse HWP Error XML files and create\n");
- print (" a file containing a function that decodes HWP RC values\n");
- exit(1);
-}
-
-#------------------------------------------------------------------------------
-# Specify perl modules to use
-#------------------------------------------------------------------------------
-use Digest::MD5 qw(md5_hex);
-use XML::Simple;
-my $xml = new XML::Simple (ForceArray=>[qw(hwpError)]);
-
-# Uncomment to enable debug output
-#use Data::Dumper;
-
-#------------------------------------------------------------------------------
-# Open output files for writing
-#------------------------------------------------------------------------------
-my $rcFile = $ARGV[0];
-$rcFile .= "/";
-$rcFile .= "fapiPlatHwpRcDecode.H";
-open(TGFILE, ">", $rcFile);
-
-#------------------------------------------------------------------------------
-# Print start of file information
-#------------------------------------------------------------------------------
-print TGFILE "// fapiPlatHwpRcDecode.H\n";
-print TGFILE "// This file is generated by perl script fapiPlatCreateHwpRcDecoder.pl\n\n";
-print TGFILE "#ifndef FAPIPLATHWPRCDECODE_H_\n";
-print TGFILE "#define FAPIPLATHWPRCDECODE_H_\n\n";
-print TGFILE "#ifdef PARSER\n\n";
-print TGFILE "namespace fapi\n";
-print TGFILE "{\n\n";
-print TGFILE "const char * fapiDecodeHwpRc(const uint32_t i_rcValue)\n";
-print TGFILE "{\n";
-print TGFILE " switch(i_rcValue)\n";
-print TGFILE " {\n";
-
-#------------------------------------------------------------------------------
-# For each XML file
-#------------------------------------------------------------------------------
-foreach my $argnum (1 .. $#ARGV)
-{
- #--------------------------------------------------------------------------
- # Read XML file
- #--------------------------------------------------------------------------
- my $infile = $ARGV[$argnum];
- my $errors = $xml->XMLin($infile);
-
- # Uncomment to get debug output of all errors
- #print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
-
- #--------------------------------------------------------------------------
- # For each Error
- #--------------------------------------------------------------------------
- foreach my $err (@{$errors->{hwpError}})
- {
- #----------------------------------------------------------------------
- # Check that expected fields are present
- #----------------------------------------------------------------------
- if (! exists $err->{rc})
- {
- print ("fapiPlatCreateHwpRcDecoder.pl ERROR. rc missing\n");
- exit(1);
- }
-
- if (! exists $err->{description})
- {
- print ("fapiPlatCreateHwpRcDecoder.pl ERROR. description missing\n");
- exit(1);
- }
-
- #----------------------------------------------------------------------
- # Get the description, remove newlines, leading and trailing spaces and
- # multiple spaces
- #----------------------------------------------------------------------
- my $desc = $err->{description};
- $desc =~ s/\n/ /g;
- $desc =~ s/^ +//g;
- $desc =~ s/ +$//g;
- $desc =~ s/ +/ /g;
-
- #----------------------------------------------------------------------
- # Print the RC decode
- # Note that this uses the same code to calculate the attribute
- # enumerator as fapiParseErrorInfo.pl. This code must be kept in sync
- # with fapiParseErrorInfo.pl.
- #----------------------------------------------------------------------
- my $attrHash128Bit = md5_hex($err->{rc});
- my $attrHash24Bit = substr($attrHash128Bit, 0, 6);
-
- print TGFILE " case 0x$attrHash24Bit:\n";
- print TGFILE " return \"$desc\";\n";
- print TGFILE " break;\n";
- }
-}
-
-#------------------------------------------------------------------------------
-# Print end of file information
-#------------------------------------------------------------------------------
-print TGFILE " default:\n";
-print TGFILE " return NULL;\n";
-print TGFILE " }\n";
-print TGFILE "}\n\n";
-print TGFILE "}\n\n";
-print TGFILE "#endif\n";
-print TGFILE "#endif\n";
-
-#------------------------------------------------------------------------------
-# Close output file
-#------------------------------------------------------------------------------
-close(TGFILE);
-
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index b2d716797..2680a9035 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/hwpf/plat/fapiPlatHwpInvoker.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2011-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_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/plat/fapiPlatHwpInvoker.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file fapiPlatHwpInvoker.C
*
@@ -46,36 +45,27 @@ void processEIFfdcs(const ErrorInfo & i_errInfo,
{
// Iterate through the FFDC sections, adding each to the error log
uint32_t l_size = 0;
- const void * l_pFfdc = NULL;
- FfdcType l_type = FFDC_TYPE_NONE;
for (ErrorInfo::ErrorInfoFfdcCItr_t l_itr = i_errInfo.iv_ffdcs.begin();
l_itr != i_errInfo.iv_ffdcs.end(); ++l_itr)
{
- l_pFfdc = (*l_itr)->getData(l_size);
- l_type = (*l_itr)->getType();
+ const void * l_pFfdc = (*l_itr)->getData(l_size);
+ uint32_t l_ffdcId = (*l_itr)->getFfdcId();
- if (l_type == FFDC_TYPE_TARGET)
- {
- io_pError->addFFDC(HWPF_COMP_ID, l_pFfdc, l_size, 1,
- HWPF_UDT_HWP_TARGET);
- }
- else if (l_type == FFDC_TYPE_ECMDDBB)
- {
- io_pError->addFFDC(HWPF_COMP_ID, l_pFfdc, l_size, 1,
- HWPF_UDT_HWP_ECMDDBB);
- }
- else
- {
- io_pError->addFFDC(HWPF_COMP_ID, l_pFfdc, l_size, 1,
- HWPF_UDT_HWP_DATA);
+ // Add the FFDC ID as the first word, then the FFDC data
+ ERRORLOG::ErrlUD * l_pUD = io_pError->addFFDC(
+ HWPF_COMP_ID, &l_ffdcId, sizeof(l_ffdcId), 1, HWPF_UDT_HWP_FFDC);
+
+ if (l_pUD)
+ {
+ io_pError->appendToFFDC(l_pUD, l_pFfdc, l_size);
}
}
}
//******************************************************************************
// processEICDGs
-// Processes any Callout/Deconfigure/GARD requests in the ReturnCode Error
+// Processes any Callout/Deconfigure/GARD requests in the ReturnCode Error
// Information
//******************************************************************************
void processEICDGs(const ErrorInfo & i_errInfo,
diff --git a/src/usr/mbox/plugins/mboxParse.C b/src/usr/mbox/plugins/mboxParse.C
index 5d2a78f7d..d0654e671 100644
--- a/src/usr/mbox/plugins/mboxParse.C
+++ b/src/usr/mbox/plugins/mboxParse.C
@@ -24,5 +24,5 @@
#include <errl/errludparser.H>
#include <mbox/mboxUdParserFactory.H>
-ERRL_MAKE_UD_PARSER(mbox::UserDetailsParserFactory, HBMBOX_COMP_ID)
+ERRL_MAKE_UD_PARSER(MBOX::UserDetailsParserFactory, HBMBOX_COMP_ID)
OpenPOWER on IntegriCloud