summaryrefslogtreecommitdiffstats
path: root/src/include/usr/targeting/common
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2018-02-13 10:46:34 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-09 16:36:24 -0400
commit519b09db143e87b3d43f39790486f6c5dc1be96b (patch)
treef065d8dfdd170952d0d633c0e0f1d322b43a2fe6 /src/include/usr/targeting/common
parent093052dd5cfac9e8c8d048eb5cf77223debf7e9d (diff)
downloadtalos-hostboot-519b09db143e87b3d43f39790486f6c5dc1be96b.tar.gz
talos-hostboot-519b09db143e87b3d43f39790486f6c5dc1be96b.zip
Support multiple nodes in HBRT - Concurrent Code Update
Enable HBRT to prepare for a concurrent code update on a multiple node system. Modify preparation function called by Host to loop through all nodes on the system. Make additional updates to go from supporting only a single node to supporting multiple nodes. Change-Id: I2d72b26abf40812641815051b968d6b540d27b00 RTC: 186584 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53952 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/targeting/common')
-rw-r--r--src/include/usr/targeting/common/target.H90
-rw-r--r--src/include/usr/targeting/common/targetservice.H25
2 files changed, 100 insertions, 15 deletions
diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H
index 7bdd16f54..21f3d7fba 100644
--- a/src/include/usr/targeting/common/target.H
+++ b/src/include/usr/targeting/common/target.H
@@ -64,7 +64,7 @@ namespace RT_TARG
void adjustTargeting4Runtime();
ERRORLOG::ErrlEntry* saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
- uint64_t& o_userdata2);
+ uint8_t i_instance);
}
#endif
@@ -180,6 +180,34 @@ class Target
typename AttributeTraits<A>::Type getAttr() const;
/**
+ * @brief Get the target's specified attribute value
+ *
+ * Returns the target's specified attribute value. If the specified
+ * attribute does not exist for the associated target, the routine
+ * asserts. Thus callers must be sure the attribute exists for the
+ * given target.
+ *
+ * @param[in] i_attrRP Pointer to attribute resource provider
+ * @param[in] i_pAttrId Pointer to array of attribute IDs for target
+ * @param[in] i_ppAttrAddr Pointer to array of attribute addresses
+ *
+ * @pre Target service must be initialized
+ *
+ * @post Target's specified attribute value returned, or assert
+ * called if specified attribute doesn't exist for the
+ * associated target
+ *
+ * @return Data type associated with the attribute being returned
+ *
+ * @retval Varies The attribute data
+ */
+ template<const ATTRIBUTE_ID A>
+ typename AttributeTraits<A>::Type getAttr(AttrRP* i_attrRP,
+ ATTRIBUTE_ID* i_pAttrId,
+ AbstractPointer<void>*
+ i_ppAttrAddr) const;
+
+ /**
* @brief DEBUG ONLY! Returns the requested attribute as a string
*
* Returns the attribute value (for the associated target) as a string.
@@ -480,6 +508,39 @@ class Target
void* io_attrData) const;
/**
+ * @brief Tries to get the target's specified attribute value without
+ * checking for valid values. Do not call this function
+ * directly. This function is private.
+ *
+ * Tries to get the target's specified attribute value
+ *
+ * @param[in] i_attr Attribute to retrieve
+ * @param[in] i_size Size of the attribute
+ * @param[in] i_attrRP Pointer to attribute resource provider
+ * @param[in] i_pAttrId Pointer to array of attribute IDs for target
+ * @param[in] i_ppAttrAddr Pointer to array of attribute addresses
+ * @param[in/out] io_attrData On input, location to store the attribute
+ * On output, location updated with attribute data
+ *
+ * @pre Target service must be initialized
+ *
+ * @post Caller notified if attribute retrieval succeeded or not. If
+ * so, the attribute data is stored at io_addrData
+ *
+ * @return bool indicating if attribute retrieval succeeded or not
+ *
+ * @retval true Attribute retrieval succeeded
+ * @retval false Attribute retrieval failed
+ */
+ bool _tryGetAttrUnsafe(
+ ATTRIBUTE_ID i_attr,
+ uint32_t i_size,
+ AttrRP* i_attrRP,
+ ATTRIBUTE_ID* i_pAttrId,
+ AbstractPointer<void>* i_ppAttrAddr,
+ void* io_attrData) const;
+
+ /**
* @brief Tries to set the target's specified attribute value
*
* Tries to set the target's specified attribute value
@@ -704,7 +765,7 @@ class Target
friend void RT_TARG::adjustTargeting4Runtime();
friend ERRORLOG::ErrlEntry* RT_TARG::saveRestoreAttrs(void *,
void *,
- uint64_t&);
+ uint8_t);
#endif
@@ -764,6 +825,31 @@ typename AttributeTraits<A>::Type Target::getAttr() const
}
template<const ATTRIBUTE_ID A>
+typename AttributeTraits<A>::Type Target::getAttr(AttrRP* i_attrRP,
+ ATTRIBUTE_ID* i_pAttrId,
+ AbstractPointer<void>*
+ i_ppAttrAddr) const
+{
+ typename AttributeTraits<A>::Type l_attrValue;
+ if(AttributeTraits<A>::readable) { }
+ if(AttributeTraits<A>::notHbMutex) { }
+ if(AttributeTraits<A>::notFspMutex) { }
+
+ bool l_read = _tryGetAttrUnsafe(A,
+ sizeof(l_attrValue),
+ i_attrRP,
+ i_pAttrId,
+ i_ppAttrAddr,
+ reinterpret_cast<void*>(&l_attrValue));
+
+ if (unlikely(!l_read))
+ {
+ targAssert(GET_ATTR, A);
+ }
+ return l_attrValue;
+}
+
+template<const ATTRIBUTE_ID A>
void Target::setAttr(typename AttributeTraits<A>::Type const& i_attrValue)
{
bool l_wrote = trySetAttr<A>(i_attrValue);
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index c02826b77..82001c0ae 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -726,31 +726,30 @@ class TargetService
void getMasterNodeTarget(Target*& o_masterNodeTarget) const;
/**
- * @brief Returns Target Range Filter information.
+ * @brief Returns Array of Targets from Targeting Image.
*
* @par Detailed Description:
- * Returns the Target Range Filter information for the specified
- * attribute data and resource provider.
+ * Returns a pointer to the Array of Targets found in the Targeting
+ * Image as provided by the Attribute Data.
*
* @param[in] i_attrData pointer to attribute data
*
- * @param[in] i_attrRP pointer to attribute resource provider
+ * @param[in] i_nodeId, node ID for the targeting image
*
- * @param[out] o_maxTargets maximum targets in the range
+ * @param[in] i_attrRP pointer to attribute resource provider
*
- * @param[in] i_nodeId, node ID for the target.
+ * @param[out] o_maxTargets maximum targets in image
*
* @pre TargetService must be initialized.
*
- * @post Returns the Target Range Filter information for the specified
- * attribute data and resource provider.
+ * @post Returns pointer to Array of Targets from Targeting Image.
*
- * @return TargetRangeFilter
+ * @return Target*
*/
- TargetRangeFilter getTargetRangeFilter(void *i_attrData,
- AttrRP *i_attrRP,
- uint32_t &o_maxTargets,
- NODE_ID i_nodeId);
+ Target* getTargetArray(void *i_attrData,
+ NODE_ID i_nodeId,
+ AttrRP *i_attrRP,
+ uint32_t &o_maxTargets);
/**
* @brief Returns Target Attribute information.
OpenPOWER on IntegriCloud