diff options
Diffstat (limited to 'import')
-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 |