From 2dfa56b49d0ea5cbabea1a85c68964e626f3d345 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Tue, 18 Sep 2018 08:42:45 -0500 Subject: Deconfig parent rollup simplified Create a common deconfiguration rollup to parent. A new attribute was created to indicate when to stop rolling up the parent branch Change-Id: I80954081527f29bc466622d30644115a96be385f RTC:193268 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66444 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell --- src/usr/targeting/common/utilFilter.C | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/usr/targeting/common/utilFilter.C') diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C index 2be7cdabb..3675dfb04 100644 --- a/src/usr/targeting/common/utilFilter.C +++ b/src/usr/targeting/common/utilFilter.C @@ -455,6 +455,38 @@ const Target * getParentChip( const Target * i_pChiplet ) return l_pChip; } +Target * getImmediateParentByAffinity(const Target * i_child ) +{ + Target * l_parent = NULL; + + // Create a vector of TARGETING::Target pointers + TARGETING::TargetHandleList l_chipList; + + // Get parent + TARGETING::targetService().getAssociated(l_chipList, i_child, + TARGETING::TargetService::PARENT_BY_AFFINITY, + TARGETING::TargetService::IMMEDIATE, NULL); + + if (l_chipList.size() == 1) + { + l_parent = l_chipList[0]; + } + else if (l_chipList.size() == 0) + { + TARG_ERR("Failed to find a parent target for huid=%.8X", + TARGETING::get_huid(i_child)); + } + else + { + TARG_ERR("Found %d parent targets for huid=%.8X, only expected to find 1", + l_chipList.size(), + TARGETING::get_huid(i_child)); + } + + return l_parent; +} + + Target * getParent( const Target * i_unit , TARGETING::TYPE &i_pType) { Target * l_parent = NULL; -- cgit v1.2.1