summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Fenkes <fenkes@de.ibm.com>2018-12-05 16:47:55 +0100
committerSachin Gupta <sgupta2m@in.ibm.com>2019-02-13 21:37:51 -0600
commitb9b668e5916e3310eacb95496cc0792d819b25f0 (patch)
tree78ce2d1f1a4ed46f5c1ad4d5c0536e8acb34b4ea
parent6eb2a4c0f0d838967f29d124ae466b8c1920bf37 (diff)
downloadtalos-sbe-b9b668e5916e3310eacb95496cc0792d819b25f0.tar.gz
talos-sbe-b9b668e5916e3310eacb95496cc0792d819b25f0.zip
FAPI2: Multicast API 1/2: Platform-breaking changes
The Target gains a new template parameter, M, that specifies the multicast type. This is propagated through all affected header files. A new target type is introduced, TARGET_TYPE_MULTICAST, and platform specific assertions put in place to prevent users from creating such targets before the platform supports it. Target also grows a new inline function for updating MC targets. Platforms not supporting MC can provide a dummy implementation. The example platform code in fapi2/include/plat/plat_target.H is updated with minimal example code for platform implementers. Change-Id: Ia0990f26890dc5c719caca608cd134a4964a3acf Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69456 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70866 Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
-rw-r--r--src/hwpf/hw_access.H78
-rw-r--r--src/hwpf/multicast.H54
-rw-r--r--src/hwpf/plat_target.H10
-rw-r--r--src/hwpf/target.H92
-rw-r--r--src/import/hwpf/fapi2/include/error_info_defs.H6
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_hw_access.H78
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_i2c_access.H10
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_multicast.H171
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_target.H78
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_vpd_access.H4
-rw-r--r--src/import/hwpf/fapi2/include/multicast_defs.H (renamed from src/import/hwpf/fapi2/include/fapi2_multicast_defs.H)14
-rw-r--r--src/import/hwpf/fapi2/include/plat/hw_access.H74
-rw-r--r--src/import/hwpf/fapi2/include/plat/target.H78
-rw-r--r--src/import/hwpf/fapi2/include/utils.H6
14 files changed, 268 insertions, 485 deletions
diff --git a/src/hwpf/hw_access.H b/src/hwpf/hw_access.H
index ab17a763..d00304e4 100644
--- a/src/hwpf/hw_access.H
+++ b/src/hwpf/hw_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -105,9 +105,9 @@ namespace fapi2
/// @param[in] i_address SCOM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
+ template< TargetType K, MulticastType M, typename V >
__attribute__((always_inline))
- inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address,
+ inline ReturnCode getScom(const Target<K, M, V>& i_target, const uint64_t i_address,
buffer<uint64_t>& o_data)
{
fapi2::ReturnCode l_rc;
@@ -125,9 +125,9 @@ namespace fapi2
/// @param[in] i_address SCOM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
+ template< TargetType K, MulticastType M, typename V >
__attribute__((always_inline))
- inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address,
+ inline ReturnCode putScom(const Target<K, M, V>& i_target, const uint64_t i_address,
const buffer<uint64_t> i_data)
{
fapi2::ReturnCode l_rc;
@@ -146,8 +146,8 @@ namespace fapi2
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyScom(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode modifyScom(const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const ChipOpModifyMode i_modifyMode)
@@ -196,8 +196,8 @@ __fapi2exit__:
/// @param[in] i_data Buffer that holds data to write into address.
/// @param[in] i_mask Buffer that holds the mask value.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putScomUnderMask( const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putScomUnderMask( const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const buffer<uint64_t> i_mask)
@@ -214,8 +214,8 @@ __fapi2exit__:
/// @param[in] i_address CFAM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& o_data)
{
@@ -234,8 +234,8 @@ __fapi2exit__:
/// @param[in] i_address CFAM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& i_data)
{
@@ -255,8 +255,8 @@ __fapi2exit__:
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode modifyCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t>& i_data,
const ChipOpModifyMode i_modifyMode)
@@ -277,8 +277,8 @@ __fapi2exit__:
/// @param[in] i_ringID Ring ID that will identify the Ring in the image.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putRing(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putRing(const Target<K, M, V>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode = RING_MODE_HEADER_CHECK)
{
@@ -299,8 +299,8 @@ __fapi2exit__:
/// @param[out] o_data Buffer that holds data read from HW target.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode getRing(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& o_data,
const RingMode i_ringMode = 0)
@@ -329,8 +329,8 @@ __fapi2exit__:
/// @param[in] i_modifyMode The modify mode (or/and/xor)
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyRing(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode modifyRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& i_data,
const ChipOpModifyMode i_modifyMode,
@@ -382,8 +382,8 @@ __fapi2exit__:
/// SCOM_BULK_WRITE_MODE operations are not supported due to
/// hardware limitations.
///
- template< TargetType K, typename V >
- fapi2::ReturnCode multiScom (const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ fapi2::ReturnCode multiScom (const Target<K, M, V>& i_target,
MultiScom& io_multiScomObj)
{
}
@@ -436,8 +436,8 @@ __fapi2exit__:
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode getSpy(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data)
{
@@ -446,8 +446,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode getSpy(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const char * const i_spyId,
variable_buffer& o_data)
{
@@ -495,8 +495,8 @@ __fapi2exit__:
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode putSpy(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& i_data)
{
@@ -505,8 +505,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode putSpy(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& i_data)
{
@@ -535,8 +535,8 @@ __fapi2exit__:
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
@@ -546,8 +546,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
@@ -574,8 +574,8 @@ __fapi2exit__:
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
@@ -585,8 +585,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+ template< TargetType K, MulticastType M, typename V >
+ inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const char * const i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
diff --git a/src/hwpf/multicast.H b/src/hwpf/multicast.H
deleted file mode 100644
index 8ec0c4a7..00000000
--- a/src/hwpf/multicast.H
+++ /dev/null
@@ -1,54 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/multicast.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* */
-/* */
-/* 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 */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __FAPI2_MULTICAST__
-#define __FAPI2_MULTICAST__
-
-#include <fapi2_multicast.H>
-
-namespace fapi2
-{
-
-template<MulticastType M, MulticastGroup G, typename V>
-template<MulticastType O, MulticastGroup N>
-inline void Multicast<M, G, V>::updateHandle(V& i_value)
-{
- // Update handle only if multicast bit is set in handle, else we leave the
- // handle unchanged. This enables the same procedure to work with both
- // multicast and unicast targets
- if(i_value.fields.is_multicast)
- {
- // Update the handle to reflect the new multicast type and group
- i_value.fields.chiplet_num = (0x40) | (O << 3) | N;
- }
-}
-
-template<MulticastType M, MulticastGroup G, typename V>
-inline bool Multicast<M, G, V>::isMulticast() const
-{
- return iv_handle.fields.is_multicast;
-}
-
-}
-
-#endif
diff --git a/src/hwpf/plat_target.H b/src/hwpf/plat_target.H
index 1d32dbb8..8606ffa1 100644
--- a/src/hwpf/plat_target.H
+++ b/src/hwpf/plat_target.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,6 +33,7 @@
#include <stdint.h>
#include <target_types.H>
#include <target_states.H>
+#include <multicast_defs.H>
#include <assert.h>
#include <plat_target_parms.H>
#include <vector>
@@ -53,6 +54,13 @@ static const uint8_t PCI0_CHIPLET = 0x0D;
//
namespace fapi2
{
+ template<TargetType K, MulticastType M, typename V>
+ static constexpr void plat_apply_target_limits(void)
+ {
+ static_assert(!(K & TARGET_TYPE_MULTICAST),
+ "Multicast targets are not supported on this platform");
+ }
+
typedef enum plat_target_type
{
PPE_TARGET_TYPE_NONE = 0x00,
diff --git a/src/hwpf/target.H b/src/hwpf/target.H
index 09f5793d..5b746f0e 100644
--- a/src/hwpf/target.H
+++ b/src/hwpf/target.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,7 +33,6 @@
#include <plat_target.H>
#include <plat_target_parms.H>
#include <fapi2_target.H>
-#include <multicast.H>
#include <plat_trace.H>
#include <utils.H>
#include <stdint.h>
@@ -149,8 +148,8 @@ namespace fapi2
/// @param[in] i_right Reference to Target to assign from.
/// @return Reference to 'this' Target
///
- template<TargetType K, typename V>
- Target<K, V>& Target<K, V>::operator=(const Target& i_right)
+ template<TargetType K, MulticastType M, typename V>
+ Target<K, M, V>& Target<K, M, V>::operator=(const Target& i_right)
{
this->iv_handle.value = i_right.iv_handle.value;
return *this;
@@ -162,8 +161,8 @@ namespace fapi2
/// @note Platforms need to define this so that the physical
/// targets are determined to be equivilent rather than just the handles
///
- template<TargetType K, typename V>
- bool Target<K, V>::operator==(const Target& i_right) const
+ template<TargetType K, MulticastType M, typename V>
+ bool Target<K, M, V>::operator==(const Target& i_right) const
{
if (this->iv_handle.value == i_right.iv_handle.value)
return true;
@@ -178,8 +177,8 @@ namespace fapi2
/// @note Platforms need to define this so that the physical
/// targets are determined to be equivilent rather than just the handles
///
- template<TargetType K, typename V>
- bool Target<K, V>::operator!=(const Target& i_right) const
+ template<TargetType K, MulticastType M, typename V>
+ bool Target<K, M, V>::operator!=(const Target& i_right) const
{
if (this->iv_handle.value != i_right.iv_handle.value)
return true;
@@ -190,11 +189,11 @@ namespace fapi2
///
/// @brief Get this target's immediate parent
/// @tparam T The type of the parent
- /// @return Target<T, V> a target representing the parent
+ /// @return Target<T, M, V> a target representing the parent
///
- template<TargetType K, typename V>
+ template<TargetType K, MulticastType M, typename V>
template<TargetType T>
- inline Target<T, V> Target<K, V>::getParent(void) const
+ inline Target<T, M, V> Target<K, M, V>::getParent(void) const
{
constexpr TargetType TARGET_TYPE_PROC_CHILDREN =
TARGET_TYPE_EQ | TARGET_TYPE_PERV | TARGET_TYPE_EX |
@@ -273,23 +272,11 @@ namespace fapi2
{
return static_cast<V>(G_vec_targets[(static_cast<plat_target_handle_t>(get()).getTargetInstance() / CORES_PER_EX) + EX_TARGET_OFFSET]);
}
- }
-
- ///
- /// @brief Get this target's immediate parent - specialization for compound
- // target (PROC_CHIP | CORE | EX)
- /// @tparam T The type of the parent
- /// @return Target<T, plat_target_handle_t> a target representing the parent
- ///
- template<>
- template<TargetType T>
- Target<T, plat_target_handle_t>
- Target<TARGET_TYPE_PROC_CHIP | TARGET_TYPE_CORE | TARGET_TYPE_EX | TARGET_TYPE_PERV,
- plat_target_handle_t>::getParent(void) const
- {
- static_assert(((T == TARGET_TYPE_PROC_CHIP) || (T == TARGET_TYPE_EQ)),
- "Wrong parent target type");
- return static_cast<plat_target_handle_t>(get()).getParent(T);
+ constexpr TargetType TARGET_TYPE_CORE_OR_EX = TARGET_TYPE_CORE | TARGET_TYPE_EX;
+ if((TARGET_TYPE_EQ == T) && ((K & (TARGET_TYPE_CORE_OR_EX)) != TARGET_TYPE_NONE))
+ {
+ return get().getParent(T);
+ }
}
/// @brief Get this target's children - handles EQ/EX/EC conversions
@@ -297,19 +284,19 @@ namespace fapi2
/// @tparam V The plat target handle type
/// @tparam T The type of child
/// @param[in] i_state The desired TargetState of the children
- /// @return std::vector<Target<T, V> > a vector of present/functional
+ /// @return std::vector<Target<T, M, V> > a vector of present/functional
/// children
/// @warning The children are returned in order, ex child[0] is
/// std::vector[0]
- template<TargetType K, typename V>
+ template<TargetType K, MulticastType M, typename V>
template<TargetType T>
- std::vector<Target<T, V>>
- Target<K, V>::getChildren(const TargetState i_state) const
+ std::vector<Target<T, M, V>>
+ Target<K, M, V>::getChildren(const TargetState i_state) const
{
constexpr TargetType L = static_cast<TargetType>(K & ~(TARGET_TYPE_PROC_CHIP));
constexpr plat_target_type_t P = fapiTargetTypeToPlatTargetType<T>();
- static_assert(sizeof(Target<T, V>) == sizeof(plat_target_handle_t),
+ static_assert(sizeof(Target<T, M, V>) == sizeof(plat_target_handle_t),
"Sizes of plat target and FAPI target must match");
static_assert(((L == TARGET_TYPE_EQ) || (L == TARGET_TYPE_EX) || (K == TARGET_TYPE_PROC_CHIP)),
@@ -329,19 +316,19 @@ namespace fapi2
"improper child of fapi2::TARGET_TYPE_EX");
- std::vector<Target<T, V> > l_children;
+ std::vector<Target<T, M, V> > l_children;
static_cast<plat_target_handle_t>(get()).getChildren(K, T, P, i_state, reinterpret_cast<std::vector<plat_target_handle>&>(l_children));
return l_children;
}
// Specialization of getChildren, filtered for the chip target
- template<TargetType K, typename V>
+ template<TargetType K, MulticastType M, typename V>
template<TargetType T>
- std::vector<Target<T, V> >
- Target<K, V>::getChildren(const TargetFilter i_filter,
+ std::vector<Target<T, M, V> >
+ Target<K, M, V>::getChildren(const TargetFilter i_filter,
const TargetState i_state) const
{
- static_assert(sizeof(Target<T, V>) == sizeof(plat_target_handle_t),
+ static_assert(sizeof(Target<T, M, V>) == sizeof(plat_target_handle_t),
"Sizes of plat target and FAPI target must match");
static_assert((K == TARGET_TYPE_PROC_CHIP), "Parent target must be the proc chip");
@@ -361,9 +348,9 @@ namespace fapi2
/// @brief Is the target functional?
/// @return true if target is functional, false if non-functional
///
- template<TargetType K, typename V>
+ template<TargetType K, MulticastType M, typename V>
inline bool
- Target<K, V>::isFunctional(void) const
+ Target<K, M, V>::isFunctional(void) const
{
return static_cast<plat_target_handle_t>(get()).getFunctional();
}
@@ -372,9 +359,9 @@ namespace fapi2
/// @brief Returns the chiplet number for this Target
/// @return The chiplet number
///
- template<TargetType K, typename V>
+ template<TargetType K, MulticastType M, typename V>
inline uint8_t
- Target<K, V>::getChipletNumber(void) const
+ Target<K, M, V>::getChipletNumber(void) const
{
return static_cast<plat_target_handle_t>(iv_handle).fields.chiplet_num;
}
@@ -389,8 +376,8 @@ namespace fapi2
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
- template< TargetType T, typename V >
- inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsize)
+ template< TargetType T, MulticastType M, typename V >
+ inline void toString(const Target<T, M, V>& i_target, char* i_buffer, size_t i_bsize)
{
snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target.get(), T);
}
@@ -399,15 +386,15 @@ namespace fapi2
/// @brief Return the string interpretation of this target
/// @tparam T The type of the target
/// @tparam B The type of the buffer
- /// @param[in] A pointer to the Target<T, V>
+ /// @param[in] A pointer to the Target<T, M, V>
/// @param[in] i_buffer buffer to write in to
/// @param[in] i_bsize size of the buffer
/// @return void
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
- template< TargetType T, typename V >
- inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsize)
+ template< TargetType T, MulticastType M, typename V >
+ inline void toString(const Target<T, M, V>* i_target, char* i_buffer, size_t i_bsize)
{
snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target->get(), T);
}
@@ -417,14 +404,17 @@ namespace fapi2
/// @tparam T The type of the target
/// @param[in] Ordinal representing the ordinal number of
/// the desired target
- /// @return Target<T, V> the target requested
+ /// @return Target<T, M, V> the target requested
///
- template<TargetType T, typename V>
- inline Target<T, V> getTarget(uint64_t Ordinal)
+ template<TargetType T, MulticastType M, typename V>
+ inline Target<T, M, V> getTarget(uint64_t Ordinal)
{
// For testing
- return Target<T, V>(Ordinal);
+ return Target<T, M, V>(Ordinal);
}
+
+ template<TargetType T, MulticastType M, typename V>
+ inline void Target<T, M, V>::mcUpdateHandle() {};
}
#endif
diff --git a/src/import/hwpf/fapi2/include/error_info_defs.H b/src/import/hwpf/fapi2/include/error_info_defs.H
index c9ff6fc6..7871c99b 100644
--- a/src/import/hwpf/fapi2/include/error_info_defs.H
+++ b/src/import/hwpf/fapi2/include/error_info_defs.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -393,8 +393,8 @@ inline uint16_t getErrorInfoFfdcSize(const T*)
///
/// @brief Get FFDC Size specialization for fapi2::Target
///
-template<fapi2::TargetType T, typename V>
-inline uint16_t getErrorInfoFfdcSize(const fapi2::Target<T, V>&)
+template<fapi2::TargetType T, MulticastType M, typename V>
+inline uint16_t getErrorInfoFfdcSize(const fapi2::Target<T, M, V>&)
{
return EI_FFDC_SIZE_TARGET;
}
diff --git a/src/import/hwpf/fapi2/include/fapi2_hw_access.H b/src/import/hwpf/fapi2/include/fapi2_hw_access.H
index ee415f3b..9cb5b983 100644
--- a/src/import/hwpf/fapi2/include/fapi2_hw_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_hw_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -85,8 +85,8 @@ inline OpModes getOpMode(void);
/// @param[in] i_address SCOM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getScom(const Target<K, M, V>& i_target, const uint64_t i_address,
buffer<uint64_t>& o_data);
/// @brief Writes a SCOM register on a chip.
@@ -95,8 +95,8 @@ inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address
/// @param[in] i_address SCOM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putScom(const Target<K, M, V>& i_target, const uint64_t i_address,
const buffer<uint64_t> i_data);
/// @brief Writes a SCOM register under mask on a chip
@@ -106,8 +106,8 @@ inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address
/// @param[in] i_data Buffer that holds data to write into address.
/// @param[in] i_mask Buffer that holds the mask value.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putScomUnderMask(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putScomUnderMask(const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const buffer<uint64_t> i_mask);
@@ -119,8 +119,8 @@ inline ReturnCode putScomUnderMask(const Target<K, V>& i_target,
/// @param[in] i_address CFAM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& o_data);
@@ -131,8 +131,8 @@ inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_address CFAM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t> i_data);
@@ -144,8 +144,8 @@ inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode modifyCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t> i_data,
const ChipOpModifyMode i_modifyMode);
@@ -156,8 +156,8 @@ inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_ringID Ring ID that will identify the Ring in the image.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-ReturnCode putRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+ReturnCode putRing(const Target<K, M, V>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode = RING_MODE_HEADER_CHECK);
@@ -170,8 +170,8 @@ ReturnCode putRing(const Target<K, V>& i_target,
/// @param[out] o_data Buffer that holds data read from HW target.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& o_data,
const RingMode i_ringMode = RING_MODE_HEADER_CHECK);
@@ -185,8 +185,8 @@ inline ReturnCode getRing(const Target<K, V>& i_target,
/// @param[in] i_modifyMode The modify mode (or/and/xor)
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode modifyRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode modifyRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
const variable_buffer& i_data,
const ChipOpModifyMode i_modifyMode,
@@ -242,8 +242,8 @@ inline ReturnCode modifyRing(const Target<K, V>& i_target,
#define FAPI_GET_SPY(TARGET, ID, DATA) fapi2::getSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA)
-template< TargetType K, typename V >
-inline ReturnCode getSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data);
@@ -258,8 +258,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
#define FAPI_GET_SPY(TARGET, ID, DATA) fapi2::getSpy(TARGET, #ID, DATA)
-template< TargetType K, typename V >
-inline ReturnCode getSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& o_data);
@@ -313,8 +313,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
#define FAPI_PUT_SPY(TARGET, ID, DATA) fapi2::putSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA)
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data);
#endif
@@ -323,19 +323,19 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
#define FAPI_PUT_SPY(TARGET, ID, DATA) fapi2::putSpy(TARGET, #ID, DATA)
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data);
-template<TargetType K, typename V >
-inline ReturnCode putSpyWithCare(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyWithCare(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
const variable_buffer& i_care);
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
const char* i_enum);
#endif
@@ -366,8 +366,8 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
fapi2::putSpyImage(TARGET, FAPI_SPY_NAMES::ID.value, \
DATA1, DATA2)
-template< TargetType K, typename V >
-inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData);
@@ -378,8 +378,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
#define FAPI_PUT_SPY_IMAGE(TARGET, ID, DATA1, DATA2) \
fapi2::putSpyImage(TARGET, #ID, DATA1,DATA2)
-template< TargetType K, typename V >
-inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData);
@@ -408,8 +408,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
fapi2:getSpyImage(TARGET, FAPI_SPY_NAMES::ID.value, \
DATA1, DATA2)
-template< TargetType K, typename V >
-inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData);
@@ -420,8 +420,8 @@ inline ReturnCode getSpyImage(const Target<K, V>& i_target,
#define FAPI_GET_SPY_IMAGE(TARGET, ID, DATA1, DATA2) \
fapi2::getSpyImage(TARGET, #ID, DATA1,DATA2)
-template< TargetType K, typename V >
-inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData);
diff --git a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
index 20d04b9e..a4f0eebe 100644
--- a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -66,8 +66,8 @@ namespace fapi2
/// before the read.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getI2c(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getI2c(const Target<K, M, V>& i_target,
const size_t i_get_size,
const std::vector<uint8_t>& i_data,
std::vector<uint8_t>& o_data);
@@ -87,8 +87,8 @@ inline ReturnCode getI2c(const Target<K, V>& i_target,
/// @param[in] i_target HW target to operate on.
/// @param[in] i_data Buffer that holds data to write to the HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putI2c(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putI2c(const Target<K, M, V>& i_target,
const std::vector<uint8_t>& i_data);
};
diff --git a/src/import/hwpf/fapi2/include/fapi2_multicast.H b/src/import/hwpf/fapi2/include/fapi2_multicast.H
deleted file mode 100644
index 531b7561..00000000
--- a/src/import/hwpf/fapi2/include/fapi2_multicast.H
+++ /dev/null
@@ -1,171 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/hwpf/fapi2/include/fapi2_multicast.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* 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 */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-///
-/// @file fapi2_multicast.H
-/// @brief Common definitions for fapi2 multicast target value wrapper class
-///
-
-#ifndef __FAPI2_COMMON_MULTICAST__
-#define __FAPI2_COMMON_MULTICAST__
-
-#include <target.H>
-#include <fapi2_multicast_defs.H>
-
-namespace fapi2
-{
-
-///
-/// @brief Class representing a FAPI2 Multicast target value wrapper
-/// @tparam M the type of multicast operation
-/// @tparam G the type of multicast group
-/// @tparam V the type of the target's Value this class is wrapping
-/// @remark This wrapper class defines how a handle will behave by
-/// type and group if internal to the handle mulitcast operation
-/// is enabled. If the handle used is not multicast enabled most
-/// function of this class will be ignored.
-///
-template<MulticastType M, MulticastGroup G, typename V = plat_target_handle_t >
-class Multicast
-{
- public:
- ///
- /// @brief Delagate default constructor to constructor
- /// that takes in a value as a param
- ///
- Multicast() : Multicast(V()) {}
-
- ///
- /// @brief Create a Multicast value with a target value
- /// @param[in] value the value (i.e., specific element this
- /// target represents, or pointer)
- /// @note Platforms can will update the handle value with
- /// information on the multicast type and group
- ///
- Multicast(const V& value) : iv_handle(value)
- {
- updateHandle<M, G>(iv_handle);
- }
-
- ///
- /// @brief Create a Multicast value from another Multicast value
- /// @param[in] other the value
- /// @note Platforms can will update the handle value with
- /// information on the multicast type and group
- ///
- template<MulticastType O, MulticastGroup N>
- Multicast(const Multicast<O, N> other) :
- iv_handle(static_cast<V>(other))
- {
- updateHandle<M, G>(iv_handle);
- }
-
- ///
- /// @brief Get the handle as a V
- /// @return V The Multicast wrapper's internal handle, or value
- ///
- inline operator V() const
- {
- return iv_handle;
- }
-
- ///
- /// @brief Get the handle as a V
- /// @return V The Multicast wrapper's internal handle, or value
- ///
- inline V& operator()() const
- {
- return iv_handle;
- }
-
- ///
- /// @brief Has the handle been enabled for multicast operation
- /// @return Return true if multicast, false otherwise
- ///
- inline bool isMulticast() const;
-
- private:
- ///
- /// @brief update the handle with group and type given
- /// @tparam O the type of multicast operation
- /// @tparam N the type of multicast group
- /// @param[in] Value the value/handle
- ///
- template<MulticastType O, MulticastGroup N>
- inline void updateHandle(V& value);
-
- V iv_handle;
-};
-
-// multicast from unicast
-template<MulticastType M, MulticastGroup G, TargetType K, typename V>
-inline Target<K, Multicast<M, G, V>> make_multicast(const Target<K, V>& t)
-{
- return Target<K, Multicast<M, G, V>>(t.get());
-}
-
-// multicast from multicast -- changing type
-template<MulticastType M, MulticastType N, MulticastGroup G, TargetType K, typename V>
-inline Target<K, Multicast<M, G, V>> make_multicast(const Target<K, Multicast<N, G, V>>& t)
-{
- return Target<K, Multicast<M, G, V>>(t.get());
-}
-
-// multicast from multicast -- changing type and group
-template<MulticastType M, MulticastGroup O, MulticastType N, MulticastGroup G, TargetType K, typename V>
-inline Target<K, Multicast<M, O, V>> make_multicast(const Target<K, Multicast<N, G, V>>& t)
-{
- return Target<K, Multicast<M, O, V>>(t.get());
-}
-
-// unicast from multicast
-template<MulticastType M, MulticastGroup G, TargetType K, typename V>
-inline Target<K, V> make_unicast(const Target<K, Multicast<M, G, V>>& t)
-{
- return Target<K, V>(t.get());
-}
-
-// test if a multicast target
-template<MulticastType M, MulticastGroup G, TargetType K, typename V>
-inline bool is_multicast(const Target<K, Multicast<M, G, V>>& t)
-{
- const Multicast<M, G, V>& l_mref = t;
- return l_mref.isMulticast();
-}
-
-// return false if testing a non-multicast target
-template<TargetType K, typename V>
-inline bool is_multicast(const Target<K, V>& t)
-{
- return false;
-}
-
-template<MulticastType M1, MulticastType M2>
-constexpr bool is_same()
-{
- return (M1 == M2);
-}
-}
-
-#endif
diff --git a/src/import/hwpf/fapi2/include/fapi2_target.H b/src/import/hwpf/fapi2/include/fapi2_target.H
index 6f2c6793..4d9f6963 100644
--- a/src/import/hwpf/fapi2/include/fapi2_target.H
+++ b/src/import/hwpf/fapi2/include/fapi2_target.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,6 +37,7 @@
#include <vector>
#include <target_types.H>
#include <target_states.H>
+#include <multicast_defs.H>
#include <plat_target.H>
#include <return_code_defs.H>
@@ -44,8 +45,18 @@ namespace fapi2
{
///
+/// @brief Apply any platform specific static assertions to target construction
+/// @tparam K the type of target to be constructed
+/// @tparam M the multicast type of the target to be constructed
+/// @tparam V the value type of the target to be constructed
+///
+template<TargetType K, MulticastType M, typename V>
+static constexpr void plat_apply_target_limits(void);
+
+///
/// @brief Class representing a FAPI2 Target
/// @tparam K the type (Kind) of target
+/// @tparam M the type of multicast operation if it's a multicast target
/// @tparam V the type of the target's Value
/// @remark TargetLite targets are uint64_t, Targets
/// are uintptr_t (void*).
@@ -102,7 +113,7 @@ namespace fapi2
/// fapi2::Target<fapi2::TARGET_TYPE_ABUS_ENDPOINT> E;
/// takesProcOrMembuf( E );
/// @endcode
-template<TargetType K, typename V = plat_target_handle_t>
+template<TargetType K, MulticastType M = MULTICAST_OR, typename V = plat_target_handle_t>
class Target
{
public:
@@ -112,7 +123,9 @@ class Target
/// that takes in a value as a param
///
Target(): Target(V())
- {};
+ {
+ plat_apply_target_limits<K, M, V>();
+ };
///
/// @brief Create a Target, with a value
@@ -124,7 +137,9 @@ class Target
///
Target(const V& Value):
iv_handle(Value)
- {};
+ {
+ plat_apply_target_limits<K, M, V>();
+ };
///
@@ -203,7 +218,7 @@ class Target
/// @return Target<T> a target representing the parent
///
template< TargetType T >
- inline Target<T, V> getParent(void) const;
+ inline Target<T, M, V> getParent(void) const;
///
/// @brief Is this target a chip?
@@ -277,7 +292,7 @@ class Target
/// in order. That is, core 0 is std::vector[0].
///
template< TargetType T>
- inline std::vector<Target<T, V> >
+ inline std::vector<Target<T, M, V> >
getChildren(const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
///
@@ -289,7 +304,7 @@ class Target
/// children
///
template< TargetType T>
- inline std::vector<Target<T, V> >
+ inline std::vector<Target<T, M, V> >
getChildren(const TargetFilter i_filter,
const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
@@ -305,7 +320,7 @@ class Target
template<TargetType T>
inline fapi2::ReturnCodes
- getOtherEnd(Target<T, V>& o_target, const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
+ getOtherEnd(Target<T, M, V>& o_target, const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
///
/// @brief Is the target functional?
@@ -329,10 +344,12 @@ class Target
/// @brief Copy from a Target<O> to a Target<K>
/// @tparam O the target type of the other
///
- template<TargetType O, typename VO>
- inline Target( const Target<O, VO>& Other ):
- Target<K, V>(Other.get())
+ template<TargetType O, MulticastType MO, typename VO>
+ inline Target( const Target<O, MO, VO>& Other ):
+ Target<K, M, V>(Other.get())
{
+ plat_apply_target_limits<K, M, V>();
+
// In case of recursion depth failure, use -ftemplate-depth=
static_assert( (K & O) != 0,
"unable to cast Target, no shared types");
@@ -347,6 +364,8 @@ class Target
static const TargetType iv_type = K;
V iv_handle;
+ /// @brief if iv_handle is a multicast target, update its multicast type to M
+ inline void mcUpdateHandle();
};
// EX threads map to CORE threads:
@@ -475,8 +494,8 @@ inline uint8_t thread_bitset_f2n(const uint8_t i_ordinal, const uint8_t i_thread
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsize);
+template< TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>& i_target, char* i_buffer, size_t i_bsize);
///
/// @brief Return the string interpretation of this target
@@ -489,8 +508,8 @@ inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsiz
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsize);
+template< TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>* i_target, char* i_buffer, size_t i_bsize);
///
/// @brief Get an enumerated target of a specific type
@@ -499,28 +518,8 @@ inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsiz
/// the desired target
/// @return Target<T> the target requested
///
-template<TargetType T, typename V = plat_target_handle_t>
-inline Target<T, V> getTarget(uint64_t Ordinal);
-
-// Why has the been removed? For starters, the API name
-// is probably wrong as it's already been confused with
-// Target::getChildren(). And if I'm going to change it
-// I really want to see if we need it. I'm still not
-// clear on whether we're alloing this traversal or not.
-#if 0
-///
-/// @brief Get the base target's children
-/// @tparam T The type of the target
-/// @return std::vector<Target<T,V>> a vector of present/functional
-/// children
-///
-template<TargetType T, typename V>
-inline std::vector<Target<T, V>> getChildren()
-{
- // For testing
- return {Target<T, V>(), Target<T, V>()};
-}
-#endif
+template<TargetType T, MulticastType M = MULTICAST_OR, typename V = plat_target_handle_t>
+inline Target<T, M, V> getTarget(uint64_t Ordinal);
///
/// @brief Return the string interpretation of this target
@@ -532,8 +531,8 @@ inline std::vector<Target<T, V>> getChildren()
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template<TargetType T, typename V, typename B>
-inline void toString(const Target<T, V>& i_target, B& i_buffer);
+template<TargetType T, MulticastType M, typename V, typename B>
+inline void toString(const Target<T, M, V>& i_target, B& i_buffer);
///
/// @brief Check if the target is of a type, or in a type subset.
@@ -546,6 +545,7 @@ inline constexpr bool is_same(void)
{
return (K & T) != 0;
}
+
}
#endif
diff --git a/src/import/hwpf/fapi2/include/fapi2_vpd_access.H b/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
index d71a2195..514acbc5 100644
--- a/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
@@ -145,8 +145,8 @@ class VPDInfo<TARGET_TYPE_OCMB_CHIP>
/// FAPI_TRY(getVPD( mcs, vpdInfo, blob ));
/// blob now contains the VPD data for the MCS.
///
-template<TargetType T, typename V>
-ReturnCode getVPD(const Target<T, V>& i_target,
+template<TargetType T, MulticastType M, typename V>
+ReturnCode getVPD(const Target<T, M, V>& i_target,
VPDInfo<T>& io_vpd_info,
uint8_t* o_blob);
diff --git a/src/import/hwpf/fapi2/include/fapi2_multicast_defs.H b/src/import/hwpf/fapi2/include/multicast_defs.H
index 04ed978a..943625d7 100644
--- a/src/import/hwpf/fapi2/include/fapi2_multicast_defs.H
+++ b/src/import/hwpf/fapi2/include/multicast_defs.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/import/hwpf/fapi2/include/fapi2_multicast_defs.H $ */
+/* $Source: src/import/hwpf/fapi2/include/multicast_defs.H $ */
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -29,11 +29,11 @@ namespace fapi2
{
enum MulticastType
{
- MULTICAST_WRITE,
- MULTICAST_READAND,
- MULTICAST_READOR,
- MULTICAST_READBITX,
- MULTICAST_READCOMPARE,
+ // Code points picked according to PCB spec
+ MULTICAST_OR = 0,
+ MULTICAST_AND = 1,
+ MULTICAST_BITX = 2,
+ MULTICAST_COMPARE = 4,
};
typedef uint32_t MulticastGroup;
diff --git a/src/import/hwpf/fapi2/include/plat/hw_access.H b/src/import/hwpf/fapi2/include/plat/hw_access.H
index bd202809..cf945fd9 100644
--- a/src/import/hwpf/fapi2/include/plat/hw_access.H
+++ b/src/import/hwpf/fapi2/include/plat/hw_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -102,8 +102,8 @@ inline OpModes getOpMode(void)
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
///
-template< TargetType K, typename V >
-inline ReturnCode getScom(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getScom(const Target<K, M, V>& i_target,
const uint64_t i_address,
buffer<uint64_t>& o_data)
{
@@ -124,8 +124,8 @@ inline ReturnCode getScom(const Target<K, V>& i_target,
/// @param[in] i_address SCOM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putScom(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putScom(const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data)
{
@@ -145,8 +145,8 @@ inline ReturnCode putScom(const Target<K, V>& i_target,
/// @param[in] i_data Buffer that holds data to write into address.
/// @param[in] i_mask Buffer that holds the mask value.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putScomUnderMask(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putScomUnderMask(const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const buffer<uint64_t> i_mask)
@@ -170,8 +170,8 @@ inline ReturnCode putScomUnderMask(const Target<K, V>& i_target,
/// @param[out] o_data 32-bit buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
///
-template< TargetType K, typename V >
-inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& o_data)
{
@@ -194,8 +194,8 @@ inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
/// @param[out] i_data 32-bit buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
///
-template< TargetType K, typename V >
-inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t> i_data)
{
@@ -219,8 +219,8 @@ inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
///
-template< TargetType K, typename V >
-inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode modifyCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t> i_data,
const fapi2::ChipOpModifyMode i_modifyMode)
@@ -242,8 +242,8 @@ inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_ringID Ring ID that will identify the Ring in the image.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-ReturnCode putRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+ReturnCode putRing(const Target<K, M, V>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode)
{
@@ -269,8 +269,8 @@ ReturnCode putRing(const Target<K, V>& i_target,
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
///
-template< TargetType K, typename V >
-inline ReturnCode getRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& o_data,
const RingMode i_ringMode)
@@ -297,8 +297,8 @@ inline ReturnCode getRing(const Target<K, V>& i_target,
/// @param[in] i_modifyMode The modify mode (or/and/xor)
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode modifyRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode modifyRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
const variable_buffer& i_data,
const ChipOpModifyMode i_modifyMode,
@@ -364,8 +364,8 @@ inline ReturnCode modifyRing(const Target<K, V>& i_target,
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
-template< TargetType K, typename V >
-inline ReturnCode getSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data)
{
@@ -384,8 +384,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
-template< TargetType K, typename V >
-inline ReturnCode getSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& o_data)
{
@@ -443,8 +443,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data)
{
@@ -453,8 +453,8 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data)
{
@@ -462,8 +462,8 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
return ~FAPI2_RC_SUCCESS;
}
-template< TargetType K, typename V >
-inline ReturnCode putSpy(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
const char* i_enum)
{
@@ -492,8 +492,8 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
-template< TargetType K, typename V >
-inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
@@ -503,8 +503,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
-template< TargetType K, typename V >
-inline ReturnCode putSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
@@ -531,8 +531,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
-template< TargetType K, typename V >
-inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
@@ -542,8 +542,8 @@ inline ReturnCode getSpyImage(const Target<K, V>& i_target,
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
-template< TargetType K, typename V >
-inline ReturnCode getSpyImage(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
diff --git a/src/import/hwpf/fapi2/include/plat/target.H b/src/import/hwpf/fapi2/include/plat/target.H
index 2604b980..62e57f8d 100644
--- a/src/import/hwpf/fapi2/include/plat/target.H
+++ b/src/import/hwpf/fapi2/include/plat/target.H
@@ -32,19 +32,28 @@
#include <plat_target.H>
#include <fapi2_target.H>
-#include <multicast.H>
#include <stdio.h>
namespace fapi2
{
+template<TargetType K, MulticastType M, typename V>
+static constexpr void plat_apply_target_limits(void)
+{
+ static_assert(!(K & TARGET_TYPE_MULTICAST),
+ "Multicast targets are not supported on this platform");
+}
+
+template<TargetType T, MulticastType M, typename V>
+inline void Target<T, M, V>::mcUpdateHandle() {};
+
///
/// @brief Assignment Operator.
/// @param[in] i_right Reference to Target to assign from.
/// @return Reference to 'this' Target
///
-template<TargetType K, typename V>
-Target<K, V>& Target<K, V>::operator=(const Target& i_right)
+template<TargetType K, MulticastType M, typename V>
+Target<K, M, V>& Target<K, M, V>::operator=(const Target& i_right)
{
iv_handle = i_right.iv_handle;
return *this;
@@ -57,8 +66,8 @@ Target<K, V>& Target<K, V>::operator=(const Target& i_right)
/// @note Platforms need to define this so that the physical
/// targets are determined to be equivilent rather than just the handles
///
-template<TargetType K, typename V>
-bool Target<K, V>::operator==(const Target& i_right) const
+template<TargetType K, MulticastType M, typename V>
+bool Target<K, M, V>::operator==(const Target& i_right) const
{
return i_right.iv_handle == iv_handle;
}
@@ -70,8 +79,8 @@ bool Target<K, V>::operator==(const Target& i_right) const
/// @note Platforms need to define this so that the physical
/// targets are determined to be equivilent rather than just the handles
///
-template<TargetType K, typename V>
-bool Target<K, V>::operator!=(const Target& i_right) const
+template<TargetType K, MulticastType M, typename V>
+bool Target<K, M, V>::operator!=(const Target& i_right) const
{
return i_right.iv_handle != iv_handle;
}
@@ -83,8 +92,8 @@ bool Target<K, V>::operator!=(const Target& i_right) const
/// @note Platforms need to define this so that the physical
/// targets are determined to be less than rather than just the handles
///
-template<TargetType K, typename V>
-bool Target<K, V>::operator<(const Target& i_right) const
+template<TargetType K, MulticastType M, typename V>
+bool Target<K, M, V>::operator<(const Target& i_right) const
{
return i_right.iv_handle < iv_handle;
}
@@ -94,12 +103,12 @@ bool Target<K, V>::operator<(const Target& i_right) const
/// @tparam T The type of the parent
/// @return Target<T> a target representing the parent
///
-template<TargetType K, typename V>
+template<TargetType K, MulticastType M, typename V>
template<TargetType T>
-inline Target<T, V> Target<K, V>::getParent(void) const
+inline Target<T, M, V> Target<K, M, V>::getParent(void) const
{
// For testing
- return Target<T, V>(iv_handle);
+ return Target<T, M, V>(iv_handle);
}
///
@@ -111,15 +120,15 @@ inline Target<T, V> Target<K, V>::getParent(void) const
/// @warning The children of EX's (cores) are expected to be returned
/// in order. That is, core 0 is std::vector[0].
///
-template<TargetType K, typename V>
-template< TargetType T>
-inline std::vector<Target<T, V> >
-Target<K, V>::getChildren(const TargetState i_state) const
+template<TargetType K, MulticastType M, typename V>
+template<TargetType T>
+inline std::vector<Target<T, M, V> >
+Target<K, M, V>::getChildren(const TargetState i_state) const
{
// To keep the compiler quiet about unused variables
static_cast<void>(i_state);
// For testing
- return {Target<T, V>(), Target<T, V>()};
+ return {Target<T, M, V>(), Target<T, M, V>()};
}
// Specialization of getChildren, filtered for pervasive targets.
template<>
@@ -146,16 +155,16 @@ Target<TARGET_TYPE_PERV>::getChildren(const TargetFilter i_filter,
/// @note o_target is only valid if return is FAPI2_RC_SUCCESS
///
-template<TargetType K, typename V>
+template<TargetType K, MulticastType M, typename V>
template<TargetType T>
inline fapi2::ReturnCodes
-Target<K, V>::getOtherEnd(Target<T, V>& o_target,
- const TargetState i_state) const
+Target<K, M, V>::getOtherEnd(Target<T, M, V>& o_target,
+ const TargetState i_state) const
{
// To keep the compiler quiet about unused variables
static_cast<void>(i_state);
- o_target = Target<T, V>();
+ o_target = Target<T, M, V>();
return FAPI2_RC_SUCCESS;
}
@@ -165,9 +174,9 @@ Target<K, V>::getOtherEnd(Target<T, V>& o_target,
/// @return true if target is functional, false if non-functional
///
-template<TargetType K, typename V>
+template<TargetType K, MulticastType M, typename V>
inline bool
-Target<K, V>::isFunctional(void) const
+Target<K, M, V>::isFunctional(void) const
{
// Platform check if target is good
// Could check ATTR_FUNCTIONAL or ATTR_PG_*
@@ -181,9 +190,9 @@ Target<K, V>::isFunctional(void) const
/// @note For logical targets such as the EX, the chiplet number of
/// their immediate parent chiplet is returned
///
-template<TargetType K, typename V>
+template<TargetType K, MulticastType M, typename V>
inline uint8_t
-Target<K, V>::getChipletNumber(void) const
+Target<K, M, V>::getChipletNumber(void) const
{
// Platform can return the chiplet number stored in it's Target handle
return 0;
@@ -199,11 +208,11 @@ Target<K, V>::getChipletNumber(void) const
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>& i_target,
+template<TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>& i_target,
char* i_buffer, size_t i_bsize)
{
- snprintf(i_buffer, i_bsize, "Target 0x%lX/0x%.16lX", i_target.get(), T);
+ snprintf(i_buffer, i_bsize, "Target 0x%lX/0x%.16lX/0x%X", i_target.get(), T, M);
}
///
@@ -217,11 +226,11 @@ inline void toString(const Target<T, V>& i_target,
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>* i_target,
+template< TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>* i_target,
char* i_buffer, size_t i_bsize)
{
- snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target->get(), T);
+ toString(*i_target, i_buffer, i_bsize);
}
///
@@ -231,12 +240,13 @@ inline void toString(const Target<T, V>* i_target,
/// the desired target
/// @return Target<T> the target requested
///
-template<TargetType T, typename V>
-inline Target<T, V> getTarget(uint64_t Ordinal)
+template<TargetType T, MulticastType M, typename V>
+inline Target<T, M, V> getTarget(uint64_t Ordinal)
{
// For testing
- return Target<T, V>(Ordinal);
+ return Target<T, M, V>(Ordinal);
}
+
}
#endif
diff --git a/src/import/hwpf/fapi2/include/utils.H b/src/import/hwpf/fapi2/include/utils.H
index c45e410c..5fb1beed 100644
--- a/src/import/hwpf/fapi2/include/utils.H
+++ b/src/import/hwpf/fapi2/include/utils.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -102,8 +102,8 @@ void endian_swap(T& io_input)
/// @return ReturnCode. FAPI2_RC_SUCCESS on success, else platform specified error.
///
///
-template<TargetType T, typename V>
-inline ReturnCode specialWakeup(const Target<T, V>& i_target,
+template<TargetType T, MulticastType M, typename V>
+inline ReturnCode specialWakeup(const Target<T, M, V>& i_target,
const bool i_enable)
{
// enforce the allowed target types
OpenPOWER on IntegriCloud