summaryrefslogtreecommitdiffstats
path: root/src/include/usr/fapi2/target.H
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-03-15 14:05:54 -0500
committerStephen Cprek <smcprek@us.ibm.com>2016-03-17 17:07:13 -0500
commit9f3f94a84015e09b931f30d8912ad8b96ef61d1e (patch)
treeaee619332f2570537d7ef11ce65bd31af0621fa7 /src/include/usr/fapi2/target.H
parent3d120b9df0ca643c6ea553aa5e03386f028a3cbe (diff)
downloadtalos-hostboot-9f3f94a84015e09b931f30d8912ad8b96ef61d1e.tar.gz
talos-hostboot-9f3f94a84015e09b931f30d8912ad8b96ef61d1e.zip
Add Specialized Constructor for SYSTEM fapi2::Targets
HWP writers are defining SYSTEM fapi2::Targets like this: const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM; Which requires us to implement a specialized constructor to handle getting the top level system target when this type of constructor is used To do this we had to delagate the default constructor in fapi2_target.H to point at the constructor that takes in the plat_target_hndl, also a specialized template was added to target.H. In the future this specialized template might move to plat_target.H but this is not yet ready. Change-Id: I10ea0c4fe05487311c29d5996f1f8baa775fa858 Depends-on: Ia7743dc8d3a83b4be361626b1dea57f39e4dd483 Depends-on: Ib0db5ac2b9b5d5f5c2967ff97794493d867fb04b Depends-on: I863eb985f74f347a4e46a9c19449c57c70d6adce RTC:133832 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22062 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/include/usr/fapi2/target.H')
-rw-r--r--src/include/usr/fapi2/target.H28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H
index 615677c90..c11454f2f 100644
--- a/src/include/usr/fapi2/target.H
+++ b/src/include/usr/fapi2/target.H
@@ -49,9 +49,37 @@
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
+namespace PLAT_TARGET
+{
+///
+/// @brief Helper function for specialized system target allows
+/// for the constructor to call targetservice::getTopLevel
+/// @param[in/out] io_handle Reference to TARGETING::Target to assign
+/// iv_handle to.
+/// @return void
+///
+void systemTargCtorHelperFunc(fapi2::plat_target_handle_t& io_handle);
+}
+
namespace fapi2
{
+
+///
+/// @brief Specialization for TARGET_TYPE_SYSTEM targets
+/// for the constructor to call targetservice::getTopLevel
+/// @param[in/out] io_handle Reference to TARGETING::Target to assign
+/// iv_handle to.
+/// @return void
+///
+/// @note the default templated constructor is delagated to constructors
+/// take take in a plat_target_handle_t
+///
+template<> inline fapi2::Target<TARGET_TYPE_SYSTEM, plat_target_handle_t>::Target(plat_target_handle_t v)
+{
+ PLAT_TARGET::systemTargCtorHelperFunc(iv_handle);
+}
+
///
/// @brief Assignment Operator.
/// @tparam K The type of target of which this is called
OpenPOWER on IntegriCloud