diff options
-rw-r--r-- | src/import/hwpf/fapi2/include/buffer_parameters.H | 50 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/error_scope.H | 22 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/fapi2_hwp_executor.H | 18 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/hw_access_def.H | 82 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/return_code_defs.H | 98 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/target_states.H | 38 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/src/error_info.C | 656 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/src/ffdc.C | 55 |
8 files changed, 503 insertions, 516 deletions
diff --git a/src/import/hwpf/fapi2/include/buffer_parameters.H b/src/import/hwpf/fapi2/include/buffer_parameters.H index 2a6e61006..89ed223cf 100644 --- a/src/import/hwpf/fapi2/include/buffer_parameters.H +++ b/src/import/hwpf/fapi2/include/buffer_parameters.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/buffer_parameters.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* 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 2012,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 */ /** @@ -34,24 +28,30 @@ namespace fapi2 { - /// @cond - /// @brief Traits of buffer parameters - things passed in - /// @tparam T is the type of i_value (typically an integral type) - template<typename T> - class parameterTraits - { +/// @cond +/// @brief Traits of buffer parameters - things passed in +/// @tparam T is the type of i_value (typically an integral type) +template<typename T> +class parameterTraits +{ public: // Why constexpr functions? Enums are hard to do math on, and // static const doesn't work without -O1 (or greater.) That might // be a bug in g++ but this works just the same. constexpr static T mask(void) - { return T(~0); } + { + return T(~0); + } constexpr static uint32_t byte_length(void) - { return sizeof(T); } + { + return sizeof(T); + } constexpr static uint32_t bit_length(void) - { return sizeof(T) * 8; } + { + return sizeof(T) * 8; + } template<typename U> inline static void write_element(void* i_data, T i_value, uint32_t i_offset) @@ -63,8 +63,8 @@ namespace fapi2 #endif *ptr = i_value; } - }; - /// @endcond +}; +/// @endcond } #endif diff --git a/src/import/hwpf/fapi2/include/error_scope.H b/src/import/hwpf/fapi2/include/error_scope.H index d742dd0ef..72ea36acf 100644 --- a/src/import/hwpf/fapi2/include/error_scope.H +++ b/src/import/hwpf/fapi2/include/error_scope.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/error_scope.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* 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 2012,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 */ /** diff --git a/src/import/hwpf/fapi2/include/fapi2_hwp_executor.H b/src/import/hwpf/fapi2/include/fapi2_hwp_executor.H index e92d14275..1243ff624 100644 --- a/src/import/hwpf/fapi2/include/fapi2_hwp_executor.H +++ b/src/import/hwpf/fapi2/include/fapi2_hwp_executor.H @@ -1,3 +1,21 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: hwpf/fapi2/include/fapi2_hwp_executor.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* EKB Project */ +/* */ +/* COPYRIGHT 2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* 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 */ /// /// @file fapi2_hwp_executor.H /// diff --git a/src/import/hwpf/fapi2/include/hw_access_def.H b/src/import/hwpf/fapi2/include/hw_access_def.H index 098efb8c0..7a5fda572 100644 --- a/src/import/hwpf/fapi2/include/hw_access_def.H +++ b/src/import/hwpf/fapi2/include/hw_access_def.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/hw_access_def.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* 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 2012,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 */ /// @@ -39,38 +33,38 @@ typedef uint64_t scanRingId_t; namespace fapi2 { - /// - /// @enum fapi2::ChipOpModifyMode - /// @brief Enumeration of modify modes used in HW access modify operations - /// - enum ChipOpModifyMode - { - CHIP_OP_MODIFY_MODE_OR = 1, ///< Modify or mode - CHIP_OP_MODIFY_MODE_AND = 2, ///< Modify and mode - CHIP_OP_MODIFY_MODE_XOR = 3, ///< Modify xor mode - }; +/// +/// @enum fapi2::ChipOpModifyMode +/// @brief Enumeration of modify modes used in HW access modify operations +/// +enum ChipOpModifyMode +{ + CHIP_OP_MODIFY_MODE_OR = 1, ///< Modify or mode + CHIP_OP_MODIFY_MODE_AND = 2, ///< Modify and mode + CHIP_OP_MODIFY_MODE_XOR = 3, ///< Modify xor mode +}; - /// - /// @enum fapi2::RingMode - /// @brief Enumeration of Ring access operation modes - /// This is a bitmap to allow the user to specify multiple modes. - /// - enum RingMode - { - RING_MODE_SET_PULSE = 0x00000001, ///< Set pulse - RING_MODE_NO_HEADER_CHECK = 0x00000002, ///< Dont' check header - // FUTURE_MODE = 0x00000004, - // FUTURE_MODE = 0x00000008, - }; +/// +/// @enum fapi2::RingMode +/// @brief Enumeration of Ring access operation modes +/// This is a bitmap to allow the user to specify multiple modes. +/// +enum RingMode +{ + RING_MODE_SET_PULSE = 0x00000001, ///< Set pulse + RING_MODE_NO_HEADER_CHECK = 0x00000002, ///< Dont' check header + // FUTURE_MODE = 0x00000004, + // FUTURE_MODE = 0x00000008, +}; - /// @enum OpModes operational Mode Error Functions - enum OpModes - { - // These are bit-masks in case they need to be or'd together - NORMAL = 0x00, - IGNORE_HW_ERROR = 0x01, - DO_NOT_DO_WAKEUP = 0x02, - }; +/// @enum OpModes operational Mode Error Functions +enum OpModes +{ + // These are bit-masks in case they need to be or'd together + NORMAL = 0x00, + IGNORE_HW_ERROR = 0x01, + DO_NOT_DO_WAKEUP = 0x02, +}; } diff --git a/src/import/hwpf/fapi2/include/return_code_defs.H b/src/import/hwpf/fapi2/include/return_code_defs.H index 404bfafa5..b22097339 100644 --- a/src/import/hwpf/fapi2/include/return_code_defs.H +++ b/src/import/hwpf/fapi2/include/return_code_defs.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/return_code_defs.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* 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 2012,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 */ /** @@ -58,56 +52,56 @@ namespace fapi2 { - /// - /// @brief Enumeration of return codes - /// - enum ReturnCodes - { - ///< Success - FAPI2_RC_SUCCESS = 0, +/// +/// @brief Enumeration of return codes +/// +enum ReturnCodes +{ + ///< Success + FAPI2_RC_SUCCESS = 0, - // Flag bits indicating which code generated the error. - FAPI2_RC_FAPI2_MASK = 0x04000000, ///< FAPI2 mask - FAPI2_RC_PLAT_MASK = 0x02000000, ///< Platform mask - FAPI2_RC_HWP_MASK = 0x00000000, ///< HWP mask + // Flag bits indicating which code generated the error. + FAPI2_RC_FAPI2_MASK = 0x04000000, ///< FAPI2 mask + FAPI2_RC_PLAT_MASK = 0x02000000, ///< Platform mask + FAPI2_RC_HWP_MASK = 0x00000000, ///< HWP mask - // - // FAPI generated return codes - // + // + // FAPI generated return codes + // - FAPI2_RC_INVALID_ATTR_GET = FAPI2_RC_FAPI2_MASK | 0x01, - ///< Initfile requested an attribute with an invalid attribute ID + FAPI2_RC_INVALID_ATTR_GET = FAPI2_RC_FAPI2_MASK | 0x01, + ///< Initfile requested an attribute with an invalid attribute ID - FAPI2_RC_INVALID_CHIP_EC_FEATURE_GET = FAPI2_RC_FAPI2_MASK | 0x02, - ///< HWP requested a chip EC feature with an invalid attribute ID + FAPI2_RC_INVALID_CHIP_EC_FEATURE_GET = FAPI2_RC_FAPI2_MASK | 0x02, + ///< HWP requested a chip EC feature with an invalid attribute ID - FAPI2_RC_INVALID_MULTISCOM_LENGTH = FAPI2_RC_FAPI2_MASK | 0x03, - ///< Invalid multiscom parameters + FAPI2_RC_INVALID_MULTISCOM_LENGTH = FAPI2_RC_FAPI2_MASK | 0x03, + ///< Invalid multiscom parameters - FAPI2_RC_INVALID_PARAMETER = FAPI2_RC_FAPI2_MASK | 0x04, - ///< Invalid parameters to a FAPI2 function + FAPI2_RC_INVALID_PARAMETER = FAPI2_RC_FAPI2_MASK | 0x04, + ///< Invalid parameters to a FAPI2 function - FAPI2_RC_OVERFLOW = FAPI2_RC_FAPI2_MASK | 0x05, - ///< Overflow condition, typically a buffer operation + FAPI2_RC_OVERFLOW = FAPI2_RC_FAPI2_MASK | 0x05, + ///< Overflow condition, typically a buffer operation - FAPI2_RC_FALSE = FAPI2_RC_FAPI2_MASK | 0x06, - ///< The logical opposite of SUCCESS. Needed where procedures want - ///< a multi-bool type of operation (e.g., true, false, scom error) + FAPI2_RC_FALSE = FAPI2_RC_FAPI2_MASK | 0x06, + ///< The logical opposite of SUCCESS. Needed where procedures want + ///< a multi-bool type of operation (e.g., true, false, scom error) - // - // PLAT generated return codes. Additional details may be contained in - // ReturnCode platData (this can only be looked at by PLAT code) - // + // + // PLAT generated return codes. Additional details may be contained in + // ReturnCode platData (this can only be looked at by PLAT code) + // - FAPI2_RC_PLAT_ERR_SEE_DATA = FAPI2_RC_PLAT_MASK | 0x01, - ///< Generic platform error + FAPI2_RC_PLAT_ERR_SEE_DATA = FAPI2_RC_PLAT_MASK | 0x01, + ///< Generic platform error - FAPI2_RC_PLAT_ERR_ADU_LOCKED = FAPI2_RC_PLAT_MASK | 0x02, - ///< Operation to AlterDisplay unit failed because it is locked + FAPI2_RC_PLAT_ERR_ADU_LOCKED = FAPI2_RC_PLAT_MASK | 0x02, + ///< Operation to AlterDisplay unit failed because it is locked - FAPI2_RC_PLAT_NOT_SUPPORTED_AT_RUNTIME = FAPI2_RC_PLAT_MASK | 0x03, - ///< Operation not supported by HB runtime - }; + FAPI2_RC_PLAT_NOT_SUPPORTED_AT_RUNTIME = FAPI2_RC_PLAT_MASK | 0x03, + ///< Operation not supported by HB runtime +}; } diff --git a/src/import/hwpf/fapi2/include/target_states.H b/src/import/hwpf/fapi2/include/target_states.H index bebd43d06..7d810db05 100644 --- a/src/import/hwpf/fapi2/include/target_states.H +++ b/src/import/hwpf/fapi2/include/target_states.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/target_states.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* 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 2012,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 */ /** @@ -32,14 +26,14 @@ namespace fapi2 { - /// - /// @brief Enumeration of target state values (bitmask values) - /// - enum TargetState - { - TARGET_STATE_PRESENT = 0x00000001, - TARGET_STATE_FUNCTIONAL = 0x00000002, - }; +/// +/// @brief Enumeration of target state values (bitmask values) +/// +enum TargetState +{ + TARGET_STATE_PRESENT = 0x00000001, + TARGET_STATE_FUNCTIONAL = 0x00000002, +}; } #endif diff --git a/src/import/hwpf/fapi2/src/error_info.C b/src/import/hwpf/fapi2/src/error_info.C index e533b35e7..6572b21be 100644 --- a/src/import/hwpf/fapi2/src/error_info.C +++ b/src/import/hwpf/fapi2/src/error_info.C @@ -1,23 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/src/error_info.C $ */ /* */ -/* 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 */ /** @@ -33,155 +29,155 @@ namespace fapi2 { - /// - /// @brief Constructor - /// - /// @param[in] i_ffdcId FFDC Identifier (used to decode FFDC) - /// @param[in] i_pFfdc Pointer to the FFDC to copy - /// @param[in] i_size Size of the FFDC to copy - /// - ErrorInfoFfdc::ErrorInfoFfdc(const uint32_t i_ffdcId, - const void* i_pFfdc, - const uint32_t i_size): - iv_ffdcId(i_ffdcId), - iv_size(i_size) +/// +/// @brief Constructor +/// +/// @param[in] i_ffdcId FFDC Identifier (used to decode FFDC) +/// @param[in] i_pFfdc Pointer to the FFDC to copy +/// @param[in] i_size Size of the FFDC to copy +/// +ErrorInfoFfdc::ErrorInfoFfdc(const uint32_t i_ffdcId, + const void* i_pFfdc, + const uint32_t i_size): + iv_ffdcId(i_ffdcId), + iv_size(i_size) +{ + iv_pFfdc = std::shared_ptr<uint8_t>(new uint8_t[i_size]()); + + // If they passed us a NULL pointer they want to fill + // in the data themselves later. + if (i_pFfdc != nullptr) { - iv_pFfdc = std::shared_ptr<uint8_t>(new uint8_t[i_size]()); - - // If they passed us a NULL pointer they want to fill - // in the data themselves later. - if (i_pFfdc != nullptr) - { - memcpy(iv_pFfdc.get(), i_pFfdc, i_size); - } + memcpy(iv_pFfdc.get(), i_pFfdc, i_size); } - - /// - /// @brief Constructor. - /// - /// @param[in] i_hw Hardware to callout - /// @param[in] i_calloutPriority Priority of callout - /// @param[in] i_refTarget Reference to reference target - /// - ErrorInfoHwCallout::ErrorInfoHwCallout( - const HwCallouts::HwCallout i_hw, - const CalloutPriorities::CalloutPriority i_calloutPriority, - const Target<TARGET_TYPE_ALL> & i_refTarget): - iv_hw(i_hw), - iv_calloutPriority(i_calloutPriority), - iv_refTarget(i_refTarget) - {} - - /// - /// @brief Constructor. - /// - /// @param[in] i_procedure Procedure to callout - /// @param[in] i_calloutPriority Priority of callout - /// - ErrorInfoProcedureCallout::ErrorInfoProcedureCallout( - const ProcedureCallouts::ProcedureCallout i_procedure, - const CalloutPriorities::CalloutPriority i_calloutPriority): - iv_procedure(i_procedure), - iv_calloutPriority(i_calloutPriority) - {} - - /// - /// @brief Constructor. - /// - /// @param[in] i_target1 Reference to target on one end of the bus - /// @param[in] i_target2 Reference to target on other end of the bus - /// @param[in] i_calloutPriority Priority of callout - /// - ErrorInfoBusCallout::ErrorInfoBusCallout( - const Target<TARGET_TYPE_ALL> & i_target1, - const Target<TARGET_TYPE_ALL> & i_target2, - const CalloutPriorities::CalloutPriority i_calloutPriority): - iv_target1(i_target1), - iv_target2(i_target2), - iv_calloutPriority(i_calloutPriority) - {} - - /// - /// @brief Constructor. - /// - /// @param[in] i_target Reference to the target to c/d/g - /// @param[in] i_callout True if Target should be called out - /// @param[in] i_deconfigure True if Target should be deconfigured - /// @param[in] i_gard True if Target should be GARDed - /// @param[in] i_priority The priority of any callout - /// - ErrorInfoCDG::ErrorInfoCDG( - const Target<TARGET_TYPE_ALL> & i_target, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority): - iv_target(i_target), - iv_callout(i_callout), - iv_calloutPriority(i_priority), - iv_deconfigure(i_deconfigure), - iv_gard(i_gard) - {} - - /// - /// @brief Constructor. - /// - /// @param[in] i_parent Reference to the parent target - /// @oaram[in] i_childType Child target type to c/d/g - /// @param[in] i_callout True if Target should be called out - /// @param[in] i_deconfigure True if Target should be deconfigured - /// @param[in] i_gard True if Target should be GARDed - /// @param[in] i_priority The priority of any callout - /// @param[in] i_childPort Child Port - /// For DIMM children, the MBA port number - /// @param[in] i_childNum Child Number - /// For DIMM children, the dimm socket number - /// For Chip children, the chip position - /// For Chiplet children, the chiplet unit pos - /// - ErrorInfoChildrenCDG::ErrorInfoChildrenCDG( - const Target<TARGET_TYPE_ALL> & i_parentChip, - const TargetType i_childType, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority, - const uint8_t i_childPort, const uint8_t i_childNum): - iv_parent(i_parentChip), - iv_childType(i_childType), - iv_callout(i_callout), - iv_calloutPriority(i_priority), - iv_deconfigure(i_deconfigure), - iv_gard(i_gard), - iv_childPort(i_childPort), - iv_childNumber(i_childNum) - {} - - /// - /// @brief Constructor. - /// - /// @param[in] i_trace - /// - ErrorInfoCollectTrace::ErrorInfoCollectTrace( - CollectTraces::CollectTrace i_traceId): - iv_eiTraceId(i_traceId) - {} - - - /// - /// @brief Collect target, buffer or generic FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryFfdc::addErrorInfo(std::shared_ptr<ErrorInfo> i_info, - const void* const* i_objects) const +} + +/// +/// @brief Constructor. +/// +/// @param[in] i_hw Hardware to callout +/// @param[in] i_calloutPriority Priority of callout +/// @param[in] i_refTarget Reference to reference target +/// +ErrorInfoHwCallout::ErrorInfoHwCallout( + const HwCallouts::HwCallout i_hw, + const CalloutPriorities::CalloutPriority i_calloutPriority, + const Target<TARGET_TYPE_ALL>& i_refTarget): + iv_hw(i_hw), + iv_calloutPriority(i_calloutPriority), + iv_refTarget(i_refTarget) +{} + +/// +/// @brief Constructor. +/// +/// @param[in] i_procedure Procedure to callout +/// @param[in] i_calloutPriority Priority of callout +/// +ErrorInfoProcedureCallout::ErrorInfoProcedureCallout( + const ProcedureCallouts::ProcedureCallout i_procedure, + const CalloutPriorities::CalloutPriority i_calloutPriority): + iv_procedure(i_procedure), + iv_calloutPriority(i_calloutPriority) +{} + +/// +/// @brief Constructor. +/// +/// @param[in] i_target1 Reference to target on one end of the bus +/// @param[in] i_target2 Reference to target on other end of the bus +/// @param[in] i_calloutPriority Priority of callout +/// +ErrorInfoBusCallout::ErrorInfoBusCallout( + const Target<TARGET_TYPE_ALL>& i_target1, + const Target<TARGET_TYPE_ALL>& i_target2, + const CalloutPriorities::CalloutPriority i_calloutPriority): + iv_target1(i_target1), + iv_target2(i_target2), + iv_calloutPriority(i_calloutPriority) +{} + +/// +/// @brief Constructor. +/// +/// @param[in] i_target Reference to the target to c/d/g +/// @param[in] i_callout True if Target should be called out +/// @param[in] i_deconfigure True if Target should be deconfigured +/// @param[in] i_gard True if Target should be GARDed +/// @param[in] i_priority The priority of any callout +/// +ErrorInfoCDG::ErrorInfoCDG( + const Target<TARGET_TYPE_ALL>& i_target, + const bool i_callout, + const bool i_deconfigure, + const bool i_gard, + const CalloutPriorities::CalloutPriority i_priority): + iv_target(i_target), + iv_callout(i_callout), + iv_calloutPriority(i_priority), + iv_deconfigure(i_deconfigure), + iv_gard(i_gard) +{} + +/// +/// @brief Constructor. +/// +/// @param[in] i_parent Reference to the parent target +/// @oaram[in] i_childType Child target type to c/d/g +/// @param[in] i_callout True if Target should be called out +/// @param[in] i_deconfigure True if Target should be deconfigured +/// @param[in] i_gard True if Target should be GARDed +/// @param[in] i_priority The priority of any callout +/// @param[in] i_childPort Child Port +/// For DIMM children, the MBA port number +/// @param[in] i_childNum Child Number +/// For DIMM children, the dimm socket number +/// For Chip children, the chip position +/// For Chiplet children, the chiplet unit pos +/// +ErrorInfoChildrenCDG::ErrorInfoChildrenCDG( + const Target<TARGET_TYPE_ALL>& i_parentChip, + const TargetType i_childType, + const bool i_callout, + const bool i_deconfigure, + const bool i_gard, + const CalloutPriorities::CalloutPriority i_priority, + const uint8_t i_childPort, const uint8_t i_childNum): + iv_parent(i_parentChip), + iv_childType(i_childType), + iv_callout(i_callout), + iv_calloutPriority(i_priority), + iv_deconfigure(i_deconfigure), + iv_gard(i_gard), + iv_childPort(i_childPort), + iv_childNumber(i_childNum) +{} + +/// +/// @brief Constructor. +/// +/// @param[in] i_trace +/// +ErrorInfoCollectTrace::ErrorInfoCollectTrace( + CollectTraces::CollectTrace i_traceId): + iv_eiTraceId(i_traceId) +{} + + +/// +/// @brief Collect target, buffer or generic FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryFfdc::addErrorInfo(std::shared_ptr<ErrorInfo> i_info, + const void* const* i_objects) const +{ + switch(iv_ffdcSize) { - switch(iv_ffdcSize) - { - case EI_FFDC_SIZE_TARGET: + case EI_FFDC_SIZE_TARGET: { Target<TARGET_TYPE_ALL> object = *(static_cast<const Target<TARGET_TYPE_ALL>*> @@ -212,183 +208,183 @@ namespace fapi2 iv_ffdcId, iv_ffdcSize); break; - }; - - return; - } - - /// - /// @brief Collect h/w callout FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryHwCallout::addErrorInfo(std::shared_ptr<ErrorInfo> i_info, - const void* const* i_object) const - { - // If the index is 0xFF, we use an empty target. Otherwise the - // target is taken from the object arrary with the given index. - const fapi2::Target<TARGET_TYPE_ALL> target = - iv_refObjIndex == 0xFF ? - fapi2::Target<TARGET_TYPE_ALL>() : - *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> - (i_object[iv_refObjIndex])); - - ErrorInfoHwCallout* ei = new ErrorInfoHwCallout( - static_cast<HwCallouts::HwCallout>(iv_hw), - static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority), - target); - - FAPI_DBG("addErrorInfo: Adding hw callout target: 0x%lx hw: %d, pri: %d", - ei->iv_refTarget.get(), ei->iv_hw, ei->iv_calloutPriority); - - i_info->iv_hwCallouts.push_back(std::shared_ptr<ErrorInfoHwCallout>(ei)); - } - - /// - /// @brief Collect proc callout FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryProcCallout::addErrorInfo( - std::shared_ptr<ErrorInfo> i_info, - const void* const* ) const - { - ErrorInfoProcedureCallout* ei = new ErrorInfoProcedureCallout( - static_cast<ProcedureCallouts::ProcedureCallout>(iv_procedure), - static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority)); - - // Add the ErrorInfo - FAPI_DBG("addErrorInfo: Adding proc callout, proc: %d, pri: %d", - ei->iv_procedure, ei->iv_calloutPriority); - - i_info->iv_procedureCallouts.push_back( - std::shared_ptr<ErrorInfoProcedureCallout>(ei)); - } - - /// - /// @brief Collect bus callout FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryBusCallout::addErrorInfo( - std::shared_ptr<ErrorInfo> i_info, - const void* const* i_object) const - { - // We need to add a procedure callout as well as a bus callout - ErrorInfoEntryProcCallout(ProcedureCallouts::BUS_CALLOUT, - iv_calloutPriority).addErrorInfo(i_info, - i_object); - - // Now add our bus callout, but drop the priority by one. - ErrorInfoBusCallout* ei = new ErrorInfoBusCallout( - // First target - *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> - (i_object[iv_endpoint1ObjIndex])), - - // Second target - *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> - (i_object[iv_endpoint2ObjIndex])), - - // Priority, one lower. - (iv_calloutPriority == CalloutPriorities::HIGH) ? - CalloutPriorities::MEDIUM : CalloutPriorities::LOW); - - FAPI_DBG("addErrorInfo: Adding bus callout t1: 0x%lx t2: 0x%lx, pri: %d", - ei->iv_target1.get(), ei->iv_target2.get(), - ei->iv_calloutPriority); - - i_info->iv_busCallouts.push_back( - std::shared_ptr<ErrorInfoBusCallout>(ei)); - } + }; - /// - /// @brief Collect h/w target cdg FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryTargetCDG::addErrorInfo( - std::shared_ptr<ErrorInfo> i_info, - const void* const* i_object) const - { - ErrorInfoCDG* ei = new - ErrorInfoCDG( - *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> - (i_object[iv_targetObjIndex])), - iv_callout, - iv_deconfigure, - iv_gard, - static_cast<CalloutPriorities::CalloutPriority> - (iv_calloutPriority) - ); - - FAPI_DBG("addErrorInfo: Adding target 0x%lx cdg (%d:%d:%d), pri: %d", - ei->iv_target.get(), - ei->iv_callout, ei->iv_deconfigure, - ei->iv_gard, ei->iv_calloutPriority); - - // Add the ErrorInfo - i_info->iv_CDGs.push_back(std::shared_ptr<ErrorInfoCDG>(ei)); - } + return; +} - /// - /// @brief Collect h/w children cdg FFDC information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryChildrenCDG::addErrorInfo( - std::shared_ptr<ErrorInfo> i_info, +/// +/// @brief Collect h/w callout FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryHwCallout::addErrorInfo(std::shared_ptr<ErrorInfo> i_info, const void* const* i_object) const - { - ErrorInfoChildrenCDG* ei = new ErrorInfoChildrenCDG( - *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> - (i_object[iv_parentObjIndex])), - static_cast<fapi2::TargetType>(iv_childType), - iv_callout, - iv_deconfigure, - iv_gard, - static_cast<CalloutPriorities::CalloutPriority> - (iv_calloutPriority), - iv_childPort, - iv_childNumber); - - FAPI_DBG("addErrorInfo: Adding children cdg (%d:%d:%d), type:" - " 0x%08x, pri: %d", - ei->iv_callout, ei->iv_deconfigure, ei->iv_gard, - ei->iv_childType, ei->iv_calloutPriority); - - // Add the ErrorInfo - i_info->iv_childrenCDGs.push_back( - std::shared_ptr<ErrorInfoChildrenCDG>(ei)); - } - - /// - /// @brief Collect trace information to this ffdc - /// object - /// @param[in] A pointer to the error info we're collecting - /// @param[in] A pointer to the objects - /// @return void - /// - void ErrorInfoEntryCollectTrace::addErrorInfo( - std::shared_ptr<ErrorInfo> i_info, - const void* const* ) const - { - ErrorInfoCollectTrace* ei = new ErrorInfoCollectTrace( - static_cast<CollectTraces::CollectTrace>(iv_eieTraceId)); +{ + // If the index is 0xFF, we use an empty target. Otherwise the + // target is taken from the object arrary with the given index. + const fapi2::Target<TARGET_TYPE_ALL> target = + iv_refObjIndex == 0xFF ? + fapi2::Target<TARGET_TYPE_ALL>() : + *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> + (i_object[iv_refObjIndex])); + + ErrorInfoHwCallout* ei = new ErrorInfoHwCallout( + static_cast<HwCallouts::HwCallout>(iv_hw), + static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority), + target); + + FAPI_DBG("addErrorInfo: Adding hw callout target: 0x%lx hw: %d, pri: %d", + ei->iv_refTarget.get(), ei->iv_hw, ei->iv_calloutPriority); + + i_info->iv_hwCallouts.push_back(std::shared_ptr<ErrorInfoHwCallout>(ei)); +} + +/// +/// @brief Collect proc callout FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryProcCallout::addErrorInfo( + std::shared_ptr<ErrorInfo> i_info, + const void* const* ) const +{ + ErrorInfoProcedureCallout* ei = new ErrorInfoProcedureCallout( + static_cast<ProcedureCallouts::ProcedureCallout>(iv_procedure), + static_cast<CalloutPriorities::CalloutPriority>(iv_calloutPriority)); + + // Add the ErrorInfo + FAPI_DBG("addErrorInfo: Adding proc callout, proc: %d, pri: %d", + ei->iv_procedure, ei->iv_calloutPriority); + + i_info->iv_procedureCallouts.push_back( + std::shared_ptr<ErrorInfoProcedureCallout>(ei)); +} + +/// +/// @brief Collect bus callout FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryBusCallout::addErrorInfo( + std::shared_ptr<ErrorInfo> i_info, + const void* const* i_object) const +{ + // We need to add a procedure callout as well as a bus callout + ErrorInfoEntryProcCallout(ProcedureCallouts::BUS_CALLOUT, + iv_calloutPriority).addErrorInfo(i_info, + i_object); + + // Now add our bus callout, but drop the priority by one. + ErrorInfoBusCallout* ei = new ErrorInfoBusCallout( + // First target + * (static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> + (i_object[iv_endpoint1ObjIndex])), + + // Second target + * (static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> + (i_object[iv_endpoint2ObjIndex])), + + // Priority, one lower. + (iv_calloutPriority == CalloutPriorities::HIGH) ? + CalloutPriorities::MEDIUM : CalloutPriorities::LOW); + + FAPI_DBG("addErrorInfo: Adding bus callout t1: 0x%lx t2: 0x%lx, pri: %d", + ei->iv_target1.get(), ei->iv_target2.get(), + ei->iv_calloutPriority); + + i_info->iv_busCallouts.push_back( + std::shared_ptr<ErrorInfoBusCallout>(ei)); +} + +/// +/// @brief Collect h/w target cdg FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryTargetCDG::addErrorInfo( + std::shared_ptr<ErrorInfo> i_info, + const void* const* i_object) const +{ + ErrorInfoCDG* ei = new + ErrorInfoCDG( + *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> + (i_object[iv_targetObjIndex])), + iv_callout, + iv_deconfigure, + iv_gard, + static_cast<CalloutPriorities::CalloutPriority> + (iv_calloutPriority) + ); + + FAPI_DBG("addErrorInfo: Adding target 0x%lx cdg (%d:%d:%d), pri: %d", + ei->iv_target.get(), + ei->iv_callout, ei->iv_deconfigure, + ei->iv_gard, ei->iv_calloutPriority); + + // Add the ErrorInfo + i_info->iv_CDGs.push_back(std::shared_ptr<ErrorInfoCDG>(ei)); +} + +/// +/// @brief Collect h/w children cdg FFDC information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryChildrenCDG::addErrorInfo( + std::shared_ptr<ErrorInfo> i_info, + const void* const* i_object) const +{ + ErrorInfoChildrenCDG* ei = new ErrorInfoChildrenCDG( + *(static_cast<const fapi2::Target<TARGET_TYPE_ALL>*> + (i_object[iv_parentObjIndex])), + static_cast<fapi2::TargetType>(iv_childType), + iv_callout, + iv_deconfigure, + iv_gard, + static_cast<CalloutPriorities::CalloutPriority> + (iv_calloutPriority), + iv_childPort, + iv_childNumber); + + FAPI_DBG("addErrorInfo: Adding children cdg (%d:%d:%d), type:" + " 0x%08x, pri: %d", + ei->iv_callout, ei->iv_deconfigure, ei->iv_gard, + ei->iv_childType, ei->iv_calloutPriority); + + // Add the ErrorInfo + i_info->iv_childrenCDGs.push_back( + std::shared_ptr<ErrorInfoChildrenCDG>(ei)); +} + +/// +/// @brief Collect trace information to this ffdc +/// object +/// @param[in] A pointer to the error info we're collecting +/// @param[in] A pointer to the objects +/// @return void +/// +void ErrorInfoEntryCollectTrace::addErrorInfo( + std::shared_ptr<ErrorInfo> i_info, + const void* const* ) const +{ + ErrorInfoCollectTrace* ei = new ErrorInfoCollectTrace( + static_cast<CollectTraces::CollectTrace>(iv_eieTraceId)); - FAPI_DBG("addErrorInfo: Adding trace: 0x%x", ei->iv_eiTraceId); + FAPI_DBG("addErrorInfo: Adding trace: 0x%x", ei->iv_eiTraceId); - // Add the ErrorInfo - i_info->iv_traces.push_back(std::shared_ptr<ErrorInfoCollectTrace>(ei)); - } + // Add the ErrorInfo + i_info->iv_traces.push_back(std::shared_ptr<ErrorInfoCollectTrace>(ei)); +} }; diff --git a/src/import/hwpf/fapi2/src/ffdc.C b/src/import/hwpf/fapi2/src/ffdc.C index efe922ea3..c8115ca5d 100644 --- a/src/import/hwpf/fapi2/src/ffdc.C +++ b/src/import/hwpf/fapi2/src/ffdc.C @@ -1,23 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/src/ffdc.C $ */ /* */ -/* 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 */ /** @@ -32,25 +28,26 @@ namespace fapi2 { - /// - /// @brief Add error information to this ffdc object - /// @param[in] A pointer to a list of objects - /// @param[in] A pointer to the list of entries - /// @param[in] The count of how many entries there are - /// @return void - /// - template<> - void FirstFailureData<ReturnCode>::addErrorInfo( - const void* const* i_pObjects, - const ErrorInfoEntry* i_pEntries, - const uint8_t i_count) +/// +/// @brief Add error information to this ffdc object +/// @param[in] A pointer to a list of objects +/// @param[in] A pointer to the list of entries +/// @param[in] The count of how many entries there are +/// @return void +/// +template<> +void FirstFailureData<ReturnCode>::addErrorInfo( + const void* const* i_pObjects, + const ErrorInfoEntry* i_pEntries, + const uint8_t i_count) +{ + FAPI_DBG("%d entries", i_count); + + for (uint32_t i = 0; i < i_count; i++) { - FAPI_DBG("%d entries", i_count); - for (uint32_t i = 0; i < i_count; i++) - { - i_pEntries[i].addErrorInfo(iv_info, i_pObjects); - } + i_pEntries[i].addErrorInfo(iv_info, i_pObjects); } +} |