diff options
author | Mike Jones <mjjones@us.ibm.com> | 2013-03-22 16:00:47 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-04-04 17:08:36 -0500 |
commit | d80544e716c93297feb4c64fceabcdec6c2efbc7 (patch) | |
tree | c1652e24fd8487cbf5ce6fdc67734938c2f28a4e /src/usr/hwpf/fapi | |
parent | f3af02b13688f74136c9983fb9919bf64b9eb304 (diff) | |
download | talos-hostboot-d80544e716c93297feb4c64fceabcdec6c2efbc7.tar.gz talos-hostboot-d80544e716c93297feb4c64fceabcdec6c2efbc7.zip |
HWPF: Support Procedure Callouts
Change-Id: I250472ba4125944ba17433c759c915b30a9bc93e
RTC: 50323
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3699
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/fapi')
-rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 27 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 32 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiReturnCode.C | 46 |
3 files changed, 87 insertions, 18 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index 5d4e9e716..1879fefd2 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -38,6 +38,7 @@ * mjjones 08/14/2012 Merge Callout/Deconfig/Gard * structures into one * mjjones 09/19/2012 Replace FFDC type with ID + * mjjones 03/22/2013 Support Procedure Callouts */ #include <fapiErrorInfo.H> @@ -77,11 +78,23 @@ const void * ErrorInfoFfdc::getData(uint32_t & o_size) const } //****************************************************************************** +// ErrorInfoProcedureCallout Constructor +//****************************************************************************** +ErrorInfoProcedureCallout::ErrorInfoProcedureCallout( + const ProcedureCallouts::ProcedureCallout i_procedure, + const CalloutPriorities::CalloutPriority i_calloutPriority) +: iv_procedure(i_procedure), iv_calloutPriority(i_calloutPriority) +{ + +} + +//****************************************************************************** // ErrorInfoCDG Constructor //****************************************************************************** ErrorInfoCDG::ErrorInfoCDG(const Target & i_target) -: iv_target(i_target), iv_callout(false), iv_calloutPriority(PRI_LOW), - iv_deconfigure(false), iv_gard(false) +: iv_target(i_target), iv_callout(false), + iv_calloutPriority(CalloutPriorities::LOW), iv_deconfigure(false), + iv_gard(false) { } @@ -98,6 +111,14 @@ ErrorInfo::~ErrorInfo() (*l_itr) = NULL; } + for (ErrorInfo::ErrorInfoProcedureCalloutItr_t l_itr = + iv_procedureCallouts.begin(); + l_itr != iv_procedureCallouts.end(); ++l_itr) + { + delete (*l_itr); + (*l_itr) = NULL; + } + for (ErrorInfo::ErrorInfoCDGItr_t l_itr = iv_CDGs.begin(); l_itr != iv_CDGs.end(); ++l_itr) { diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index 2ddc8c1a8..996ec414c 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -51,6 +51,7 @@ # mjjones 11/09/12 Generate fapiSetSbeError.H # mjjones 01/09/13 Fix CFAM register capture # mjjones 03/14/13 Allow 64bit literals for SCOM reg capture +# mjjones 03/22/13 Support Procedure Callouts # # End Change Log ****************************************************** @@ -461,12 +462,12 @@ foreach my $argnum (1 .. $#ARGV) $eiEntryCount++; } - # Target callouts + # Procedure/Target callouts foreach my $callout (@{$err->{callout}}) { - if (! exists $callout->{target}) + if ((! exists $callout->{target}) && (! exists $callout->{procedure})) { - print ("fapiParseErrorInfo.pl ERROR. Callout target missing\n"); + print ("fapiParseErrorInfo.pl ERROR. Callout procedure/target missing\n"); exit(1); } @@ -476,18 +477,33 @@ foreach my $argnum (1 .. $#ARGV) exit(1); } - # Check the type - print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$callout->{target}); "; + my $objNum = 0; + if (exists $callout->{target}) + { + # Check the type + print EIFILE + "fapi::fapiCheckType<const fapi::Target *>(&$callout->{target}); "; - # Add the Target to the objectlist if it doesn't already exist - my $objNum = addEntryToArray(\@eiObjects, $callout->{target}); + # Add the Target to the objectlist if it doesn't already exist + $objNum = addEntryToArray(\@eiObjects, $callout->{target}); + } # Add an EI entry to eiEntryStr if ($eiEntryCount > 0) { $eiEntryStr .= ", "; } - $eiEntryStr .= "{fapi::ReturnCode::EI_TYPE_CALLOUT, $objNum, fapi::PRI_$callout->{priority}, 0}"; + + if (exists $callout->{target}) + { + $eiEntryStr .= + "{fapi::ReturnCode::EI_TYPE_CALLOUT, $objNum, fapi::CalloutPriorities::$callout->{priority}, 0}"; + } + else + { + $eiEntryStr .= + "{fapi::ReturnCode::EI_TYPE_PROCEDURE_CALLOUT, 0, fapi::CalloutPriorities::$callout->{priority}, fapi::ProcedureCallouts::$callout->{procedure}}"; + } $eiEntryCount++; } diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C index b8dae8bed..0de6126cb 100644 --- a/src/usr/hwpf/fapi/fapiReturnCode.C +++ b/src/usr/hwpf/fapi/fapiReturnCode.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -48,6 +48,7 @@ * 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 + * mjjones 03/22/2013 Support Procedure Callouts */ #include <fapiReturnCode.H> @@ -230,7 +231,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, { for (uint32_t i = 0; i < i_count; i++) { - // Figure out the object that this FFDC refers to + // Figure out the object that this ErrorInfo refers to const void * l_pObject = i_pObjects[i_pEntries[i].iv_object]; if (i_pEntries[i].iv_type == EI_TYPE_FFDC) @@ -277,15 +278,30 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, FAPI_ERR("addErrorInfo: Unrecognized FFDC data: %d", l_size); } } + else if (i_pEntries[i].iv_type == EI_TYPE_PROCEDURE_CALLOUT) + { + ProcedureCallouts::ProcedureCallout l_proc = + static_cast<ProcedureCallouts::ProcedureCallout> + (i_pEntries[i].iv_data2); + CalloutPriorities::CalloutPriority l_pri = + static_cast<CalloutPriorities::CalloutPriority> + (i_pEntries[i].iv_data1); + + // Add the ErrorInfo + FAPI_ERR("addErrorInfo: Adding proc callout, proc: %d, pri: %d", + l_proc, l_pri); + addEIProcedureCallout(l_proc, l_pri); + } else if (i_pEntries[i].iv_type == EI_TYPE_CALLOUT) { // Get a pointer to the Target to callout and the priority const Target * l_pTarget = static_cast<const Target *>(l_pObject); - CalloutPriority l_pri = - static_cast<CalloutPriority>(i_pEntries[i].iv_data1); + CalloutPriorities::CalloutPriority l_pri = + static_cast<CalloutPriorities::CalloutPriority> + (i_pEntries[i].iv_data1); // Add the ErrorInfo - FAPI_ERR("addErrorInfo: Adding callout, pri: %d", l_pri); + FAPI_ERR("addErrorInfo: Adding target callout, pri: %d", l_pri); addEICallout(*l_pTarget, l_pri); } else if (i_pEntries[i].iv_type == EI_TYPE_DECONF) @@ -394,10 +410,26 @@ void ReturnCode::forgetData() } //****************************************************************************** +// addEIProcedureCallout function +//****************************************************************************** +void ReturnCode::addEIProcedureCallout( + const ProcedureCallouts::ProcedureCallout i_procedure, + const CalloutPriorities::CalloutPriority i_priority) +{ + // Create an ErrorInfoProcedureCallout object and add it to the Error + // Information + ErrorInfoProcedureCallout * l_pCallout = new ErrorInfoProcedureCallout( + i_procedure, i_priority); + getCreateReturnCodeDataRef().getCreateErrorInfo(). + iv_procedureCallouts.push_back(l_pCallout); +} + +//****************************************************************************** // addEICallout function //****************************************************************************** -void ReturnCode::addEICallout(const Target & i_target, - const CalloutPriority i_priority) +void ReturnCode::addEICallout( + const Target & i_target, + const CalloutPriorities::CalloutPriority i_priority) { // Get/Create a ErrorInfoCDG object for the target and update the callout ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef(). |