summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/runtime/rt_targeting.H8
-rw-r--r--src/include/usr/targeting/attrrp.H51
-rw-r--r--src/include/usr/targeting/common/target.H90
-rw-r--r--src/include/usr/targeting/common/targetservice.H25
4 files changed, 143 insertions, 31 deletions
diff --git a/src/include/usr/runtime/rt_targeting.H b/src/include/usr/runtime/rt_targeting.H
index 9f3d96818..9070dbc88 100644
--- a/src/include/usr/runtime/rt_targeting.H
+++ b/src/include/usr/runtime/rt_targeting.H
@@ -67,12 +67,12 @@ namespace RT_TARG
* into new LID Structure data
* @param[in] Pointer to current Reserved Memory targeting binary data
* @param[in/out] Pointer to new LID Structure targeting binary data
- * @param[out] Error log userdata2 value associated with non-zero rtn code
+ * @param[in] Instance, ie, Node ID
* @return nullptr on success, else error log
*/
errlHndl_t saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
- uint64_t& o_userdata2);
+ uint8_t i_instance);
/**
* @brief Validate LID Structure against Reserved Memory. Check that the
@@ -82,13 +82,11 @@ namespace RT_TARG
* @param[in] Pointer to new LID Structure targeting binary data
* @param[in] Pointer to current Reserved Memory targeting binary data
* @param[out] Total size of all sections in the new lid
- * @param[out] Error log userdata2 value associated with non-zero rtn code
* @return nullptr on success, else error log
*/
errlHndl_t validateData(void *i_lidStructPtr,
void *i_rsvdMemPtr,
- size_t& o_lidTotalSize,
- uint64_t& o_userdata2);
+ size_t& o_lidTotalSize);
/**
* @brief Apply ATTR_TMP overrides to be available for run time
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index 6eb367e17..897e6dec4 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -114,7 +114,7 @@ class AttrRP
#else
friend errlHndl_t RT_TARG::saveRestoreAttrs(void *,
void *,
- uint64_t&);
+ uint8_t);
#endif
public:
@@ -306,14 +306,16 @@ class AttrRP
#else
/**
- * @brief Fill in new attribute resource provider for HBRT.
+ * @brief Get node instance status of attribute resource provider
+ * which indicates if the attribute resource provider is handling
+ * a single node or multiple nodes
*
- * @param[in] i_header
- * TargetingHeader to use with filling in the new RT AttrRP.
- *
- * @return void
+ * @return Node instance status
*/
- void fillInAttrRP(TargetingHeader* i_header);
+ NodeInstanceStatus getInstanceStatus()
+ {
+ return iv_instanceStatus;
+ }
/**
* @brief Get count of nodes handled by attribute resource provider.
@@ -352,12 +354,39 @@ class AttrRP
* @par Detailed Description:
* Ensures member variables are initialized to sane values.
*/
- AttrRP(TargetingHeader* i_header)
- : iv_isTempInstance(true), iv_instanceStatus(SINGLE_NODE),
+ AttrRP(TargetingHeader* i_header,
+ NODE_ID i_nodeId,
+ size_t i_nodeCount,
+ NodeInstanceStatus i_instanceStatus)
+ : iv_isTempInstance(true), iv_instanceStatus(i_instanceStatus),
iv_isMpipl(false)
{
- // Fill in member variables
- fillInAttrRP(i_header);
+ // Work with nodes before passed in node
+ for(NODE_ID l_nodeId = NODE0; l_nodeId < i_nodeCount; ++l_nodeId)
+ {
+ // Create local copy of container for node info struct
+ NodeInfo l_nodeCont;
+
+ if(l_nodeId == i_nodeId)
+ {
+ // Initialize local copy of container for node info struct
+ errlHndl_t l_errl = nodeInfoInit(l_nodeCont,
+ i_header,
+ i_nodeId);
+ if (l_errl)
+ {
+ l_errl->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
+
+ /* Commit the error */
+ errlCommit(l_errl, TARG_COMP_ID);
+
+ break;
+ }
+ }
+
+ // Push back node info struct into the node container
+ iv_nodeContainer.push_back(l_nodeCont);
+ }
};
#endif
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