summaryrefslogtreecommitdiffstats
path: root/src/import/hwpf
diff options
context:
space:
mode:
authorLuke Mulkey <lwmulkey@us.ibm.com>2017-02-02 14:34:02 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-02-24 07:33:27 -0500
commit0680c5ee7c87a41b76b2a2df89bac4eea161bd49 (patch)
tree6ac43a6d82194d653819a1e7a78029e133fa42cf /src/import/hwpf
parenta715e1cbcedd5bfc14944c7d296aee69e3847ff1 (diff)
downloadtalos-sbe-0680c5ee7c87a41b76b2a2df89bac4eea161bd49.tar.gz
talos-sbe-0680c5ee7c87a41b76b2a2df89bac4eea161bd49.zip
Existing code changes for ddr_phy_reset HB mirror
Change-Id: I45015e2967f719d2fd53be9faaf5cef0cd8457f5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35842 Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: LUCAS W. MULKEY <lwmulkey@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35859 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/hwpf')
-rwxr-xr-xsrc/import/hwpf/fapi2/tools/parseErrorInfo.pl867
1 files changed, 448 insertions, 419 deletions
diff --git a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
index 49a45818..9d692109 100755
--- a/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
+++ b/src/import/hwpf/fapi2/tools/parseErrorInfo.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2016
+# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
@@ -51,59 +51,63 @@ $XML::Simple::PREFERRED_PARSER = 'XML::Parser';
#------------------------------------------------------------------------------
use Digest::MD5 qw(md5_hex);
use XML::Simple;
-my $xml = new XML::Simple (KeyAttr=>[]);
+my $xml = new XML::Simple( KeyAttr => [] );
# Uncomment to enable debug output
use Data::Dumper;
use Getopt::Long;
-my $sbeTarget = undef;
-my @eiObjects = ();
-my $target_ffdc_type = "fapi2::Target<T>";
-my $buffer_ffdc_type = "fapi2::buffer";
+my $sbeTarget = undef;
+my @eiObjects = ();
+my $target_ffdc_type = "fapi2::Target<T>";
+my $buffer_ffdc_type = "fapi2::buffer";
my $variable_buffer_ffdc_type = "fapi2::variable_buffer";
-my $ffdc_type = "fapi2::ffdc_t";
-my $mcast_type = "fapi2::mcast_t";
+my $ffdc_type = "fapi2::ffdc_t";
+my $mcast_type = "fapi2::mcast_t";
# There are some names used in the XML files which exist in either
# c++ keywords (case, for example) or macros (DOMAIN). The one's which
# cause problems and need to be changed are here.
#
# DOMAIN is defined to 1 in math.h
-my %mangle_names = ("DOMAIN" => "FAPI2_DOMAIN");
+my %mangle_names = ( "DOMAIN" => "FAPI2_DOMAIN" );
# A list of deprecated elements. These will report messages to the
# user, and not define anything. They have not been found to be used,
# but that doesn't mean they're not ...
-my %deprecated = ("RC_PROCPM_PMCINIT_TIMEOUT" => "CHIP_IN_ERROR is defined as a callout procedure");
+my %deprecated = ( "RC_PROCPM_PMCINIT_TIMEOUT" => "CHIP_IN_ERROR is defined as a callout procedure" );
#------------------------------------------------------------------------------
# Print Command Line Help
#------------------------------------------------------------------------------
-my $arg_empty_ffdc = undef;
-my $arg_local_ffdc = undef;
-my $arg_output_dir = undef;
+my $arg_empty_ffdc = undef;
+my $arg_local_ffdc = undef;
+my $arg_output_dir = undef;
my $arg_use_variable_buffers = undef;
# Get the options from the command line - the rest of @ARGV will
# be filenames
-GetOptions("empty-ffdc-classes" => \$arg_empty_ffdc,
- "local-ffdc" => \$arg_local_ffdc,
- "output-dir=s" => \$arg_output_dir,
- "use-variable-buffers" => \$arg_use_variable_buffers);
+GetOptions(
+ "empty-ffdc-classes" => \$arg_empty_ffdc,
+ "local-ffdc" => \$arg_local_ffdc,
+ "output-dir=s" => \$arg_output_dir,
+ "use-variable-buffers" => \$arg_use_variable_buffers
+);
my $numArgs = $#ARGV + 1;
-if (($numArgs < 1) || ($arg_output_dir eq undef))
+if ( ( $numArgs < 1 ) || ( $arg_output_dir eq undef ) )
{
- print ("Usage: parseErrorInfo.pl [--empty-ffdc-classes] [--use-variable-buffers] --output-dir=<output dir> <filename1> <filename2> ...\n");
- print (" This perl script will parse HWP Error XML files and creates\n");
- print (" the following files:\n");
- print (" - hwp_return_codes.H. HwpReturnCode enumeration (HWP generated errors)\n");
- print (" - hwp_error_info.H. Error information (used by FAPI_SET_HWP_ERROR\n");
- print (" when a HWP generates an error)\n");
- print (" - collect_reg_ffdc_regs.H. File containing registers used by collectRegFfdc() \n");
- print (" - set_sbe_error.H. Macro to create an SBE error\n");
- print (" The --empty-ffdc-classes option is for platforms which don't collect ffdc.\n");
+ print(
+ "Usage: parseErrorInfo.pl [--empty-ffdc-classes] [--use-variable-buffers] --output-dir=<output dir> <filename1> <filename2> ...\n"
+ );
+ print(" This perl script will parse HWP Error XML files and creates\n");
+ print(" the following files:\n");
+ print(" - hwp_return_codes.H. HwpReturnCode enumeration (HWP generated errors)\n");
+ print(" - hwp_error_info.H. Error information (used by FAPI_SET_HWP_ERROR\n");
+ print(" when a HWP generates an error)\n");
+ print(" - collect_reg_ffdc_regs.H. File containing registers used by collectRegFfdc() \n");
+ print(" - set_sbe_error.H. Macro to create an SBE error\n");
+ print(" The --empty-ffdc-classes option is for platforms which don't collect ffdc.\n");
exit(1);
}
@@ -116,7 +120,7 @@ my %errValuePresentHash;
#------------------------------------------------------------------------------
# Hashes containing ffdc names/enum-values
#------------------------------------------------------------------------------
-my %ffdcNameToValueHash = ();
+my %ffdcNameToValueHash = ();
my %ffdcValuePresentHash = ();
#------------------------------------------------------------------------------
@@ -125,14 +129,14 @@ my %ffdcValuePresentHash = ();
#------------------------------------------------------------------------------
sub addEntryToArray
{
- my ($arrayref, $entry ) = @_;
+ my ( $arrayref, $entry ) = @_;
my $match = 0;
my $index = 0;
foreach my $element (@$arrayref)
{
- if ($element eq $entry)
+ if ( $element eq $entry )
{
$match = 1;
last;
@@ -143,9 +147,9 @@ sub addEntryToArray
}
}
- if (!($match))
+ if ( !($match) )
{
- push(@$arrayref, $entry);
+ push( @$arrayref, $entry );
}
return $index;
@@ -162,10 +166,10 @@ sub setErrorEnumValue
#--------------------------------------------------------------------------
# Check that the error name is not a duplicate
#--------------------------------------------------------------------------
- if (exists($errNameToValueHash{$name}))
+ if ( exists( $errNameToValueHash{$name} ) )
{
# Two different errors with the same name!
- print ("fapiParseErrorInfo.pl ERROR. Duplicate error name ", $name, "\n");
+ print( "fapiParseErrorInfo.pl ERROR. Duplicate error name ", $name, "\n" );
exit(1);
}
@@ -179,15 +183,15 @@ sub setErrorEnumValue
# the creator of the error
#--------------------------------------------------------------------------
my $errHash128Bit = md5_hex($name);
- my $errHash24Bit = substr($errHash128Bit, 0, 6);
+ my $errHash24Bit = substr( $errHash128Bit, 0, 6 );
#--------------------------------------------------------------------------
# Check that the error enum-value is not a duplicate
#--------------------------------------------------------------------------
- if (exists($errValuePresentHash{$errHash24Bit}))
+ if ( exists( $errValuePresentHash{$errHash24Bit} ) )
{
# Two different errors generate the same hash-value!
- print ("fapiParseAttributeInfo.pl ERROR. Duplicate error hash value\n");
+ print("fapiParseAttributeInfo.pl ERROR. Duplicate error hash value\n");
exit(1);
}
@@ -195,7 +199,7 @@ sub setErrorEnumValue
# Update the hashes with the error name and ID
#--------------------------------------------------------------------------
$errValuePresentHash{$errHash24Bit} = 1;
- $errNameToValueHash{$name} = $errHash24Bit;
+ $errNameToValueHash{$name} = $errHash24Bit;
}
#------------------------------------------------------------------------------
@@ -209,10 +213,10 @@ sub setFfdcIdValue
#--------------------------------------------------------------------------
# Check that the FFDC name is not a duplicate
#--------------------------------------------------------------------------
- if (exists($ffdcNameToValueHash{$name}))
+ if ( exists( $ffdcNameToValueHash{$name} ) )
{
# Two different FFDCs with the same name!
- print ("fapiParseErrorInfo.pl ERROR. Duplicate FFDC name ", $name, "\n");
+ print( "fapiParseErrorInfo.pl ERROR. Duplicate FFDC name ", $name, "\n" );
exit(1);
}
@@ -221,15 +225,15 @@ sub setFfdcIdValue
# the FFDC name.
#--------------------------------------------------------------------------
my $ffdcHash128Bit = md5_hex($name);
- my $ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8);
+ my $ffdcHash32Bit = substr( $ffdcHash128Bit, 0, 8 );
#--------------------------------------------------------------------------
# Check that the error enum-value is not a duplicate
#--------------------------------------------------------------------------
- if (exists($ffdcValuePresentHash{$ffdcHash32Bit}))
+ if ( exists( $ffdcValuePresentHash{$ffdcHash32Bit} ) )
{
# Two different FFDCs generate the same hash-value!
- print ("fapiParseAttributeInfo.pl ERROR. Duplicate FFDC hash value\n");
+ print("fapiParseAttributeInfo.pl ERROR. Duplicate FFDC hash value\n");
exit(1);
}
@@ -237,7 +241,7 @@ sub setFfdcIdValue
# Update the hashes with the error name and ID
#--------------------------------------------------------------------------
$ffdcValuePresentHash{$ffdcHash32Bit} = 1;
- $ffdcNameToValueHash{$name} = $ffdcHash32Bit;
+ $ffdcNameToValueHash{$name} = $ffdcHash32Bit;
}
#------------------------------------------------------------------------------
@@ -245,140 +249,140 @@ sub setFfdcIdValue
#------------------------------------------------------------------------------
sub addFfdcMethod
{
- my $methods = shift;
- my $ffdc_uc = shift;
- my $class_name = shift;
- my $type = shift;
+ my $methods = shift;
+ my $ffdc_uc = shift;
+ my $class_name = shift;
+ my $type = shift;
my $objectNumber = shift;
- my $sbeTarget = shift;
+ my $sbeTarget = shift;
# Remove the leading *_
- $class_name = (split (/_/, $class_name, 2))[1];
+ $class_name = ( split( /_/, $class_name, 2 ) )[1];
# If we didn't get a type passed in, this element will get an ffdc_t pair.
- $type = $ffdc_type if ($type eq undef);
+ $type = $ffdc_type if ( $type eq undef );
# Mangle the uppercase name if needed
- $ffdc_uc = $mangle_names{$ffdc_uc} if ($mangle_names{$ffdc_uc} ne undef);
+ $ffdc_uc = $mangle_names{$ffdc_uc} if ( $mangle_names{$ffdc_uc} ne undef );
- my $key = $ffdc_uc.$type;
- my $key_target = $ffdc_uc.$target_ffdc_type;
- my $key_ffdc = $ffdc_uc.$ffdc_type;
+ my $key = $ffdc_uc . $type;
+ my $key_target = $ffdc_uc . $target_ffdc_type;
+ my $key_ffdc = $ffdc_uc . $ffdc_type;
# Check to see if this element already has been recorded with this
# type or a target type. Note the effect we're shooting for here is
# to define the member if it's not been defined before *or* it's
# changing from an ffdc_t to a target due to other information in the xml
- return if ($methods->{$key}{type} eq $type);
- return if ($methods->{$key_target}{type} eq $target_ffdc_type);
-
-
+ return if ( $methods->{$key}{type} eq $type );
+ return if ( $methods->{$key_target}{type} eq $target_ffdc_type );
# Just leave if this is a variable_buffer as we're not supporting that.
- return if (($type eq $variable_buffer_ffdc_type) && ($arg_use_variable_buffers eq undef));
+ return if ( ( $type eq $variable_buffer_ffdc_type ) && ( $arg_use_variable_buffers eq undef ) );
# Set the proper type, and clear out any previous members/methods if
# we're going from an ffdc_t to a target.
$methods->{$key}{type} = $type;
- delete $methods->{$key_ffdc} if ($type eq $target_ffdc_type);
-
+ delete $methods->{$key_ffdc} if ( $type eq $target_ffdc_type );
- my $method = "";
+ my $method = "";
my $method_body = "";
# If we're generating empty classes, not using an argument name will avoid the unused parameter warnings
- my $param = ($arg_empty_ffdc eq undef) ? "i_value" : "";
+ my $param = ( $arg_empty_ffdc eq undef ) ? "i_value" : "";
- if ($type eq $ffdc_type)
+ if ( $type eq $ffdc_type )
{
- $method = " template< typename T >\n";
- $method .= " inline $class_name& set_$ffdc_uc(const T& $param)\n";
+ $method = " template< typename T >\n";
+ $method .= " inline $class_name& set_$ffdc_uc(const T& $param)\n";
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
- $method_body = " {\n $ffdc_uc.ptr() = &i_value;\n $ffdc_uc.size() =";
- $method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n return *this;\n }\n\n";
- $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
+ $method_body = " {\n $ffdc_uc.ptr() = &i_value;\n $ffdc_uc.size() =";
+ $method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n return *this;\n }\n\n";
+ $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
$methods->{$objectNumber}{localvar} = "$ffdc_type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
else
{
- # need to use the objectNumber here so when we decode the info at the hwsv/hb side we have a reference,
- # they will be copied into/out of the sbe buffer in the correct order
- $method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
- $method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
- $method_body .=" fapi2::getErrorInfoFfdcSize(i_value);\n";
- $method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
- $method_body .= " return *this;\n };\n\n";
- }
+ # need to use the objectNumber here so when we decode the info at the hwsv/hb side we have a reference,
+ # they will be copied into/out of the sbe buffer in the correct order
+ $method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
+ $method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
+ $method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n";
+ $method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
+ $method_body .= " return *this;\n };\n\n";
+ }
}
- elsif ($type eq $buffer_ffdc_type)
+ elsif ( $type eq $buffer_ffdc_type )
{
# Two methods - one for integral buffers and one for variable_buffers
- $method = "\n template< typename T >\n";
- $method .= " inline $class_name& set_$ffdc_uc(const fapi2::buffer<T>& $param)\n";
- $method_body =" {\n $ffdc_uc.ptr() = &i_value(); $ffdc_uc.size() = i_value.template getLength<uint8_t>(); return *this;}\n\n";
- $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
+ $method = "\n template< typename T >\n";
+ $method .= " inline $class_name& set_$ffdc_uc(const fapi2::buffer<T>& $param)\n";
+ $method_body =
+ " {\n $ffdc_uc.ptr() = &i_value(); $ffdc_uc.size() = i_value.template getLength<uint8_t>(); return *this;}\n\n";
+ $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
$methods->{$objectNumber}{localvar} = "$buffer_ffdc_type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
- elsif ($type eq $variable_buffer_ffdc_type)
+ elsif ( $type eq $variable_buffer_ffdc_type )
{
- $method = "\n inline $class_name& set_$ffdc_uc(const fapi2::variable_buffer& $param)\n";
- $method_body = " {$ffdc_uc.ptr() = &$param(); $ffdc_uc.size() = $param.template getLength<uint8_t>(); return *this;}\n\n";
+ $method = "\n inline $class_name& set_$ffdc_uc(const fapi2::variable_buffer& $param)\n";
+ $method_body =
+ " {$ffdc_uc.ptr() = &$param(); $ffdc_uc.size() = $param.template getLength<uint8_t>(); return *this;}\n\n";
# No need to add the member here, it was added with fapi2::buffer. And we can't have variable
# buffer support with out integral buffer support (can we?)
}
- elsif ($type eq $target_ffdc_type)
+ elsif ( $type eq $target_ffdc_type )
{
- $method = "\n template< TargetType T >\n";
- $method .= " inline $class_name& set_$ffdc_uc(const $type& $param)\n";
+ $method = "\n template< TargetType T >\n";
+ $method .= " inline $class_name& set_$ffdc_uc(const $type& $param)\n";
- if( $sbeTarget == 1 )
+ if ( $sbeTarget == 1 )
{
$method_body = " {\n /* empty method */\n return *this;\n }\n\n";
}
else
{
- $method_body .= " {\n $ffdc_uc.ptr() = &$param;\n $ffdc_uc.size() " .
- "= fapi2::getErrorInfoFfdcSize($param);\n" .
- " return *this;\n }\n\n";
+ $method_body .=
+ " {\n $ffdc_uc.ptr() = &$param;\n $ffdc_uc.size() "
+ . "= fapi2::getErrorInfoFfdcSize($param);\n"
+ . " return *this;\n }\n\n";
}
- $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
- $methods->{$objectNumber}{localvar} = "$ffdc_type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
+ $methods->{$key}{member} = "$ffdc_type $ffdc_uc;";
+ $methods->{$objectNumber}{localvar} = "$ffdc_type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc=$ffdc_uc;";
}
else
{
- $method .= " inline $class_name& set_$ffdc_uc($type $param)\n";
+ $method .= " inline $class_name& set_$ffdc_uc($type $param)\n";
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
- $method_body = " { $ffdc_uc = i_value; ";
- $method_body .= " return *this;}\n\n";
- $methods->{$key}{member} = "$type $ffdc_uc;";
- $methods->{$objectNumber}{localvar} = "$type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
+ $method_body = " { $ffdc_uc = i_value; ";
+ $method_body .= " return *this;}\n\n";
+ $methods->{$key}{member} = "$type $ffdc_uc;";
+ $methods->{$objectNumber}{localvar} = "$type $ffdc_uc = getFfdcData(FFDC_BUFFER[$objectNumber]);";
$methods->{$objectNumber}{assignment_string} = "l_obj.$ffdc_uc = $ffdc_uc;";
}
else
{
- # need to use the objectNumber here so when we decode the info at the hwsv/hb side we have a point of
- # reference and they will be copied into/out of the sbe buffer in the correct order
- $method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
- $method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
- $method_body .=" fapi2::getErrorInfoFfdcSize(i_value);\n";
- $method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
- $method_body .= " return *this;\n };\n\n";
- }
+ # need to use the objectNumber here so when we decode the info at the hwsv/hb side we have a point of
+ # reference and they will be copied into/out of the sbe buffer in the correct order
+ $method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
+ $method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
+ $method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n";
+ $method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
+ $method_body .= " return *this;\n };\n\n";
+ }
}
- $method .= ($arg_empty_ffdc eq undef) ? $method_body : " {return *this;}\n\n";
+ $method .= ( $arg_empty_ffdc eq undef ) ? $method_body : " {return *this;}\n\n";
$methods->{$key}{method} = $method;
}
@@ -388,27 +392,27 @@ sub addFfdcMethod
my $rcFile = $arg_output_dir;
$rcFile .= "/";
$rcFile .= "hwp_return_codes.H";
-open(RCFILE, ">", $rcFile);
+open( RCFILE, ">", $rcFile );
my $eiFile = $arg_output_dir;
$eiFile .= "/";
$eiFile .= "hwp_error_info.H";
-open(EIFILE, ">", $eiFile);
+open( EIFILE, ">", $eiFile );
my $ecFile = $arg_output_dir;
$ecFile .= "/";
$ecFile .= "hwp_ffdc_classes.H";
-open(ECFILE, ">", $ecFile);
+open( ECFILE, ">", $ecFile );
my $crFile = $arg_output_dir;
$crFile .= "/";
$crFile .= "collect_reg_ffdc_regs.C";
-open(CRFILE, ">", $crFile);
+open( CRFILE, ">", $crFile );
my $sbFile = $arg_output_dir;
$sbFile .= "/";
$sbFile .= "set_sbe_error.H";
-open(SBFILE, ">", $sbFile);
+open( SBFILE, ">", $sbFile );
#------------------------------------------------------------------------------
# Print start of file information to hwp_error_info.H
@@ -425,6 +429,7 @@ print EIFILE "#include <set_sbe_error.H>\n";
print EIFILE "/**\n";
print EIFILE " * \@brief Error Information macros and HwpFfdcId enumeration\n";
print EIFILE " *\/\n";
+
#------------------------------------------------------------------------------
# Print start of file information to hwp_ffdc_classes.H
#------------------------------------------------------------------------------
@@ -436,7 +441,7 @@ print ECFILE "#include <return_code.H>\n";
print ECFILE "#include <fapi2_hwp_executor.H>\n";
print ECFILE "#include <error_info.H>\n";
print ECFILE "#include <buffer.H>\n";
-print ECFILE "#include <variable_buffer.H>\n" if ($arg_use_variable_buffers ne undef);
+print ECFILE "#include <variable_buffer.H>\n" if ( $arg_use_variable_buffers ne undef );
print ECFILE "#include <hwp_error_info.H>\n";
print ECFILE "#if !defined(FAPI2_NO_FFDC) && !defined(MINIMUM_FFDC)\n";
print ECFILE "#include <ffdc_includes.H>\n";
@@ -446,10 +451,12 @@ print ECFILE "/**\n";
print ECFILE " * \@brief FFDC gathering classes\n";
print ECFILE " *\/\n";
print ECFILE "namespace fapi2\n{\n";
-if($arg_local_ffdc)
+
+if ($arg_local_ffdc)
{
print ECFILE "extern SbeFfdcData_t g_FfdcData; \n";
}
+
#------------------------------------------------------------------------------
# Print start of file information to collect_reg_ffdc_regs.C
#------------------------------------------------------------------------------
@@ -465,6 +472,7 @@ print CRFILE "#include <p9_obus_scom_addresses.H>\n";
print CRFILE "#include <p9_perv_scom_addresses.H>\n";
print CRFILE "#include <p9_quad_scom_addresses.H>\n";
print CRFILE "#include <p9_xbus_scom_addresses.H>\n";
+print CRFILE "#include <cen_gen_scom_addresses.H>\n";
print CRFILE "namespace fapi2\n";
print CRFILE "{\n";
print CRFILE "void getAddressData(const fapi2::HwpFfdcId i_ffdcId,\n";
@@ -474,11 +482,13 @@ print CRFILE " uint32_t & o_ffdcSize )\n";
print CRFILE "{\n";
print CRFILE " FAPI_INF(\"getAddresses. FFDC ID: 0x%x\", i_ffdcId);\n";
print CRFILE " o_ffdcSize = 0;\n\n";
-if($arg_local_ffdc eq undef )
+
+if ( $arg_local_ffdc eq undef )
{
print CRFILE " switch (i_ffdcId)\n";
print CRFILE " {\n";
}
+
#------------------------------------------------------------------------------
# Print start of file information to setSbeError.H
#------------------------------------------------------------------------------
@@ -512,66 +522,68 @@ print SBFILE "{\\\n";
print SBFILE "switch (ERRVAL)\\\n";
print SBFILE "{\\\n";
-
#------------------------------------------------------------------------------
# For each XML file
#------------------------------------------------------------------------------
-foreach my $argnum (0 .. $#ARGV)
+foreach my $argnum ( 0 .. $#ARGV )
{
my $infile = $ARGV[$argnum];
- my $count = 0;
+ my $count = 0;
#--------------------------------------------------------------------------
# Read XML file. The ForceArray option ensures that there is an array of
# elements even if there is only one element
#--------------------------------------------------------------------------
- my $errors = $xml->XMLin($infile, ForceArray =>
- ['hwpErrors','hwpError', 'collectFfdc', 'ffdc','mcastId', 'callout', 'deconfigure', 'gard',
- 'registerFfdc', 'collectRegisterFfdc', 'cfamRegister', 'scomRegister',
- 'id','collectTrace', 'buffer']);
+ my $errors = $xml->XMLin(
+ $infile,
+ ForceArray => [
+ 'hwpErrors', 'hwpError', 'collectFfdc', 'ffdc',
+ 'mcastId', 'callout', 'deconfigure', 'gard',
+ 'registerFfdc', 'collectRegisterFfdc', 'cfamRegister', 'scomRegister',
+ 'id', 'collectTrace', 'buffer'
+ ]
+ );
# Uncomment to get debug output of all errors
#print "\nFile: ", $infile, "\n", Dumper($errors), "\n";
-
-
#--------------------------------------------------------------------------
# For each Error
#--------------------------------------------------------------------------
- foreach my $err (@{$errors->{hwpError}})
+ foreach my $err ( @{ $errors->{hwpError} } )
{
- my $objectStr = undef;
- my $eiObjectStr = " const void * l_objects[] = {";
+ my $objectStr = undef;
+ my $eiObjectStr = " const void * l_objects[] = {";
my $eiEntryCount = 0;
- my $eiEntryStr = undef;
- my $eiObjectMap = undef; #object names to buffer address mapping
- my $executeStr = undef;
+ my $eiEntryStr = undef;
+ my $eiObjectMap = undef; #object names to buffer address mapping
+ my $executeStr = undef;
# Hash of methods for the ffdc-gathering class
my %methods;
# Array of EI Objects
- @eiObjects = ();
+ @eiObjects = ();
#----------------------------------------------------------------------
# Check that expected fields are present
#----------------------------------------------------------------------
- if (! exists $err->{rc})
+ if ( !exists $err->{rc} )
{
- print ("parseErrorInfo.pl ERROR. rc missing\n");
+ print("parseErrorInfo.pl ERROR. rc missing\n");
exit(1);
}
- if (! exists $err->{description})
+ if ( !exists $err->{description} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. description missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. description missing\n");
exit(1);
}
#----------------------------------------------------------------------
# Check that this rc hasn't been deprecated
#----------------------------------------------------------------------
- if ($deprecated{$err->{rc}} ne undef)
+ if ( $deprecated{ $err->{rc} } ne undef )
{
print "WARNING: $err->{rc} has been deprecated because $deprecated{$err->{rc}}\n";
next;
@@ -580,23 +592,22 @@ foreach my $argnum (0 .. $#ARGV)
#----------------------------------------------------------------------
# Set the error enum value in a global hash
#---------------------------------------------------------------------
- setErrorEnumValue($err->{rc});
+ setErrorEnumValue( $err->{rc} );
#----------------------------------------------------------------------
# if there is an sbeTarget, we will add a method for it regardless
#---------------------------------------------------------------------
- if( (exists $errors->{sbeTarget} ) && $arg_local_ffdc)
- {
- addFfdcMethod(\%methods, $errors->{sbeTarget}, $err->{rc},$target_ffdc_type,0,1);
- }
-
+ if ( ( exists $errors->{sbeTarget} ) && $arg_local_ffdc )
+ {
+ addFfdcMethod( \%methods, $errors->{sbeTarget}, $err->{rc}, $target_ffdc_type, 0, 1 );
+ }
- #----------------------------------------------------------------------
- # Process the ffdc tags first -
- #----------------------------------------------------------------------
+ #----------------------------------------------------------------------
+ # Process the ffdc tags first -
+ #----------------------------------------------------------------------
# Local FFDC
- foreach my $ffdc (@{$err->{ffdc}})
+ foreach my $ffdc ( @{ $err->{ffdc} } )
{
# Set the FFDC ID value in a global hash. The name is <rc>_<ffdc>
@@ -605,12 +616,12 @@ foreach my $argnum (0 .. $#ARGV)
setFfdcIdValue($ffdcName);
# Add the FFDC data to the EI Object array if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $ffdc);
+ my $objNum = addEntryToArray( \@eiObjects, $ffdc );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, $ffdc, $err->{rc},$ffdc_type,$objNum);
+ addFfdcMethod( \%methods, $ffdc, $err->{rc}, $ffdc_type, $objNum );
- $ffdc = $mangle_names{$ffdc} if ($mangle_names{$ffdc} ne undef);
+ $ffdc = $mangle_names{$ffdc} if ( $mangle_names{$ffdc} ne undef );
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_FFDC; \\\n";
@@ -618,8 +629,7 @@ foreach my $argnum (0 .. $#ARGV)
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcId = fapi2::$ffdcName; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcSize = $ffdc.size(); \\\n";
$eiEntryCount++;
- } #end foreach $ffdc
-
+ } #end foreach $ffdc
#----------------------------------------------------------------------
# Print the CALL_FUNCS_TO_COLLECT_FFDC macro to hwp_error_info.H
@@ -628,13 +638,13 @@ foreach my $argnum (0 .. $#ARGV)
my $collectFfdcStr = undef;
$count = 0;
- foreach my $collectFfdc (@{$err->{collectFfdc}})
+ foreach my $collectFfdc ( @{ $err->{collectFfdc} } )
{
- if ($count == 0)
+ if ( $count == 0 )
{
#this rc wont be used, except to indicate the FFDC collection failed
- $collectFfdcStr = "\tfapi2::ReturnCode l_rc; \\\n";
- $collectFfdcStr .= "\tfapi2::ReturnCode tempRc = RC; \\\n";
+ $collectFfdcStr = "\tfapi2::ReturnCode l_rc; \\\n";
+ $collectFfdcStr .= "\tfapi2::ReturnCode tempRc = RC; \\\n";
}
$count++;
@@ -642,35 +652,37 @@ foreach my $argnum (0 .. $#ARGV)
# but we need to create the arguments in the ffdc class. The first
# element in the collectFfdc string is the function to call.
my @elements = split /,/, $collectFfdc;
-# my @signature = @{$signatures{@elements[0]}};
+
+ # my @signature = @{$signatures{@elements[0]}};
# build up the function call here
@elements[0] =~ s/^\s+|\s+$//g;
- $collectFfdc = "@elements[0]";
- for (my $i = 1; $i <= $#elements; $i++)
+ $collectFfdc = "@elements[0]";
+ for ( my $i = 1; $i <= $#elements; $i++ )
{
$collectFfdc .= ",";
# the parameters will be in the l_objects, unused, but need to be
# counted for the SBE implementation
- my $parameter = "static_cast<void*>(&"."@elements[$i])";
+ my $parameter = "static_cast<void*>(&" . "@elements[$i])";
# Add the parameter to the object list if it doesn't already exist
#
- my $objNum = addEntryToArray(\@eiObjects, $parameter);
+ my $objNum = addEntryToArray( \@eiObjects, $parameter );
# add a set method for each parameter too..
@elements[$i] =~ s/^\s+|\s+$//g;
- addFfdcMethod(\%methods, @elements[$i], $err->{rc}, $ffdc_type ,$objNum);
+ addFfdcMethod( \%methods, @elements[$i], $err->{rc}, $ffdc_type, $objNum );
- $collectFfdc .= "@elements[$i]"
+ $collectFfdc .= "@elements[$i]"
}
- if( $#elements )
+ if ($#elements)
{
$collectFfdc .= ",";
}
+
# FAPI_EXEC_HWP has been modified to clear out fapi2::current_err
# this was done to resolve the issue of many hardware procedures
# not initializing current_err and thus returning random failures.
@@ -680,7 +692,7 @@ foreach my $argnum (0 .. $#ARGV)
# by the ffdc procedure can then be added to the local variable,
# this local will then be assigned back to the passed in RC
# at the end.
- $collectFfdc .= "tempRc";
+ $collectFfdc .= "tempRc";
$collectFfdcStr .= "\tFAPI_EXEC_HWP(l_rc, $collectFfdc); \\\n";
@@ -689,7 +701,7 @@ foreach my $argnum (0 .. $#ARGV)
print EIFILE "\\\n{ \\\n$collectFfdcStr \\\n}";
- } #end collectFfdc tag
+ } #end collectFfdc tag
print EIFILE "\n";
@@ -700,29 +712,28 @@ foreach my $argnum (0 .. $#ARGV)
my $crffdcStr = undef;
- my $crffdcCount =0;
+ my $crffdcCount = 0;
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
- foreach my $collectRegisterFfdc (@{$err->{collectRegisterFfdc}})
+ foreach my $collectRegisterFfdc ( @{ $err->{collectRegisterFfdc} } )
{
#------------------------------------------------------------------
# Check that expected fields are present
#------------------------------------------------------------------
- if (! exists $collectRegisterFfdc->{id}[0])
+ if ( !exists $collectRegisterFfdc->{id}[0] )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. id(s) missing from collectRegisterFfdc $infile\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. id(s) missing from collectRegisterFfdc $infile\n");
exit(1);
}
-
- foreach my $id (@{$collectRegisterFfdc->{id}})
+ foreach my $id ( @{ $collectRegisterFfdc->{id} } )
{
- if( $crffdcCount eq 0 )
+ if ( $crffdcCount eq 0 )
{
print EIFILE " \\\n{ \\\n";
- $crffdcStr = " std::vector<std::shared_ptr<ErrorInfoFfdc>> ffdc; \\\n";
+ $crffdcStr = " std::vector<std::shared_ptr<ErrorInfoFfdc>> ffdc; \\\n";
}
else
{
@@ -730,97 +741,109 @@ foreach my $argnum (0 .. $#ARGV)
}
$crffdcCount++;
+
#---------------------------------------------------------------------------------
# Check FFDC register collection type: target, child, or based on present children
#---------------------------------------------------------------------------------
- if (exists $collectRegisterFfdc->{target})
+ if ( exists $collectRegisterFfdc->{target} )
{
- if(!(exists $collectRegisterFfdc->{targetType} ))
+ if ( !( exists $collectRegisterFfdc->{targetType} ) )
{
- print ("parseErrorInfo.pl ERROR: target type missing from $collectRegisterFfdc->{target} in file $infile\n");
- exit(1);
+ print(
+ "parseErrorInfo.pl ERROR: target type missing from $collectRegisterFfdc->{target} in file $infile\n"
+ );
+ exit(1);
}
- $crffdcStr .= " fapi2::collectRegFfdc<$collectRegisterFfdc->{targetType}>($collectRegisterFfdc->{target},";
- $crffdcStr .= "fapi2::$id,ffdc); \\\n";
+ $crffdcStr .=
+ " fapi2::collectRegFfdc<$collectRegisterFfdc->{targetType}>($collectRegisterFfdc->{target},";
+ $crffdcStr .= "fapi2::$id,ffdc); \\\n";
- addFfdcMethod(\%methods, $collectRegisterFfdc->{target},
- $err->{rc}, $target_ffdc_type);
+ addFfdcMethod( \%methods, $collectRegisterFfdc->{target}, $err->{rc}, $target_ffdc_type );
}
- elsif (exists $collectRegisterFfdc->{childTargets})
+ elsif ( exists $collectRegisterFfdc->{childTargets} )
{
- if(!(exists $collectRegisterFfdc->{childTargets}{parent} ))
+ if ( !( exists $collectRegisterFfdc->{childTargets}{parent} ) )
{
- print ("parseErrorInfo.pl ERROR: parent missing from $collectRegisterFfdc->{id} in $infile\n");
+ print(
+ "parseErrorInfo.pl ERROR: parent missing from $collectRegisterFfdc->{id} in $infile\n"
+ );
exit(1);
}
- if(!(exists $collectRegisterFfdc->{childTargets}{parentType} ))
+ if ( !( exists $collectRegisterFfdc->{childTargets}{parentType} ) )
{
- print ("parseErrorInfo.pl ERROR: parent type missing from $collectRegisterFfdc->{id} in $infile\n");
+ print(
+ "parseErrorInfo.pl ERROR: parent type missing from $collectRegisterFfdc->{id} in $infile\n"
+ );
exit(1);
}
- $crffdcStr .= " fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{childTargets}->{childType},";
+ $crffdcStr .=
+ " fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{childTargets}->{childType},";
$crffdcStr .= "$collectRegisterFfdc->{childTargets}->{parentType}>";
$crffdcStr .= "($collectRegisterFfdc->{childTargets}->{parent}, ";
$crffdcStr .= "fapi2::TARGET_STATE_FUNCTIONAL,fapi2::$id, ffdc); \\\n";
- addFfdcMethod(\%methods, $collectRegisterFfdc->{childTargets}->{parent},
- $err->{rc}, $target_ffdc_type);
+ addFfdcMethod( \%methods, $collectRegisterFfdc->{childTargets}->{parent},
+ $err->{rc}, $target_ffdc_type );
}
- elsif (exists $collectRegisterFfdc->{basedOnPresentChildren})
+ elsif ( exists $collectRegisterFfdc->{basedOnPresentChildren} )
{
- if ( exists $collectRegisterFfdc->{basedOnPresentChildren}->{target})
+ if ( exists $collectRegisterFfdc->{basedOnPresentChildren}->{target} )
{
- if (! exists $collectRegisterFfdc->{basedOnPresentChildren}->{childType})
+ if ( !exists $collectRegisterFfdc->{basedOnPresentChildren}->{childType} )
{
- die ("parseErrorInfo.pl ERROR: childType missing from collectRegisterFfdc $infile\n");
+ die("parseErrorInfo.pl ERROR: childType missing from collectRegisterFfdc $infile\n");
exit(1);
}
- if(!(exists $collectRegisterFfdc->{basedOnPresentChildren}{targetType} ))
+ if ( !( exists $collectRegisterFfdc->{basedOnPresentChildren}{targetType} ) )
{
- print ("parseErrorInfo.pl ERROR: type missing from ");
- print ("$collectRegisterFfdc->{basedOnPresentChildren}{parent} in file $infile\n");
+ print("parseErrorInfo.pl ERROR: type missing from ");
+ print("$collectRegisterFfdc->{basedOnPresentChildren}{parent} in file $infile\n");
exit(1);
}
- if (! exists $collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier})
+ if ( !exists $collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier} )
{
- print ("parseErrorInfo.pl ERROR: childPosOffsetMultiplier missing from collectRegisterFfdc $infile\n");
+ print(
+ "parseErrorInfo.pl ERROR: childPosOffsetMultiplier missing from collectRegisterFfdc $infile\n"
+ );
exit(1);
}
- $crffdcStr .= " fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{basedOnPresentChildren}->{childType},";
+ $crffdcStr .=
+ " fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{basedOnPresentChildren}->{childType},";
$crffdcStr .= "$collectRegisterFfdc->{basedOnPresentChildren}->{targetType}>";
$crffdcStr .= "($collectRegisterFfdc->{basedOnPresentChildren}->{target},";
$crffdcStr .= "fapi2::TARGET_STATE_PRESENT,";
$crffdcStr .= "fapi2::$id, ffdc,";
- $crffdcStr .= "$collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier});\\\n";
+ $crffdcStr .=
+ "$collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier});\\\n";
$crffdcCount++;
- addFfdcMethod(\%methods, $collectRegisterFfdc->{basedOnPresentChildren}->{target},
- $err->{rc}, $target_ffdc_type);
+ addFfdcMethod( \%methods, $collectRegisterFfdc->{basedOnPresentChildren}->{target},
+ $err->{rc}, $target_ffdc_type );
}
else
{
- print ("parseErrorInfo.pl ERROR: Invalid collectRegisterFfdc configuration in $infile\n");
+ print("parseErrorInfo.pl ERROR: Invalid collectRegisterFfdc configuration in $infile\n");
exit(1);
}
}
else
{
- print ("parseErrorInfo.pl ERROR: Invalid collectRegisterFfdc configuration in $infile\n");
+ print("parseErrorInfo.pl ERROR: Invalid collectRegisterFfdc configuration in $infile\n");
exit(1);
}
#print the collectRegFfdc string to the info file
print EIFILE "$crffdcStr";
- } #end foreach register id
+ } #end foreach register id
- } # end foreach collectRegisterFfdc
+ } # end foreach collectRegisterFfdc
- if($crffdcCount > 0)
+ if ( $crffdcCount > 0 )
{
print EIFILE " RC.addErrorInfo(ffdc); \\\n}\n";
}
@@ -833,22 +856,23 @@ foreach my $argnum (0 .. $#ARGV)
#----------------------------------------------------------------------
print EIFILE "#define $err->{rc}_ADD_ERROR_INFO(RC)";
- my %cdgTargetHash; # Records the callout/deconfigure/gards for Targets
- my %cdgChildHash; # Records the callout/deconfigure/gards for Children
+ my %cdgTargetHash; # Records the callout/deconfigure/gards for Targets
+ my %cdgChildHash; # Records the callout/deconfigure/gards for Children
# collect firmware trace
- foreach my $collectTrace (@{$err->{collectTrace}})
+ foreach my $collectTrace ( @{ $err->{collectTrace} } )
{
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_COLLECT_TRACE; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].collect_trace.iv_eieTraceId = fapi2::CollectTraces::$collectTrace; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].collect_trace.iv_eieTraceId = fapi2::CollectTraces::$collectTrace; \\\n";
$eiEntryCount++;
- } #end foreach $collectTrace
+ } #end foreach $collectTrace
# plaform (currently only SBE) PCB-PIB error defined in xml file,
# we will always add the set_address and set_pcb_pib_rc methods
# for this error type
- if(exists $err->{platScomFail})
+ if ( exists $err->{platScomFail} )
{
# Set the FFDC ID value in a global hash. The name is <rc>_pib_error
my $ffdcName = $err->{rc} . "_";
@@ -856,10 +880,10 @@ foreach my $argnum (0 .. $#ARGV)
setFfdcIdValue($ffdcName);
# Add the address to the EI Object array if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, "address");
+ my $objNum = addEntryToArray( \@eiObjects, "address" );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, "address", $err->{rc},$ffdc_type,$objNum);
+ addFfdcMethod( \%methods, "address", $err->{rc}, $ffdc_type, $objNum );
# Add an EI entry to eiEntryStr
$eiEntryStr .= "\tl_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_FFDC; \\\n";
@@ -874,10 +898,10 @@ foreach my $argnum (0 .. $#ARGV)
setFfdcIdValue($ffdcName);
# Add the pibError to the EI Object array if it doesn't already exist
- $objNum = addEntryToArray(\@eiObjects, "pcb_pib_rc");
+ $objNum = addEntryToArray( \@eiObjects, "pcb_pib_rc" );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, "pcb_pib_rc", $err->{rc},$ffdc_type,$objNum);
+ addFfdcMethod( \%methods, "pcb_pib_rc", $err->{rc}, $ffdc_type, $objNum );
# Add an EI entry to eiEntryStr
$eiEntryStr .= "\tl_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_FFDC; \\\n";
@@ -885,10 +909,10 @@ foreach my $argnum (0 .. $#ARGV)
$eiEntryStr .= "\tl_entries[$eiEntryCount].ffdc.iv_ffdcId = fapi2::$ffdcName; \\\n";
$eiEntryStr .= "\tl_entries[$eiEntryCount].ffdc.iv_ffdcSize = 8; \\\n";
$eiEntryCount++;
- } #end foreach $ffdc
+ } #end foreach $ffdc
# Multicast ID
- foreach my $mcast (@{$err->{mcastId}})
+ foreach my $mcast ( @{ $err->{mcastId} } )
{
# Set the FFDC ID value in a global hash. The name is <rc>_<ffdc>
my $ffdcName = $err->{rc} . "_";
@@ -896,12 +920,12 @@ foreach my $argnum (0 .. $#ARGV)
setFfdcIdValue($ffdcName);
# Add the FFDC data to the EI Object array if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $mcast);
+ my $objNum = addEntryToArray( \@eiObjects, $mcast );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, $mcast, $err->{rc},$mcast_type,$objNum);
+ addFfdcMethod( \%methods, $mcast, $err->{rc}, $mcast_type, $objNum );
- $mcast = $mangle_names{$mcast} if ($mangle_names{$mcast} ne undef);
+ $mcast = $mangle_names{$mcast} if ( $mangle_names{$mcast} ne undef );
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_FFDC; \\\n";
@@ -909,12 +933,12 @@ foreach my $argnum (0 .. $#ARGV)
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcId = fapi2::$ffdcName; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcSize = 4; \\\n";
$eiEntryCount++;
- } #foreach mcastId
+ } #foreach mcastId
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
# Buffers, looks a lot like local ffdc
- foreach my $buffer (@{$err->{buffer}})
+ foreach my $buffer ( @{ $err->{buffer} } )
{
# Set the FFDC ID value in a global hash. The name is <rc>_<ffdc>
my $bufferName = $err->{rc} . "_";
@@ -922,64 +946,67 @@ foreach my $argnum (0 .. $#ARGV)
setFfdcIdValue($bufferName);
# Add the FFDC data to the EI Object array if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $buffer);
+ my $objNum = addEntryToArray( \@eiObjects, $buffer );
# Add a method to the ffdc-gathering class - one for each buffer type
- addFfdcMethod(\%methods, $buffer, $err->{rc}, $buffer_ffdc_type);
- addFfdcMethod(\%methods, $buffer, $err->{rc}, $variable_buffer_ffdc_type);
+ addFfdcMethod( \%methods, $buffer, $err->{rc}, $buffer_ffdc_type );
+ addFfdcMethod( \%methods, $buffer, $err->{rc}, $variable_buffer_ffdc_type );
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_FFDC; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcObjIndex = $objNum; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcId = fapi2::$bufferName; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].ffdc.iv_ffdcSize = fapi2::getErrorInfoFfdcSize($buffer); \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].ffdc.iv_ffdcSize = fapi2::getErrorInfoFfdcSize($buffer); \\\n";
$eiEntryCount++;
- } #foreach $buffer
+ } #foreach $buffer
# Procedure/Target/Bus/Child callouts
- foreach my $callout (@{$err->{callout}})
+ foreach my $callout ( @{ $err->{callout} } )
{
- if (! exists $callout->{priority})
+ if ( !exists $callout->{priority} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Callout priority missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Callout priority missing\n");
exit(1);
}
my $elementsFound = 0;
- if (exists $callout->{hw})
+ if ( exists $callout->{hw} )
{
# HW Callout
- if (! exists $callout->{hw}->{hwid})
+ if ( !exists $callout->{hw}->{hwid} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. HW Callout hwid missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. HW Callout hwid missing\n");
exit(1);
}
# Check that those HW callouts that need reference targets have them
- if (($callout->{hw}->{hwid} eq "TOD_CLOCK") ||
- ($callout->{hw}->{hwid} eq "MEM_REF_CLOCK") ||
- ($callout->{hw}->{hwid} eq "PROC_REF_CLOCK") ||
- ($callout->{hw}->{hwid} eq "PCI_REF_CLOCK"))
+ if ( ( $callout->{hw}->{hwid} eq "TOD_CLOCK" )
+ || ( $callout->{hw}->{hwid} eq "MEM_REF_CLOCK" )
+ || ( $callout->{hw}->{hwid} eq "PROC_REF_CLOCK" )
+ || ( $callout->{hw}->{hwid} eq "PCI_REF_CLOCK" ) )
{
- if (! exists $callout->{hw}->{refTarget})
+ if ( !exists $callout->{hw}->{refTarget} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Callout missing refTarget\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Callout missing refTarget\n");
exit(1);
}
}
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_HW_CALLOUT; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].hw_callout.iv_hw = fapi2::HwCallouts::$callout->{hw}->{hwid}; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].hw_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
- if (exists $callout->{hw}->{refTarget})
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].hw_callout.iv_hw = fapi2::HwCallouts::$callout->{hw}->{hwid}; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].hw_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
+ if ( exists $callout->{hw}->{refTarget} )
{
# Add the Targets to the objectlist if they don't already exist
- my $objNum = addEntryToArray(\@eiObjects, $callout->{hw}->{refTarget});
+ my $objNum = addEntryToArray( \@eiObjects, $callout->{hw}->{refTarget} );
$eiEntryStr .= " l_entries[$eiEntryCount].hw_callout.iv_refObjIndex = $objNum; \\\n";
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, $callout->{hw}->{refTarget}, $err->{rc},$target_ffdc_type,$objNum);
+ addFfdcMethod( \%methods, $callout->{hw}->{refTarget}, $err->{rc}, $target_ffdc_type, $objNum );
}
else
{
@@ -988,199 +1015,202 @@ foreach my $argnum (0 .. $#ARGV)
$eiEntryCount++;
$elementsFound++;
}
- if (exists $callout->{procedure})
+ if ( exists $callout->{procedure} )
{
# Procedure Callout
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_PROCEDURE_CALLOUT; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].proc_callout.iv_procedure = fapi2::ProcedureCallouts::$callout->{procedure}; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].proc_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].proc_callout.iv_procedure = fapi2::ProcedureCallouts::$callout->{procedure}; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].proc_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
$eiEntryCount++;
$elementsFound++;
}
- if (exists $callout->{bus})
+ if ( exists $callout->{bus} )
{
# A Bus Callout consists of two targets separated by
# commas/spaces
- my @targets = split(/\s*,\s*|\s+/, $callout->{bus});
+ my @targets = split( /\s*,\s*|\s+/, $callout->{bus} );
- if (scalar @targets != 2)
+ if ( scalar @targets != 2 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. did not find two targets in bus callout\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. did not find two targets in bus callout\n");
exit(1);
}
# Add the Targets to the objectlist if they don't already exist
- my $objNum1 = addEntryToArray(\@eiObjects, $targets[0]);
+ my $objNum1 = addEntryToArray( \@eiObjects, $targets[0] );
- my $objNum2 = addEntryToArray(\@eiObjects, $targets[1]);
+ my $objNum2 = addEntryToArray( \@eiObjects, $targets[1] );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, $targets[0], $err->{rc}, $target_ffdc_type,$objNum1);
- addFfdcMethod(\%methods, $targets[1], $err->{rc}, $target_ffdc_type,$objNum2);
+ addFfdcMethod( \%methods, $targets[0], $err->{rc}, $target_ffdc_type, $objNum1 );
+ addFfdcMethod( \%methods, $targets[1], $err->{rc}, $target_ffdc_type, $objNum2 );
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_BUS_CALLOUT; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_endpoint1ObjIndex = $objNum1; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_endpoint2ObjIndex = $objNum2; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].bus_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].bus_callout.iv_calloutPriority = fapi2::CalloutPriorities::$callout->{priority}; \\\n";
$eiEntryCount++;
$elementsFound++;
}
- if (exists $callout->{target})
+ if ( exists $callout->{target} )
{
# Add the Target to cdgTargetHash to be processed with any
# deconfigure and GARD requests
- $cdgTargetHash{$callout->{target}}{callout} = 1;
- $cdgTargetHash{$callout->{target}}{priority} =
- $callout->{priority};
+ $cdgTargetHash{ $callout->{target} }{callout} = 1;
+ $cdgTargetHash{ $callout->{target} }{priority} =
+ $callout->{priority};
$elementsFound++;
}
- if (exists $callout->{childTargets})
+ if ( exists $callout->{childTargets} )
{
# Check that the parent and childType subelements exist
- if (! exists $callout->{childTargets}->{parent})
+ if ( !exists $callout->{childTargets}->{parent} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child Callout parent missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child Callout parent missing\n");
exit(1);
}
- if (! exists $callout->{childTargets}->{childType})
+ if ( !exists $callout->{childTargets}->{childType} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child Callout childType missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child Callout childType missing\n");
exit(1);
}
# Add the child info to cdgChildHash to be processed with
# any deconfigure and GARD requests
- my $parent = $callout->{childTargets}->{parent};
+ my $parent = $callout->{childTargets}->{parent};
my $childType = $callout->{childTargets}->{childType};
$cdgChildHash{$parent}{$childType}{callout} = 1;
$cdgChildHash{$parent}{$childType}{priority} =
- $callout->{priority};
+ $callout->{priority};
$elementsFound++;
- if (exists $callout->{childTargets}->{childPort})
+ if ( exists $callout->{childTargets}->{childPort} )
{
my $childPort = $callout->{childTargets}->{childPort};
$cdgChildHash{$parent}{$childType}{childPort} = $childPort;
}
- if (exists $callout->{childTargets}->{childNumber})
+ if ( exists $callout->{childTargets}->{childNumber} )
{
my $childNum = $callout->{childTargets}->{childNumber};
$cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
}
}
- if ($elementsFound == 0)
+ if ( $elementsFound == 0 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Callout incomplete\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Callout incomplete\n");
exit(1);
}
- elsif ($elementsFound > 1)
+ elsif ( $elementsFound > 1 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Callout has multiple elements\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Callout has multiple elements\n");
exit(1);
}
- } # callout
+ } # callout
# Target/Child deconfigures
- foreach my $deconfigure (@{$err->{deconfigure}})
+ foreach my $deconfigure ( @{ $err->{deconfigure} } )
{
my $elementsFound = 0;
- if (exists $deconfigure->{target})
+ if ( exists $deconfigure->{target} )
{
# Add the Target to cdgTargetHash to be processed with any
# callout and GARD requests
- $cdgTargetHash{$deconfigure->{target}}{deconf} = 1;
+ $cdgTargetHash{ $deconfigure->{target} }{deconf} = 1;
$elementsFound++;
}
- if (exists $deconfigure->{childTargets})
+ if ( exists $deconfigure->{childTargets} )
{
# Check that the parent and childType subelements exist
- if (! exists $deconfigure->{childTargets}->{parent})
+ if ( !exists $deconfigure->{childTargets}->{parent} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child Deconfigure parent missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child Deconfigure parent missing\n");
exit(1);
}
- if (! exists $deconfigure->{childTargets}->{childType})
+ if ( !exists $deconfigure->{childTargets}->{childType} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child Deconfigure childType missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child Deconfigure childType missing\n");
exit(1);
}
# Add the child info to cdgChildHash to be processed with
# any callout and GARD requests
- my $parent = $deconfigure->{childTargets}->{parent};
+ my $parent = $deconfigure->{childTargets}->{parent};
my $childType = $deconfigure->{childTargets}->{childType};
$cdgChildHash{$parent}{$childType}{deconf} = 1;
$elementsFound++;
- if ( exists $deconfigure->{childTargets}->{childPort})
+ if ( exists $deconfigure->{childTargets}->{childPort} )
{
my $childPort = $deconfigure->{childTargets}->{childPort};
$cdgChildHash{$parent}{$childType}{childPort} = $childPort;
}
- if ( exists $deconfigure->{childTargets}->{childNumber})
+ if ( exists $deconfigure->{childTargets}->{childNumber} )
{
my $childNum = $deconfigure->{childTargets}->{childNumber};
$cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
}
}
- if ($elementsFound == 0)
+ if ( $elementsFound == 0 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Deconfigure incomplete\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Deconfigure incomplete\n");
exit(1);
}
- elsif ($elementsFound > 1)
+ elsif ( $elementsFound > 1 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Deconfigure has multiple elements\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Deconfigure has multiple elements\n");
exit(1);
}
- } # deconfigure
+ } # deconfigure
# Target/Child Gards
- foreach my $gard (@{$err->{gard}})
+ foreach my $gard ( @{ $err->{gard} } )
{
my $elementsFound = 0;
- if (exists $gard->{target})
+ if ( exists $gard->{target} )
{
# Add the Target to cdgTargetHash to be processed with any
# callout and deconfigure requests
- $cdgTargetHash{$gard->{target}}{gard} = 1;
+ $cdgTargetHash{ $gard->{target} }{gard} = 1;
$elementsFound++;
}
- if (exists $gard->{childTargets})
+ if ( exists $gard->{childTargets} )
{
# Check that the parent and childType subelements exist
- if (! exists $gard->{childTargets}->{parent})
+ if ( !exists $gard->{childTargets}->{parent} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child GARD parent missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child GARD parent missing\n");
exit(1);
}
- if (! exists $gard->{childTargets}->{childType})
+ if ( !exists $gard->{childTargets}->{childType} )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. Child GARD childType missing\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. Child GARD childType missing\n");
exit(1);
}
# Add the child info to cdgChildHash to be processed with
# any callout and deconfigure requests
- my $parent = $gard->{childTargets}->{parent};
+ my $parent = $gard->{childTargets}->{parent};
my $childType = $gard->{childTargets}->{childType};
$cdgChildHash{$parent}{$childType}{gard} = 1;
$elementsFound++;
- if ( exists $gard->{childTargets}->{childPort})
+ if ( exists $gard->{childTargets}->{childPort} )
{
my $childPort = $gard->{childTargets}->{childPort};
@@ -1188,54 +1218,54 @@ foreach my $argnum (0 .. $#ARGV)
}
- if ( exists $gard->{childTargets}->{childNumber})
+ if ( exists $gard->{childTargets}->{childNumber} )
{
my $childNum = $gard->{childTargets}->{childNumber};
$cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
}
}
- if ($elementsFound == 0)
+ if ( $elementsFound == 0 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. GARD incomplete\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. GARD incomplete\n");
exit(1);
}
- elsif ($elementsFound > 1)
+ elsif ( $elementsFound > 1 )
{
- print ("parseErrorInfo.pl ERROR in $err->{rc}. GARD has multiple elements\n");
+ print("parseErrorInfo.pl ERROR in $err->{rc}. GARD has multiple elements\n");
exit(1);
}
- } # gard
+ } # gard
# Process the callout, deconfigures and GARDs for each Target
- foreach my $cdg (keys %cdgTargetHash)
+ foreach my $cdg ( keys %cdgTargetHash )
{
- my $callout = 0;
+ my $callout = 0;
my $priority = 'LOW';
- my $deconf = 0;
- my $gard = 0;
+ my $deconf = 0;
+ my $gard = 0;
- if (exists $cdgTargetHash{$cdg}->{callout})
+ if ( exists $cdgTargetHash{$cdg}->{callout} )
{
$callout = 1;
}
- if (exists $cdgTargetHash{$cdg}->{priority})
+ if ( exists $cdgTargetHash{$cdg}->{priority} )
{
$priority = $cdgTargetHash{$cdg}->{priority};
}
- if (exists $cdgTargetHash{$cdg}->{deconf})
+ if ( exists $cdgTargetHash{$cdg}->{deconf} )
{
$deconf = 1;
}
- if (exists $cdgTargetHash{$cdg}->{gard})
+ if ( exists $cdgTargetHash{$cdg}->{gard} )
{
$gard = 1;
}
# Add the Target to the objectlist if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $cdg);
+ my $objNum = addEntryToArray( \@eiObjects, $cdg );
# Add a method to the ffdc-gathering class
- addFfdcMethod(\%methods, $cdg, $err->{rc}, $target_ffdc_type,$objNum);
+ addFfdcMethod( \%methods, $cdg, $err->{rc}, $target_ffdc_type, $objNum );
# Add an EI entry to eiEntryStr
$eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_CDG; \\\n";
@@ -1243,80 +1273,73 @@ foreach my $argnum (0 .. $#ARGV)
$eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_callout = $callout; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_deconfigure = $deconf; \\\n";
$eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_gard = $gard; \\\n";
- $eiEntryStr .= " l_entries[$eiEntryCount].target_cdg.iv_calloutPriority = fapi2::CalloutPriorities::$priority; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].target_cdg.iv_calloutPriority = fapi2::CalloutPriorities::$priority; \\\n";
$eiEntryCount++;
}
# Process the callout, deconfigures and GARDs for Child Targets
- foreach my $parent (keys %cdgChildHash)
+ foreach my $parent ( keys %cdgChildHash )
{
- foreach my $childType (keys %{$cdgChildHash{$parent}})
+ foreach my $childType ( keys %{ $cdgChildHash{$parent} } )
{
- my $callout = 0;
- my $priority = 'LOW';
- my $deconf = 0;
- my $gard = 0;
- my $childPort = 0xFF;
+ my $callout = 0;
+ my $priority = 'LOW';
+ my $deconf = 0;
+ my $gard = 0;
+ my $childPort = 0xFF;
my $childNumber = 0xFF;
- if (exists $cdgChildHash{$parent}{$childType}->{callout})
+ if ( exists $cdgChildHash{$parent}{$childType}->{callout} )
{
$callout = 1;
}
- if (exists $cdgChildHash{$parent}->{$childType}->{priority})
+ if ( exists $cdgChildHash{$parent}->{$childType}->{priority} )
{
$priority =
- $cdgChildHash{$parent}->{$childType}->{priority};
+ $cdgChildHash{$parent}->{$childType}->{priority};
}
- if (exists $cdgChildHash{$parent}->{$childType}->{deconf})
+ if ( exists $cdgChildHash{$parent}->{$childType}->{deconf} )
{
$deconf = 1;
}
- if (exists $cdgChildHash{$parent}->{$childType}->{childPort})
+ if ( exists $cdgChildHash{$parent}->{$childType}->{childPort} )
{
$childPort =
- $cdgChildHash{$parent}->{$childType}->{childPort} ;
- addFfdcMethod(\%methods, $childPort, $err->{rc});
+ $cdgChildHash{$parent}->{$childType}->{childPort};
+ addFfdcMethod( \%methods, $childPort, $err->{rc} );
}
- if (exists $cdgChildHash{$parent}->{$childType}->{childNumber})
+ if ( exists $cdgChildHash{$parent}->{$childType}->{childNumber} )
{
$childNumber =
- $cdgChildHash{$parent}->{$childType}->{childNumber} ;
- addFfdcMethod(\%methods, $childNumber, $err->{rc});
+ $cdgChildHash{$parent}->{$childType}->{childNumber};
+ addFfdcMethod( \%methods, $childNumber, $err->{rc} );
}
- if (exists $cdgChildHash{$parent}->{$childType}->{gard})
+ if ( exists $cdgChildHash{$parent}->{$childType}->{gard} )
{
$gard = 1;
}
-
# Add the Target to the objectlist if it doesn't already exist
- my $objNum = addEntryToArray(\@eiObjects, $parent);
- addFfdcMethod(\%methods, $parent, $err->{rc}, $target_ffdc_type,$objNum);
+ my $objNum = addEntryToArray( \@eiObjects, $parent );
+ addFfdcMethod( \%methods, $parent, $err->{rc}, $target_ffdc_type, $objNum );
# Add an EI entry to eiEntryStr
+ $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_CHILDREN_CDG; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_parentObjIndex = $objNum; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_callout = $callout; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_deconfigure = $deconf; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_childType = fapi2::$childType; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_childPort = $childPort; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_childNumber = $childNumber; \\\n";
+ $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_gard = $gard; \\\n";
$eiEntryStr .=
- " l_entries[$eiEntryCount].iv_type = fapi2::EI_TYPE_CHILDREN_CDG; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_parentObjIndex = $objNum; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_callout = $callout; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_deconfigure = $deconf; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_childType = fapi2::$childType; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_childPort = $childPort; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_childNumber = $childNumber; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_gard = $gard; \\\n";
- $eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_calloutPriority = fapi2::CalloutPriorities::$priority; \\\n";
+ " l_entries[$eiEntryCount].children_cdg.iv_calloutPriority = fapi2::CalloutPriorities::$priority; \\\n";
$eiEntryCount++;
}
}
}
+
# Add all objects to $eiObjectStr
my $objCount = 0;
@@ -1324,26 +1347,26 @@ foreach my $argnum (0 .. $#ARGV)
foreach my $eiObject (@eiObjects)
{
- if ($objCount > 0)
+ if ( $objCount > 0 )
{
$eiObjectStr .= ", ";
}
- if ($mangle_names{$eiObject} eq undef)
+ if ( $mangle_names{$eiObject} eq undef )
{
$eiObjectStr .= "$eiObject";
- if ((exists $err->{sbeError}) )
+ if ( ( exists $err->{sbeError} ) )
{
- if((exists $methods{$objCount}{object}))
+ if ( ( exists $methods{$objCount}{object} ) )
{
$objectStr .= " $methods{$objCount}{object} \\\n";
}
- if((exists $methods{$objCount}{localvar}))
+ if ( ( exists $methods{$objCount}{localvar} ) )
{
$objectStr .= " $methods{$objCount}{localvar} \\\n";
$objectStr .= " $methods{$objCount}{assignment_string} \\\n";
@@ -1363,19 +1386,19 @@ foreach my $argnum (0 .. $#ARGV)
# same target on multiple return codes. Typically the target used will be the
# proc target the SBE is running on so we will just need to get the instance from
# hwsv/hb and create a target in that context
- if( exists $errors->{sbeTarget} && ( $arg_local_ffdc eq undef) )
+ if ( exists $errors->{sbeTarget} && ( $arg_local_ffdc eq undef ) )
{
- $objectStr .= " fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>$errors->{sbeTarget}" .
- " = fapi2::getTarget<fapi2::TARGET_TYPE_PROC_CHIP>(SBE_INSTANCE); \\\n";
+ $objectStr .= " fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>$errors->{sbeTarget}"
+ . " = fapi2::getTarget<fapi2::TARGET_TYPE_PROC_CHIP>(SBE_INSTANCE); \\\n";
$objectStr .= " l_obj.$errors->{sbeTarget}.ptr() = &$errors->{sbeTarget}; \\\n";
- $objectStr .= " l_obj.$errors->{sbeTarget}.size() = fapi2::getErrorInfoFfdcSize($errors->{sbeTarget}); \\\n";
+ $objectStr .=
+ " l_obj.$errors->{sbeTarget}.size() = fapi2::getErrorInfoFfdcSize($errors->{sbeTarget}); \\\n";
}
$eiObjectStr .= "};";
-
# Print info to file
- if ($eiEntryCount > 0)
+ if ( $eiEntryCount > 0 )
{
print EIFILE " \\\n{ \\\n $eiObjectStr \\\n";
print EIFILE " fapi2::ErrorInfoEntry l_entries[$eiEntryCount]; \\\n";
@@ -1397,20 +1420,22 @@ foreach my $argnum (0 .. $#ARGV)
# Print the return code class to hwp_error_info.H
#----------------------------------------------------------------------
my $class_name = $err->{rc};
+
# Remove everything upto and including the first _. This makes the ffdc class
# names different from the error code value enum names.
- $class_name = (split (/_/, $class_name, 2))[1];
+ $class_name = ( split( /_/, $class_name, 2 ) )[1];
# Class declaration
print ECFILE "\nclass $class_name\n{\n public:\n";
# Constructor. This traces the description. If this is too much, we can
# remove it.
- if ($arg_empty_ffdc eq undef)
+ if ( $arg_empty_ffdc eq undef )
{
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
- print ECFILE " $class_name(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE, fapi2::ReturnCode& i_rc = fapi2::current_err):\n";
+ print ECFILE
+ " $class_name(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE, fapi2::ReturnCode& i_rc = fapi2::current_err):\n";
print ECFILE " iv_rc(i_rc),\n";
print ECFILE " iv_sev(i_sev)\n";
print ECFILE " { FAPI_ERR(\"$err->{description}\"); }\n\n";
@@ -1418,7 +1443,8 @@ foreach my $argnum (0 .. $#ARGV)
else
{
print ECFILE " $class_name()\n";
- print ECFILE " {\n fapi2::current_err = RC_$class_name;\n FAPI_ERR(\"$err->{description}\");\n";
+ print ECFILE
+ " {\n fapi2::current_err = RC_$class_name;\n FAPI_ERR(\"$err->{description}\");\n";
print ECFILE " fapi2::g_FfdcData.fapiRc = RC_$class_name;\n }\n\n";
}
}
@@ -1426,7 +1452,8 @@ foreach my $argnum (0 .. $#ARGV)
{
# Void expression keeps the compiler from complaining about the unused arguments.
# We want to set the i_rc to the RC if we're empty. This otherwise gets done in _setHwpError()
- print ECFILE " $class_name(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE, fapi2::ReturnCode& i_rc = fapi2::current_err)\n";
+ print ECFILE
+ " $class_name(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE, fapi2::ReturnCode& i_rc = fapi2::current_err)\n";
print ECFILE " {\n";
print ECFILE " static_cast<void>(i_sev);\n";
print ECFILE " i_rc = $err->{rc};\n";
@@ -1434,17 +1461,18 @@ foreach my $argnum (0 .. $#ARGV)
}
my $method_count = 0;
+
# Methods
- foreach my $key (keys %methods)
+ foreach my $key ( keys %methods )
{
print ECFILE $methods{$key}{method};
$method_count++;
}
- if($arg_local_ffdc eq undef)
+ if ( $arg_local_ffdc eq undef )
{
# add a method to adjust the severity if desired
print ECFILE " inline void setSev(const fapi2::errlSeverity_t i_sev)\n";
- if ($arg_empty_ffdc eq undef)
+ if ( $arg_empty_ffdc eq undef )
{
print ECFILE " {\n iv_sev = i_sev;\n };\n\n";
}
@@ -1455,7 +1483,7 @@ foreach my $argnum (0 .. $#ARGV)
# add a method to read the severity if desired
print ECFILE " inline fapi2::errlSeverity_t getSev() const\n";
- if ($arg_empty_ffdc eq undef)
+ if ( $arg_empty_ffdc eq undef )
{
print ECFILE " {\n return iv_sev;\n };\n\n";
}
@@ -1466,23 +1494,23 @@ foreach my $argnum (0 .. $#ARGV)
}
- if( $arg_local_ffdc eq undef )
+ if ( $arg_local_ffdc eq undef )
{
# Stick the execute method at the end of the other methods. We allow
# passing in of the severity so that macros which call execute() can over-ride
# the default severity.
- print ECFILE " void execute(fapi2::errlSeverity_t " .
- "i_sev = fapi2::FAPI2_ERRL_SEV_UNDEFINED," .
- "bool commit = false )\n";
- if ($arg_empty_ffdc eq undef )
+ print ECFILE " void execute(fapi2::errlSeverity_t "
+ . "i_sev = fapi2::FAPI2_ERRL_SEV_UNDEFINED,"
+ . "bool commit = false )\n";
+ if ( $arg_empty_ffdc eq undef )
{
print ECFILE " {\n";
print ECFILE " FAPI_SET_HWP_ERROR(iv_rc,$err->{rc});\n\n";
print ECFILE " if( commit )\n";
print ECFILE " {\n";
- print ECFILE " fapi2::logError(iv_rc, " .
- "(i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED)" .
- " ? iv_sev : i_sev);\n";
+ print ECFILE " fapi2::logError(iv_rc, "
+ . "(i_sev == fapi2::FAPI2_ERRL_SEV_UNDEFINED)"
+ . " ? iv_sev : i_sev);\n";
print ECFILE " }\n";
print ECFILE " }\n";
@@ -1496,12 +1524,12 @@ foreach my $argnum (0 .. $#ARGV)
}
# Instance variables
- if ($arg_empty_ffdc eq undef)
+ if ( $arg_empty_ffdc eq undef )
{
print ECFILE " public:\n";
- foreach my $key (keys %methods)
+ foreach my $key ( keys %methods )
{
- if( !($methods{$key}{member} eq undef) )
+ if ( !( $methods{$key}{member} eq undef ) )
{
print ECFILE " $methods{$key}{member}\n";
}
@@ -1526,13 +1554,13 @@ foreach my $argnum (0 .. $#ARGV)
#----------------------------------------------------------------------
# If this is an SBE error, add it to set_sbe_error.H
#----------------------------------------------------------------------
- if (exists $err->{sbeError})
+ if ( exists $err->{sbeError} )
{
print SBFILE " case fapi2::$err->{rc}: \\\n";
print SBFILE " { \\\n fapi2::$class_name l_obj(";
print SBFILE "fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE,RC);\\\n";
- if(!($objectStr eq undef ))
+ if ( !( $objectStr eq undef ) )
{
print SBFILE "$objectStr";
}
@@ -1540,34 +1568,34 @@ foreach my $argnum (0 .. $#ARGV)
print SBFILE " break; \\\n } \\\n";
}
- } #for each hwpError tag
- #
- #--------------------------------------------------------------------------
- # For each registerFfdc.
- #--------------------------------------------------------------------------
- foreach my $registerFfdc (@{$errors->{registerFfdc}})
+ } #for each hwpError tag
+ #
+ #--------------------------------------------------------------------------
+ # For each registerFfdc.
+ #--------------------------------------------------------------------------
+ foreach my $registerFfdc ( @{ $errors->{registerFfdc} } )
{
#----------------------------------------------------------------------
# Check that expected fields are present
#----------------------------------------------------------------------
- if (! exists $registerFfdc->{id}[0])
+ if ( !exists $registerFfdc->{id}[0] )
{
- print ("parseErrorInfo.pl ERROR. id missing from registerFfdc\n");
+ print("parseErrorInfo.pl ERROR. id missing from registerFfdc\n");
exit(1);
}
- if (scalar @{$registerFfdc->{id}} > 1)
+ if ( scalar @{ $registerFfdc->{id} } > 1 )
{
- print ("parseErrorInfo.pl ERROR. multiple ids in registerFfdc\n");
+ print("parseErrorInfo.pl ERROR. multiple ids in registerFfdc\n");
exit(1);
}
- if( $arg_local_ffdc eq undef )
+ if ( $arg_local_ffdc eq undef )
{
#----------------------------------------------------------------------
# Set the FFDC ID value in a global hash
#----------------------------------------------------------------------
- setFfdcIdValue($registerFfdc->{id}[0]);
+ setFfdcIdValue( $registerFfdc->{id}[0] );
#----------------------------------------------------------------------
# Generate code to capture the registers in collect_reg_ffdc_regs.C
@@ -1575,13 +1603,13 @@ foreach my $argnum (0 .. $#ARGV)
print CRFILE " case $registerFfdc->{id}[0]:\n";
# Look for CFAM Register addresses
- foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}})
+ foreach my $cfamRegister ( @{ $registerFfdc->{cfamRegister} } )
{
print CRFILE " o_cfamAddresses.push_back($cfamRegister);\n";
}
# Look for SCOM Register addresses
- foreach my $scomRegister (@{$registerFfdc->{scomRegister}})
+ foreach my $scomRegister ( @{ $registerFfdc->{scomRegister} } )
{
print CRFILE " o_scomAddresses.push_back($scomRegister);\n";
}
@@ -1590,17 +1618,16 @@ foreach my $argnum (0 .. $#ARGV)
}
}
-
}
#------------------------------------------------------------------------------
# Print end of file information to collect_reg_ffdc_regs.C
#------------------------------------------------------------------------------
-if( $arg_local_ffdc eq undef )
+if ( $arg_local_ffdc eq undef )
{
print CRFILE " default:\n";
print CRFILE " FAPI_ERR(\"collect_reg_ffdc_regs.C: Invalid FFDC ID 0x%x\", ";
- print CRFILE "i_ffdcId);\n";
+ print CRFILE "i_ffdcId);\n";
print CRFILE " return;\n";
print CRFILE " }\n";
@@ -1625,14 +1652,15 @@ print RCFILE " * \@brief Enumeration of HWP return codes\n";
print RCFILE " *\/\n";
print RCFILE "enum HwpReturnCode\n";
print RCFILE "{\n";
-foreach my $key (keys %errNameToValueHash)
+
+foreach my $key ( keys %errNameToValueHash )
{
print RCFILE " $key = 0x$errNameToValueHash{$key},\n";
}
print RCFILE "};\n\n";
print RCFILE "}\n\n";
print RCFILE "#else\n";
-foreach my $key (keys %errNameToValueHash)
+foreach my $key ( keys %errNameToValueHash )
{
print RCFILE " .set $key, 0x$errNameToValueHash{$key}\n";
}
@@ -1644,7 +1672,7 @@ print RCFILE "#endif\n";
#------------------------------------------------------------------------------
print EIFILE "namespace fapi2\n";
print EIFILE "{\n\n";
-if($arg_local_ffdc)
+if ($arg_local_ffdc)
{
print EIFILE " extern SbeFfdcData_t g_FfdcData;\n";
}
@@ -1653,7 +1681,7 @@ print EIFILE " * \@brief Enumeration of FFDC identifiers\n";
print EIFILE " *\/\n";
print EIFILE "enum HwpFfdcId\n";
print EIFILE "{\n";
-foreach my $key (keys %ffdcNameToValueHash)
+foreach my $key ( keys %ffdcNameToValueHash )
{
print EIFILE " $key = 0x$ffdcNameToValueHash{$key},\n";
}
@@ -1668,13 +1696,14 @@ print EIFILE "\n\n#endif\n";
#------------------------------------------------------------------------------
# Print end of file information to hwp_ffdc_classes.H
#------------------------------------------------------------------------------
-print ECFILE "\n};\n"; # close the namespace
+print ECFILE "\n};\n"; # close the namespace
print ECFILE "\n\n#endif\n";
#------------------------------------------------------------------------------
# Print end of file information to set_sbe_error.H
#------------------------------------------------------------------------------
print SBFILE " default:\\\n";
+
#print SBFILE " FAPI_SET_HWP_ERROR(RC, RC_SBE_UNKNOWN_ERROR,0);\\\n";
print SBFILE " break;\\\n";
print SBFILE "}\\\n";
OpenPOWER on IntegriCloud