diff options
| author | Stephen Cprek <smcprek@us.ibm.com> | 2014-03-26 13:12:57 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-04-04 10:56:27 -0500 |
| commit | 214b4da81b98c19c5dd8eb30b56b3b4d5d38e1c8 (patch) | |
| tree | 5698b5251695fe1bc406610c3e3a2f8ed746085f /src/include/usr/targeting/common | |
| parent | 1be9762f6c1112555176ba474fe9a294c2ff1d95 (diff) | |
| download | talos-hostboot-214b4da81b98c19c5dd8eb30b56b3b4d5d38e1c8.tar.gz talos-hostboot-214b4da81b98c19c5dd8eb30b56b3b4d5d38e1c8.zip | |
Deconfigure targets by checking presence related targets
Centaurs behind a non-present processor are not being deconfigured
Change-Id: I2574d75d76d7b7c1f4a0089193a2f361b7ac7e13
RTC: 99406
CQ: SW253452
Backport: release-fips810
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9921
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/targeting/common')
| -rw-r--r-- | src/include/usr/targeting/common/entitypath.H | 25 | ||||
| -rw-r--r-- | src/include/usr/targeting/common/utilFilter.H | 21 |
2 files changed, 43 insertions, 3 deletions
diff --git a/src/include/usr/targeting/common/entitypath.H b/src/include/usr/targeting/common/entitypath.H index cee5422cc..13fa86d39 100644 --- a/src/include/usr/targeting/common/entitypath.H +++ b/src/include/usr/targeting/common/entitypath.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ /* */ /* p1 */ /* */ @@ -255,6 +255,29 @@ class EntityPath const EntityPath& i_rhs) const; /** + * @brief Returns whether an entity path is logically less than + * another entity path (lexicographical order) + * + * Returns whether an entity path is logically less than another. + * This determination takes into account the entity path type, the + * number of path elements, and the values of the path elements + * themselves. + * + * @param[in] i_rhs Const reference to entity path to compare + * + * @pre N/A + * + * @post Equality returned to caller + * + * @return bool indicating whether an entity path is logically less + * than another entity path + * + * @retval true The lhs entity path is logically less than rhs + * @retval false The lhs entity path is logically greater than rhs + */ + bool operator<(const EntityPath& i_rhs) const; + + /** * @brief Returns whether two entity paths are logically equal, but * only for the specified number of path elements * diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H index 0e381286d..021dceb74 100644 --- a/src/include/usr/targeting/common/utilFilter.H +++ b/src/include/usr/targeting/common/utilFilter.H @@ -34,7 +34,6 @@ #include <targeting/common/iterators/targetiterator.H> #include <targeting/common/iterators/rangefilter.H> - namespace TARGETING { @@ -59,7 +58,25 @@ namespace TARGETING * * @return bool, true if t1 HUID < t2 HUID, false otherwise */ -bool compareTargetHuid(TargetHandle_t t1, TargetHandle_t t2); +inline bool compareTargetHuid(TargetHandle_t t1, TargetHandle_t t2) +{ + return (t1->getAttr<ATTR_HUID>() < t2->getAttr<ATTR_HUID>()); +} + +/** + * @brief Predicate function to sort by Affinity path (lexicographical order) + * + * @parm[in] t1, Target 1 for AffinityPath comparison against target 2 + * @parm[in] t2, Target 2 for AffinityPath comparison against target 1 + * + * @return bool, true if t1 AffinityPath < t2 AffinityPath, false otherwise + */ +inline bool compareAffinity(TargetHandle_t t1, TargetHandle_t t2) +{ + EntityPath t1_Affinity = t1->getAttr<ATTR_AFFINITY_PATH>(); + EntityPath t2_Affinity = t2->getAttr<ATTR_AFFINITY_PATH>(); + return t1_Affinity < t2_Affinity; +} /** * @brief Populate the o_vector with target chip pointers based on the |

