diff options
author | Matt K. Light <mklight@us.ibm.com> | 2016-03-03 07:29:50 -0600 |
---|---|---|
committer | Santosh S. Puranik <santosh.puranik@in.ibm.com> | 2016-03-04 07:21:52 -0500 |
commit | f6903effd30e71634678037b67415cda8ef8cf44 (patch) | |
tree | fd86a6995597287aee5e481bf27609718b552412 /import/hwpf | |
parent | 30b78febf6c4a4611d3bd5b0d0ef1260d5b8333c (diff) | |
download | talos-sbe-f6903effd30e71634678037b67415cda8ef8cf44.tar.gz talos-sbe-f6903effd30e71634678037b67415cda8ef8cf44.zip |
new Target::getOtherEnd() that can return failure
Change-Id: I512fddc549d2e79711a8a3eeb62b2fd206cf43b1
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21640
Tested-by: Jenkins Server
Tested-by: Hostboot CI
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21706
Diffstat (limited to 'import/hwpf')
-rw-r--r-- | import/hwpf/fapi2/include/fapi2_target.H | 15 | ||||
-rw-r--r-- | import/hwpf/fapi2/include/plat/target.H | 24 |
2 files changed, 38 insertions, 1 deletions
diff --git a/import/hwpf/fapi2/include/fapi2_target.H b/import/hwpf/fapi2/include/fapi2_target.H index 85a38224..3c80381e 100644 --- a/import/hwpf/fapi2/include/fapi2_target.H +++ b/import/hwpf/fapi2/include/fapi2_target.H @@ -30,6 +30,7 @@ #include <target_types.H> #include <target_states.H> #include <plat_target.H> +#include <return_code_defs.H> namespace fapi2 { @@ -279,6 +280,20 @@ class Target getOtherEnd(const TargetState i_state = TARGET_STATE_FUNCTIONAL) const; /// + /// @brief Get the target at the other end of a bus + /// @tparam T The type of the target on the other end + /// @param[out] o_target A target representing the thing on the other end + /// @param[in] i_state The desired TargetState of the other end + /// @return FAPI2_RC_SUCCESS if OK, platforms will return a non-success + /// ReturnCode in the event of failure + /// @note o_target is only valid if return is FAPI2_RC_SUCCESS + /// + + template<TargetType T> + inline fapi2::ReturnCodes + getOtherEnd(Target<T>& o_target, const TargetState i_state = TARGET_STATE_FUNCTIONAL) const; + + /// /// @brief Copy from a Target<O> to a Target<K> /// @tparam O the target type of the other /// diff --git a/import/hwpf/fapi2/include/plat/target.H b/import/hwpf/fapi2/include/plat/target.H index e948ee42..9298bab0 100644 --- a/import/hwpf/fapi2/include/plat/target.H +++ b/import/hwpf/fapi2/include/plat/target.H @@ -7,7 +7,7 @@ /* */ /* EKB Project */ /* */ -/* COPYRIGHT 2012,2015 */ +/* COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -134,6 +134,28 @@ Target<K, V>::getOtherEnd(const TargetState i_state) const return Target<T>(); } +/// +/// @brief Get the target at the other end of a bus +/// @tparam T The type of the target on the other end +/// @param[out] o_target A target representing the thing on the other end +/// @param[in] i_state The desired TargetState of the other end +/// @return FAPI2_RC_SUCCESS if OK, platforms will return a non-success +/// ReturnCode in the event of failure +/// @note o_target is only valid if return is FAPI2_RC_SUCCESS +/// + +template<TargetType K, typename V> +template<TargetType T> +inline fapi2::ReturnCodes +Target<K, V>::getOtherEnd(Target<T>& o_target, const TargetState i_state) const +{ + // To keep the compiler quiet about unused variables + static_cast<void>(i_state); + + o_target = Target<T>(); + + return FAPI2_RC_SUCCESS; +} /// /// @brief Return the string interpretation of this target |