From f959f4e65f7366e08153fa06e816ae545b8df1be Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 18 Mar 2016 14:16:41 -0500 Subject: Ensure fapi2::Target honors platform value type. The fapi2::Target template is as follows: template In many places the code was using the default V type instead of preserving the type of the template. As an example: Target getParent(void) const; // old vs Target getParent(void) const; // new With the old variant, a Target is converted to a Target by the getParent() function instead of maintaining the V type. Added associated ecmd release ver-14-4-2-ekbonly for testing Change-Id: Ie613d658c59f5f6d3ce7be95f3b1e816b52582e0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27036 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/include/usr/fapi2/target.H | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/include/usr/fapi2') diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H index 623783acc..940e5b62e 100644 --- a/src/include/usr/fapi2/target.H +++ b/src/include/usr/fapi2/target.H @@ -87,7 +87,9 @@ namespace fapi2 /// @note the default templated constructor is delagated to constructors /// take take in a plat_target_handle_t /// -template<> inline fapi2::Target::Target(plat_target_handle_t v) +template<> +inline Target +::Target(const plat_target_handle_t& v) { PLAT_TARGET::systemTargCtorHelperFunc(iv_handle); } @@ -252,7 +254,7 @@ inline TARGETING::TYPE convertFapi2TypeToTargeting(fapi2::TargetType i_T) /// template template -inline Target Target::getParent(void) const +inline Target Target::getParent(void) const { FAPI_DBG(ENTER_MRK "getParent. Type of parent 0x%08x", T); @@ -530,7 +532,7 @@ inline Target Target::getParent(void) const /// template template< TargetType T> -inline std::vector > +inline std::vector > Target::getChildren(const TargetState i_state) const { @@ -752,7 +754,7 @@ FAPI_DBG(ENTER_MRK "getChildren. Type 0x%08x State:0x%08x", T, i_state); /// template template< TargetType T> -inline std::vector > +inline std::vector > Target::getChildren(const TargetFilter i_filter, const TargetState i_state) const { @@ -826,7 +828,7 @@ inline std::vector > template template inline fapi2::ReturnCodes -Target::getOtherEnd(fapi2::Target& o_target, +Target::getOtherEnd(fapi2::Target& o_target, const TargetState i_state) const { ReturnCodes l_rc; @@ -956,8 +958,8 @@ inline bool Target< K, V >::isFunctional(void) const /// @post The contents of the buffer is replaced with the string /// representation of the target /// -template< TargetType T > -inline void toString(const Target& i_target, char* io_buffer, size_t i_bsize) +template< TargetType T, typename V > +inline void toString(const Target& i_target, char* io_buffer, size_t i_bsize) { TARGETING::ATTR_FAPI_NAME_type l_nameString = {0}; const TARGETING::Target * l_platTarget = @@ -1001,8 +1003,8 @@ inline void toString(const Target& i_target, char* io_buffer, size_t i_bsize) /// @post The contents of the buffer is replaced with the string /// representation of the target /// -template< TargetType T > -inline void toString(const Target *i_target, char* io_buffer, size_t i_bsize) +template< TargetType T, typename V > +inline void toString(const Target *i_target, char* io_buffer, size_t i_bsize) { toString(*i_target, io_buffer, i_bsize); } @@ -1014,8 +1016,8 @@ inline void toString(const Target *i_target, char* io_buffer, size_t i_bsize) /// the desired target /// @return Target the target requested /// -template -inline Target getTarget(uint64_t Ordinal) +template +inline Target getTarget(uint64_t Ordinal) { //@TODO RTC:129517 // For testing -- cgit v1.2.3