summaryrefslogtreecommitdiffstats
path: root/import/hwpf/fapi2/include/ffdc.H
diff options
context:
space:
mode:
authorThi Tran <thi@us.ibm.com>2015-10-15 11:51:50 -0500
committerJennifer A. Stofer <stofer@us.ibm.com>2015-11-09 09:36:35 -0600
commitf725a5a8ec08371d605dd5c182d5eeca73af605a (patch)
treec1cc1467e7cdca7717e4426f97b6ac616463419e /import/hwpf/fapi2/include/ffdc.H
parent7f6c19c51a92d16b0b01787cb77e2de078432be2 (diff)
downloadtalos-sbe-f725a5a8ec08371d605dd5c182d5eeca73af605a.tar.gz
talos-sbe-f725a5a8ec08371d605dd5c182d5eeca73af605a.zip
Additional change for FAPI2 FFDC
Change-Id: I188922734424ff27d220ad72e81ba2fe3a5a84ba Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21256 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21764
Diffstat (limited to 'import/hwpf/fapi2/include/ffdc.H')
-rw-r--r--import/hwpf/fapi2/include/ffdc.H107
1 files changed, 56 insertions, 51 deletions
diff --git a/import/hwpf/fapi2/include/ffdc.H b/import/hwpf/fapi2/include/ffdc.H
index 6ebf87ff..2134e018 100644
--- a/import/hwpf/fapi2/include/ffdc.H
+++ b/import/hwpf/fapi2/include/ffdc.H
@@ -1,23 +1,19 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: $ */
+/* $Source: hwpf/fapi2/include/ffdc.H $ */
/* */
-/* OpenPOWER HostBoot Project */
+/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* EKB Project */
/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
+/* COPYRIGHT 2011,2015 */
+/* [+] International Business Machines Corp. */
/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
/* */
/* IBM_PROLOG_END_TAG */
/**
@@ -38,31 +34,31 @@ using fapi2::TARGET_TYPE_ALL;
namespace fapi2
{
- ///
- /// @brief Check the type of a variable
- ///
- /// This function can be called to check that a variable type is as expected
- /// @note This mechanism will allow for cast ctor's which other static type
- /// checking might not.
- ///
- template<typename T>
- inline
- void checkType(const T &) {}
-
- class ReturnCode;
-
- ///
- /// @class FirstFailureData
- ///
- /// This class provides storage and methods for creating and manipulating
- /// FFDC.
- /// It is not needed on all platforms - platforms which need this class have
- /// specified this by forcing their fapi2::ReturnCode to be a subclass of
- /// this class.
- ///
- template< class R = fapi2::ReturnCode >
- class FirstFailureData
- {
+///
+/// @brief Check the type of a variable
+///
+/// This function can be called to check that a variable type is as expected
+/// @note This mechanism will allow for cast ctor's which other static type
+/// checking might not.
+///
+template<typename T>
+inline
+void checkType(const T&) {}
+
+class ReturnCode;
+
+///
+/// @class FirstFailureData
+///
+/// This class provides storage and methods for creating and manipulating
+/// FFDC.
+/// It is not needed on all platforms - platforms which need this class have
+/// specified this by forcing their fapi2::ReturnCode to be a subclass of
+/// this class.
+///
+template< class R = fapi2::ReturnCode >
+class FirstFailureData
+{
public:
///
@@ -73,7 +69,7 @@ namespace fapi2
///
FirstFailureData(void):
iv_info( nullptr )
- {}
+ {}
///
/// @brief Copy Constructor
@@ -82,7 +78,7 @@ namespace fapi2
/// @note Generates default copy constructor - no deep pointer
/// copies necessary.
///
- FirstFailureData(const FirstFailureData & i_right) = default;
+ FirstFailureData(const FirstFailureData& i_right) = default;
///
/// @brief Destructor
@@ -95,7 +91,7 @@ namespace fapi2
/// @param[in] i_right Reference to FirstFailureData to assign from.
/// @return Reference to 'this' FirstFailureData
///
- FirstFailureData & operator=(const FirstFailureData & i_right) = default;
+ FirstFailureData& operator=(const FirstFailureData& i_right) = default;
///
/// @brief Sets a HWP error. Sets the rcValue to the supplied value (from
@@ -110,13 +106,13 @@ namespace fapi2
/// @param[in] i_rcValue Error value to set
///
inline void _setHwpError(const fapi2::HwpReturnCode i_rcValue)
- {
- FAPI_ERR("_setHwpError: Creating HWP error 0x%x", i_rcValue);
- static_cast<R*>(this)->operator=(i_rcValue);
+ {
+ FAPI_ERR("_setHwpError: Creating HWP error 0x%x", i_rcValue);
+ static_cast<R*>(this)->operator=(i_rcValue);
- // Forget about any associated data (this is a new error)
- iv_info.reset(new ErrorInfo());
- }
+ // Forget about any associated data (this is a new error)
+ iv_info.reset(new ErrorInfo());
+ }
///
/// @brief Get a pointer to any PlatData. FirstFailureData is still
@@ -140,7 +136,12 @@ namespace fapi2
///
/// @return void*. Pointer to any PlatData. If NULL then no data
///
- void* releaseData(void);
+ inline void* releaseData(void)
+ {
+ void* l_pData = iv_info;
+ iv_info = NULL;
+ return l_pData;
+ }
///
/// @brief Add ErrorInfo
@@ -157,7 +158,7 @@ namespace fapi2
/// defining the ErrorInfo that needs to be added
/// @param[in] i_count Number of ErrorInfoEntry entries
///
- void addErrorInfo(const void* const * i_pObjects,
+ void addErrorInfo(const void* const* i_pObjects,
const ErrorInfoEntry* i_pEntries,
const uint8_t i_count);
@@ -169,7 +170,9 @@ namespace fapi2
/// @return ErrorInfo *. Pointer to any ErrorInfo. If NULL then no info
///
inline const fapi2::ErrorInfo* getErrorInfo(void) const
- { return iv_info.get(); }
+ {
+ return iv_info.get();
+ }
///
/// @brief Forgets about any associated data (PlatData and ErrorInfo)
@@ -178,13 +181,15 @@ namespace fapi2
/// data is deleted
///
inline void forgetData(void)
- { iv_info = nullptr; }
+ {
+ iv_info = nullptr;
+ }
private:
// Pointer to the data
std::shared_ptr<ErrorInfo> iv_info;
- };
+};
}
#endif // FAPI2_FFDC_H_
OpenPOWER on IntegriCloud