diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2016-03-14 11:27:49 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-03-23 11:31:45 -0400 |
commit | 16ff4c0894f726ea97362536af36a413b1f255cd (patch) | |
tree | 78e5c57d3fe5307917dca729d444437db8ead3b3 /src/include | |
parent | efb976fc64fc447d93015d3bb950431f341b6c19 (diff) | |
download | talos-hostboot-16ff4c0894f726ea97362536af36a413b1f255cd.tar.gz talos-hostboot-16ff4c0894f726ea97362536af36a413b1f255cd.zip |
Support getChildren and getParent FAPI2 tests
- Added FAPI reason codes to support tests
- Added special handlers to getParent/getChildren for pervasive associations
- Added new APIs to filtering utilities to walk pervasive associations
- Updated getParent/getChildren tests to fully exercise pervasive associations
RTC: 148577
Change-Id: I0d8ec427e6c2092852a32c7da605d1c47c554b50
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22084
Tested-by: Jenkins Server
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: FSP CI Jenkins
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H | 1 | ||||
-rw-r--r-- | src/include/usr/fapi2/target.H | 50 | ||||
-rw-r--r-- | src/include/usr/targeting/common/utilFilter.H | 39 |
3 files changed, 82 insertions, 8 deletions
diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H index 4a8d10868..f08e34014 100644 --- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H +++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H @@ -88,6 +88,7 @@ namespace fapi2 RC_CAPP_NO_PROC_FOUND = FAPI2_COMP_ID | 0x20, RC_SBE_NO_PROC_FOUND = FAPI2_COMP_ID | 0x21, RC_INVALID_CHILD_COUNT = FAPI2_COMP_ID | 0x22, + RC_UNIT_NO_PERV_FOUND = FAPI2_COMP_ID | 0x23, // HWP generated errors RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f, diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H index c11454f2f..5eb375336 100644 --- a/src/include/usr/fapi2/target.H +++ b/src/include/usr/fapi2/target.H @@ -456,11 +456,24 @@ inline Target<T> Target<K, V>::getParent(void) const TARGETING::TYPE requiredPType = fapi2::convertFapi2TypeToTargeting(T); - TARGETING::getParentAffinityTargetsByState(l_parentList, - static_cast<TARGETING::Target*>(this->get()), - TARGETING::CLASS_NA, - requiredPType, - TARGETING::UTIL_FILTER_ALL); + if(T == fapi2::TARGET_TYPE_PERV) + { + TARGETING::getParentPervasiveTargetsByState( + l_parentList, + static_cast<TARGETING::Target*>(this->get()), + TARGETING::CLASS_NA, + requiredPType, + TARGETING::UTIL_FILTER_ALL); + } + else + { + TARGETING::getParentAffinityTargetsByState( + l_parentList, + static_cast<TARGETING::Target*>(this->get()), + TARGETING::CLASS_NA, + requiredPType, + TARGETING::UTIL_FILTER_ALL); + } assert(l_parentList.size() == 1, "Found %d parents of the same type. Target HUID %x , \ looking for parents of type %x", l_parentList.size(), TARGETING::get_huid(this->get()) , requiredPType); @@ -642,22 +655,43 @@ FAPI_DBG(ENTER_MRK "getChildren. Type 0x%08x State:0x%08x", T, i_state); TARGETING::TargetHandleList l_childList; bool l_functional = (i_state & fapi2::TARGET_STATE_FUNCTIONAL)? true:false; - if(!l_functional) { - TARGETING::getChildAffinityTargetsByState(l_childList, + if(K == fapi2::TARGET_TYPE_PERV) + { + TARGETING::getPervasiveChildTargetsByState(l_childList, + static_cast<TARGETING::Target*>(this->get()), + TARGETING::CLASS_NA, + l_type, + TARGETING::UTIL_FILTER_ALL); + } + else + { + TARGETING::getChildAffinityTargetsByState(l_childList, static_cast<TARGETING::Target*>(this->get()), TARGETING::CLASS_NA, l_type, TARGETING::UTIL_FILTER_ALL); + } } else { - TARGETING::getChildAffinityTargetsByState(l_childList, + if(K == fapi2::TARGET_TYPE_PERV) + { + TARGETING::getPervasiveChildTargetsByState(l_childList, + static_cast<TARGETING::Target*>(this->get()), + TARGETING::CLASS_NA, + l_type, + TARGETING::UTIL_FILTER_FUNCTIONAL); + } + else + { + TARGETING::getChildAffinityTargetsByState(l_childList, static_cast<TARGETING::Target*>(this->get()), TARGETING::CLASS_NA, l_type, TARGETING::UTIL_FILTER_FUNCTIONAL); + } } FAPI_DBG("getChildren: l_functional 0x%.8X, l_type = 0x%.8X, ChipUnitId 0x%.8X", diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H index 9c501f418..4771edace 100644 --- a/src/include/usr/targeting/common/utilFilter.H +++ b/src/include/usr/targeting/common/utilFilter.H @@ -183,6 +183,26 @@ void getChildAffinityTargetsByState ( TARGETING::TargetHandleList& o_vector, ResourceState i_state ); /** + * @brief Given an input target, finds all the targets linked to it via a + * PERVASIVE_CHILD relationship and writes them to the output vector. + * The class, type, and resource state further filter the set of results. + * + * @parm[out] o_vector, reference to vector of target pointers + * @parm[in] i_target, source target to search from + * @parm[in] i_class, class of the targets to be obtained + * @parm[in] i_type, type of the targets to be obtained + * @parm[in] i_state, specifies state the target should be in + * + * @return N/A + */ +void getPervasiveChildTargetsByState ( + TARGETING::TargetHandleList& o_vector, + const Target* i_target, + CLASS i_class, + TYPE i_type, + ResourceState i_state ); + +/** * @brief Populate the o_vector with target object pointers which are * affinity children of the input target * @@ -221,6 +241,25 @@ void getChildAffinityTargets ( TARGETING::TargetHandleList& o_vector, void getParentAffinityTargetsByState ( TARGETING::TargetHandleList& o_vector, const Target * i_target, CLASS i_class, TYPE i_type, ResourceState i_state ); +/** + * @brief Given an input target, finds all the targets linked to it via a + * PARENT_PERVASIVE relationship and writes them to the output vector. + * The class, type, and resource state further filter the set of results. + * + * @parm[out] o_vector, reference to vector of target pointers + * @parm[in] i_target, source target to search from + * @parm[in] i_class, class of the targets to be obtained + * @parm[in] i_type, type of the targets to be obtained + * @parm[in] i_state, specifies state the target should be in + * + * @return N/A + */ +void getParentPervasiveTargetsByState ( + TARGETING::TargetHandleList& o_vector, + const Target* i_target, + CLASS i_class, + TYPE i_type, + ResourceState i_state); /** * @brief Populate the o_vector with target object pointers which are |