diff options
Diffstat (limited to 'src/usr/hwpf/fapi')
-rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 106 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiReturnCode.C | 46 |
2 files changed, 78 insertions, 74 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index 7bc25a058..f1d5d81a0 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/hwpf/fapi/fapiErrorInfo.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/hwpf/fapi/fapiErrorInfo.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ /** * @file fapiErrorInfo.C * @@ -35,6 +36,8 @@ * mjjones 09/22/2011 Major updates * mjjones 03/16/2012 Add FfdcType. Remove copy * ctor and assignment operator + * mjjones 08/14/2012 Merge Callout/Deconfig/Gard + * structures into one */ #include <fapiErrorInfo.H> @@ -82,30 +85,11 @@ FfdcType ErrorInfoFfdc::getType() const } //****************************************************************************** -// ErrorInfoCallout Constructor -//****************************************************************************** -ErrorInfoCallout::ErrorInfoCallout(const Target & i_target, - const CalloutPriority i_priority) -: iv_target(i_target), - iv_priority(i_priority) -{ - -} - -//****************************************************************************** -// ErrorInfoDeconfig Constructor +// ErrorInfoCDG Constructor //****************************************************************************** -ErrorInfoDeconfig::ErrorInfoDeconfig(const Target & i_target) -: iv_target(i_target) -{ - -} - -//****************************************************************************** -// ErrorInfoGard Constructor -//****************************************************************************** -ErrorInfoGard::ErrorInfoGard(const Target & i_target) -: iv_target(i_target) +ErrorInfoCDG::ErrorInfoCDG(const Target & i_target) +: iv_target(i_target), iv_callout(false), iv_calloutPriority(PRI_LOW), + iv_deconfigure(false), iv_gard(false) { } @@ -122,26 +106,38 @@ ErrorInfo::~ErrorInfo() (*l_itr) = NULL; } - for (ErrorInfo::ErrorInfoCalloutItr_t l_itr = iv_callouts.begin(); - l_itr != iv_callouts.end(); ++l_itr) + for (ErrorInfo::ErrorInfoCDGItr_t l_itr = iv_CDGs.begin(); + l_itr != iv_CDGs.end(); ++l_itr) { delete (*l_itr); (*l_itr) = NULL; } +} - for (ErrorInfo::ErrorInfoDeconfigItr_t l_itr = iv_deconfigs.begin(); - l_itr != iv_deconfigs.end(); ++l_itr) +//****************************************************************************** +// ErrorInfo getCreateErrorInfoCDG +//****************************************************************************** +ErrorInfoCDG & ErrorInfo::getCreateErrorInfoCDG(const Target & i_target) +{ + ErrorInfoCDG * l_pInfo = NULL; + + for (ErrorInfo::ErrorInfoCDGCItr_t l_itr = iv_CDGs.begin(); + l_itr != iv_CDGs.end(); ++l_itr) { - delete (*l_itr); - (*l_itr) = NULL; + if ((*l_itr)->iv_target == i_target) + { + l_pInfo = (*l_itr); + break; + } } - for (ErrorInfo::ErrorInfoGardItr_t l_itr = iv_gards.begin(); - l_itr != iv_gards.end(); ++l_itr) + if (l_pInfo == NULL) { - delete (*l_itr); - (*l_itr) = NULL; + l_pInfo = new ErrorInfoCDG(i_target); + iv_CDGs.push_back(l_pInfo); } + + return *l_pInfo; } } diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C index 8a141f519..08eca6c82 100644 --- a/src/usr/hwpf/fapi/fapiReturnCode.C +++ b/src/usr/hwpf/fapi/fapiReturnCode.C @@ -46,6 +46,7 @@ * mjjones 03/16/2012 Allow different PLAT errors * mjjones 05/02/2012 Only trace setEcmdError on err * mjjones 07/11/2012 Remove a trace + * mjjones 08/14/2012 Use new ErrorInfo structure */ #include <fapiReturnCode.H> @@ -197,8 +198,7 @@ void ReturnCode::setPlatError(void * i_pData, if (i_pData) { - ensureDataRefExists(); - iv_pDataRef->setPlatData(i_pData); + getCreateReturnCodeDataRef().setPlatData(i_pData); } } @@ -336,9 +336,9 @@ void ReturnCode::addEIFfdc(const void * i_pFfdc, const FfdcType i_type) { // Create a ErrorInfoFfdc object and add it to the Error Information - ensureDataRefExists(); ErrorInfoFfdc * l_pFfdc = new ErrorInfoFfdc(i_pFfdc, i_size, i_type); - iv_pDataRef->getCreateErrorInfo().iv_ffdcs.push_back(l_pFfdc); + getCreateReturnCodeDataRef().getCreateErrorInfo(). + iv_ffdcs.push_back(l_pFfdc); } @@ -377,14 +377,16 @@ ReturnCode::returnCodeCreator ReturnCode::getCreator() const } //****************************************************************************** -// ensureDataRefExists function +// getCreateReturnCodeDataRef function //****************************************************************************** -void ReturnCode::ensureDataRefExists() +ReturnCodeDataRef & ReturnCode::getCreateReturnCodeDataRef() { - if (!iv_pDataRef) + if (iv_pDataRef == NULL) { iv_pDataRef = new ReturnCodeDataRef(); } + + return *iv_pDataRef; } //****************************************************************************** @@ -411,10 +413,16 @@ void ReturnCode::forgetData() void ReturnCode::addEICallout(const Target & i_target, const CalloutPriority i_priority) { - // Create a ErrorInfoCallout object and add it to the Error Information - ensureDataRefExists(); - ErrorInfoCallout * l_pCallout = new ErrorInfoCallout(i_target, i_priority); - iv_pDataRef->getCreateErrorInfo().iv_callouts.push_back(l_pCallout); + // Get/Create a ErrorInfoCDG object for the target and update the callout + ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef(). + getCreateErrorInfo().getCreateErrorInfoCDG(i_target); + l_errorInfoCdg.iv_callout = true; + + // If the same target is called out multiple times, use the highest priority + if (i_priority > l_errorInfoCdg.iv_calloutPriority) + { + l_errorInfoCdg.iv_calloutPriority = i_priority; + } } //****************************************************************************** @@ -422,10 +430,10 @@ void ReturnCode::addEICallout(const Target & i_target, //****************************************************************************** void ReturnCode::addEIDeconfigure(const Target & i_target) { - // Create a ErrorInfoDeconfig object and add it to the Error Information - ensureDataRefExists(); - ErrorInfoDeconfig * l_pDeconfig = new ErrorInfoDeconfig(i_target); - iv_pDataRef->getCreateErrorInfo().iv_deconfigs.push_back(l_pDeconfig); + // Get/Create a ErrorInfoCDG object for the target and update the deconfig + ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef(). + getCreateErrorInfo().getCreateErrorInfoCDG(i_target); + l_errorInfoCdg.iv_deconfigure = true; } //****************************************************************************** @@ -433,10 +441,10 @@ void ReturnCode::addEIDeconfigure(const Target & i_target) //****************************************************************************** void ReturnCode::addEIGard(const Target & i_target) { - // Create a ErrorInfoGard object and add it to the Error Information - ensureDataRefExists(); - ErrorInfoGard * l_pGard = new ErrorInfoGard(i_target); - iv_pDataRef->getCreateErrorInfo().iv_gards.push_back(l_pGard); + // Get/Create a ErrorInfoCDG object for the target and update the GARD + ErrorInfoCDG & l_errorInfoCdg = getCreateReturnCodeDataRef(). + getCreateErrorInfo().getCreateErrorInfoCDG(i_target); + l_errorInfoCdg.iv_gard = true; } } |