diff options
author | Mike Jones <mjjones@us.ibm.com> | 2011-08-24 16:55:23 -0500 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-08-26 15:23:46 -0500 |
commit | 868fd75d64f91d2afbb31d442451857d02a830ce (patch) | |
tree | 1d8fd0f6fabfc748963a491a92101f03cfe25864 /src | |
parent | bf46e7954689c41cccc897b8b00bcc5db5245374 (diff) | |
download | talos-hostboot-868fd75d64f91d2afbb31d442451857d02a830ce.tar.gz talos-hostboot-868fd75d64f91d2afbb31d442451857d02a830ce.zip |
HWPF: Add support for gard to Error Information
Change-Id: I814df4879d3bf9b547d15c5ae9a8a3683bfbf9f0
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/279
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiErrorInfo.H | 49 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 14 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 50 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiHwpErrorInfo.xml | 5 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatHwpInvoker.C | 20 |
5 files changed, 118 insertions, 20 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H index 5b49d147e..110b48632 100644 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H @@ -32,6 +32,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/09/2011 Created. + * mjjones 08/24/2011 Added ErrorInfoGard. */ #ifndef FAPIERRORINFO_H_ @@ -69,22 +70,21 @@ struct ErrorInfoCallout /** * @brief Constructor. * - * @param[in] i_targetType The type of the target being called out. If the - * same as the target of the HWP that generated the - * error then that is the target - * @param[in] i_targetPos The position of the target being called out. - * Relative to the target of the HWP that generated - * the error + * @param[in] i_targetType The type of the target to callout. If the same as + * the target of the HWP that generated the error + * then that is the target + * @param[in] i_targetPos The position of the target to callout. Relative + * to the target of the HWP that generated the error * @param[in] i_priority The priority of the callout */ ErrorInfoCallout(const TargetType i_targetType, const uint32_t i_targetPos, const CalloutPriority i_priority); - // The type of the target being called out. See ctor for details + // The type of the target to call out. See ctor for details TargetType iv_targetType; - // The position of the target being called out. See ctor for details + // The position of the target to call out. See ctor for details uint32_t iv_targetPos; // The priority of the callout @@ -92,6 +92,33 @@ struct ErrorInfoCallout }; /** + * @struct ErrorInfoGard + * + * This struct defines a target gard request. An ErrorInfoRecord can contain a + * number of these. + */ +struct ErrorInfoGard +{ + /** + * @brief Constructor. + * + * @param[in] i_targetType The type of the target to gard. If the same as + * the target of the HWP that generated the error + * then that is the target + * @param[in] i_targetPos The position of the target to gard. Relative to + * the target of the HWP that generated the error + */ + ErrorInfoGard(const TargetType i_targetType, + const uint32_t i_targetPos); + + // The type of the target to gard. See ctor for details + TargetType iv_targetType; + + // The position of the target to gard. See ctor for details + uint32_t iv_targetPos; +}; + +/** * @struct ErrorInfoFfdc * * This struct defines FFDC collection information. An ErrorInfoRecord can @@ -176,10 +203,14 @@ struct ErrorInfoRecord // The Return Code value uint32_t iv_rc; - // Vector of target callouts + // Vector of targets to callout std::vector<ErrorInfoCallout> iv_callouts; typedef std::vector<ErrorInfoCallout>::iterator ErrorInfoCalloutItr_t; + // Vector of targets to gard + std::vector<ErrorInfoGard> iv_gards; + typedef std::vector<ErrorInfoGard>::iterator ErrorInfoGardItr_t; + // Vector of FFDC collection information std::vector<ErrorInfoFfdc> iv_ffdcs; typedef std::vector<ErrorInfoFfdc>::iterator ErrorInfoFfdcItr_t; diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index 0d3a50b27..42fb7ec8f 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -31,6 +31,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/05/2011 Created + * mjjones 08/24/2011 Added ErrorInfoGard. */ #include <fapiErrorInfo.H> @@ -53,6 +54,17 @@ ErrorInfoCallout::ErrorInfoCallout(const TargetType i_targetType, } //****************************************************************************** +// ErrorInfoGard Constructor +//****************************************************************************** +ErrorInfoGard::ErrorInfoGard(const TargetType i_targetType, + const uint32_t i_targetPos) +: iv_targetType(i_targetType), + iv_targetPos(i_targetPos) +{ + +} + +//****************************************************************************** // ErrorInfoFfdc Constructor //****************************************************************************** ErrorInfoFfdc::ErrorInfoFfdc(const TargetType i_targetType, @@ -81,6 +93,7 @@ ErrorInfoRecord::ErrorInfoRecord() ErrorInfoRecord::ErrorInfoRecord(const ErrorInfoRecord & i_right) : iv_rc(i_right.iv_rc), iv_callouts(i_right.iv_callouts), + iv_gards(i_right.iv_gards), iv_ffdcs(i_right.iv_ffdcs), iv_pDescription(NULL) { @@ -110,6 +123,7 @@ ErrorInfoRecord & ErrorInfoRecord::operator=(const ErrorInfoRecord & i_right) { iv_rc = i_right.iv_rc; iv_callouts = i_right.iv_callouts; + iv_gards = i_right.iv_gards; iv_ffdcs = i_right.iv_ffdcs; // Perform deep copy of the description string diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index dc3588b10..07d92a172 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -43,6 +43,7 @@ # mjjones 06/10/11 Added "use strict;" # mjjones 07/05/11 Take output dir as parameter # mjjones 08/08/11 Large update to create more code +# mjjones 08/24/11 Parse GARD info # # End Change Log ****************************************************** @@ -150,6 +151,7 @@ print MIFILE "{\n"; # Element names #------------------------------------------------------------------------------ my $ffdc = 'ffdc'; +my $gard = 'gard'; my $callout = 'callout'; #------------------------------------------------------------------------------ @@ -160,12 +162,12 @@ foreach my $argnum (1 .. $#ARGV) my $infile = $ARGV[$argnum]; #-------------------------------------------------------------------------- - # Read XML file. Note that there may be multiple ffdc and callout elements + # Read XML file. Note that there may be multiple ffdc/gard/callout elements # so use the ForceArray option with these to ensure that XML::Simple # creates an array even for single elements of these types #-------------------------------------------------------------------------- # read XML file - my $errors = $xml->XMLin($infile, ForceArray => [$ffdc, $callout]); + my $errors = $xml->XMLin($infile, ForceArray => [$ffdc, $gard, $callout]); # Uncomment to get debug output of all errors #print "\nFile: ", $infile, "\n", Dumper($errors), "\n"; @@ -213,19 +215,19 @@ foreach my $argnum (1 .. $#ARGV) #------------------------------------------------------------------ if (! exists $callout->{targetType}) { - print ("fapiParseErrorInfo.pl ERROR. targetType missing\n"); + print ("fapiParseErrorInfo.pl ERROR. Callout targetType missing\n"); exit(1); } if (! exists $callout->{targetPos}) { - print ("fapiParseErrorInfo.pl ERROR. targetPos missing\n"); + print ("fapiParseErrorInfo.pl ERROR. Callout targetPos missing\n"); exit(1); } if (! exists $callout->{priority}) { - print ("fapiParseErrorInfo.pl ERROR. priority missing\n"); + print ("fapiParseErrorInfo.pl ERROR. Callout priority missing\n"); exit(1); } @@ -240,6 +242,36 @@ foreach my $argnum (1 .. $#ARGV) } #---------------------------------------------------------------------- + # For each Gard element + #---------------------------------------------------------------------- + foreach my $gard (@{$err->{gard}}) + { + #------------------------------------------------------------------ + # Check that expected fields are present + #------------------------------------------------------------------ + if (! exists $gard->{targetType}) + { + print ("fapiParseErrorInfo.pl ERROR. Gard targetType missing\n"); + exit(1); + } + + if (! exists $gard->{targetPos}) + { + print ("fapiParseErrorInfo.pl ERROR. Gard targetPos missing\n"); + exit(1); + } + + #------------------------------------------------------------------ + # Print the Gard data to fapiErrorInfoMemInit.C + #------------------------------------------------------------------ + print MIFILE " {\n"; + print MIFILE " ErrorInfoGard l_gard($gard->{targetType}, "; + print MIFILE "$gard->{targetPos});\n"; + print MIFILE " l_record.iv_gards.push_back(l_gard);\n"; + print MIFILE " }\n"; + } + + #---------------------------------------------------------------------- # For each FFDC element #---------------------------------------------------------------------- foreach my $ffdc (@{$err->{ffdc}}) @@ -249,25 +281,25 @@ foreach my $argnum (1 .. $#ARGV) #------------------------------------------------------------------ if (! exists $ffdc->{targetType}) { - print ("fapiParseErrorInfo.pl ERROR. targetType missing\n"); + print ("fapiParseErrorInfo.pl ERROR. FFDC targetType missing\n"); exit(1); } if (! exists $ffdc->{targetPos}) { - print ("fapiParseErrorInfo.pl ERROR. targetPos missing\n"); + print ("fapiParseErrorInfo.pl ERROR. FFDC targetPos missing\n"); exit(1); } if (! exists $ffdc->{ffdcHwp}) { - print ("fapiParseErrorInfo.pl ERROR. ffdcHwp missing\n"); + print ("fapiParseErrorInfo.pl ERROR. FFDC ffdcHwp missing\n"); exit(1); } if (! exists $ffdc->{ffdcHwpData}) { - print ("fapiParseErrorInfo.pl ERROR. ffdcHwpData missing\n"); + print ("fapiParseErrorInfo.pl ERROR. FFDC ffdcHwpData missing\n"); exit(1); } diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml index 6ee80844d..fb7e20439 100644 --- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml +++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml @@ -34,6 +34,11 @@ <targetPos>0</targetPos> <priority>HIGH</priority> </callout> + <gard> + <!-- The PROC_CHIP itself should be garded --> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <targetPos>0</targetPos> + </gard> <ffdc> <!-- FFDC needs to be collected from the PROC_CHIP itself --> <targetType>TARGET_TYPE_PROC_CHIP</targetType> diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C index e497fa6f1..eb66333fd 100644 --- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C +++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C @@ -111,8 +111,24 @@ errlHndl_t rcToErrl(ReturnCode i_rc) } else { - // TODO Iterate through callouts, adding each callout to the - // error log + // Iterate through callouts, adding each callout to the error + // log + for (ErrorInfoRecord::ErrorInfoCalloutItr_t l_itr = + l_record.iv_callouts.begin(); + l_itr != l_record.iv_callouts.end(); ++l_itr) + { + // TODO Add callouts to error log + FAPI_ERR("rcToErrl: Adding callout TBD"); + } + + // Iterate through gard requests performing gard + for (ErrorInfoRecord::ErrorInfoGardItr_t l_itr = + l_record.iv_gards.begin(); + l_itr != l_record.iv_gards.end(); ++l_itr) + { + // TODO Gard component + FAPI_ERR("rcToErrl: Garding TBD"); + } // Iterate through FFDC sections, collecting and adding FFDC to // the error log |