diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2013-10-11 20:39:35 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-14 14:18:35 -0500 |
commit | b25e9ea38a25fa0de1339e1eeec15071ba332c04 (patch) | |
tree | 0fec60690196dbc149c72cc84913e96c749eff6d | |
parent | aefee3fd76899e3ef3b69a5cc9d2b02d1bd2dd08 (diff) | |
download | talos-hostboot-b25e9ea38a25fa0de1339e1eeec15071ba332c04.tar.gz talos-hostboot-b25e9ea38a25fa0de1339e1eeec15071ba332c04.zip |
Fix multinode rawiterator and CDIMM RID numbering issue
- Fixed improper rawiterator derivation from regular iterator
- Added CDIMM RID multiplier to MRW parser
Change-Id: I37cbc939eebe52da683f5a82eff1e789653afadf
RTC: 63940
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6662
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
5 files changed, 90 insertions, 31 deletions
diff --git a/src/include/usr/targeting/common/commontargeting.H b/src/include/usr/targeting/common/commontargeting.H index c1a52a703..9bf461f72 100644 --- a/src/include/usr/targeting/common/commontargeting.H +++ b/src/include/usr/targeting/common/commontargeting.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/targeting/common/commontargeting.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/targeting/common/commontargeting.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef __TARGETING_COMMON_COMMONTARGETING_H #define __TARGETING_COMMON_COMMONTARGETING_H @@ -34,7 +34,6 @@ // Includes //****************************************************************************** -#include <targeting/common/targreasoncodes.H> #include <targeting/common/attributes.H> #include <targeting/common/iterators/iterators.H> #include <targeting/common/predicates/predicates.H> diff --git a/src/include/usr/targeting/common/iterators/rawtargetiterator.H b/src/include/usr/targeting/common/iterators/rawtargetiterator.H index f7e9f192e..67b1ce536 100644 --- a/src/include/usr/targeting/common/iterators/rawtargetiterator.H +++ b/src/include/usr/targeting/common/iterators/rawtargetiterator.H @@ -87,7 +87,7 @@ class _TargetRawIterator : public _TargetIterator<T> */ ALWAYS_INLINE _TargetRawIterator() - : iv_pCurrent(NULL) + : _TargetIterator<T>(NULL) { } @@ -99,11 +99,30 @@ class _TargetRawIterator : public _TargetIterator<T> */ ALWAYS_INLINE explicit _TargetRawIterator(T i_pTarget) - : iv_pCurrent(i_pTarget) + : _TargetIterator<T>(i_pTarget) { } /** + * @brief Pre-increment the iterator + * + * @return The reference to the same iterator after advancing it + */ + ALWAYS_INLINE + _TargetRawIterator& operator++(); + + /** + * @brief Post-increment the iterator + * + * @param[in] UNNAMED Dummy parameter used to distinguish + * this interface from pre-increment + * + * @return Copy of the original iterator before it advanced + */ + ALWAYS_INLINE + _TargetRawIterator operator++(int); + + /** * @brief Destroy an iterator to a (const/non-const) target handle * * @note Iterator does not own any resources to destroy @@ -113,6 +132,17 @@ class _TargetRawIterator : public _TargetIterator<T> { } + /** + * @brief Copy constructor; assign iterator to a new iterator (such + * that they logically point to same entity) + * + * @param[in] i_rhs The iterator to assign + */ + ALWAYS_INLINE + _TargetRawIterator(const _TargetRawIterator& i_rhs) + : _TargetIterator<T>(i_rhs) + { + } private: @@ -121,8 +151,6 @@ class _TargetRawIterator : public _TargetIterator<T> * the target service (or end() if end of list) */ void advance(); - - T iv_pCurrent; // Pointer to current target }; /** @@ -131,6 +159,29 @@ class _TargetRawIterator : public _TargetIterator<T> typedef _TargetRawIterator<Target*> TargetRawIterator; typedef _TargetRawIterator<const Target*> ConstTargetRawIterator; +//****************************************************************************** +// _TargetRawIterator::operator++ (postincrement) +//****************************************************************************** + +template<typename T> +_TargetRawIterator<T> _TargetRawIterator<T>::operator++(int) +{ + _TargetRawIterator l_originalIterator(*this); + advance(); + return l_originalIterator; +} + +//****************************************************************************** +// _TargetRawIterator::operator++ (preincrement) +//****************************************************************************** + +template<typename T> +_TargetRawIterator<T>& _TargetRawIterator<T>::operator++() +{ + advance(); + return *this; +} + #undef TARG_CLASS #undef TARG_NAMESPACE diff --git a/src/include/usr/targeting/common/iterators/targetiterator.H b/src/include/usr/targeting/common/iterators/targetiterator.H index 65e80b8b5..772a95769 100644 --- a/src/include/usr/targeting/common/iterators/targetiterator.H +++ b/src/include/usr/targeting/common/iterators/targetiterator.H @@ -241,6 +241,8 @@ class _TargetIterator */ void advance(); + protected: + T iv_pCurrent; // Pointer to current target }; diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 7bff313b6..0b0f9e734 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -685,6 +685,8 @@ use constant BUS_POS_FIELD => 6; use constant BUS_ORDINAL_FIELD => 7; use constant DIMM_POS_FIELD => 8; +use constant CDIMM_RID_NODE_MULTIPLIER => 32; + my @Membuses; foreach my $i (@{$memBus->{'memory-bus'}}) { @@ -1124,7 +1126,9 @@ for my $i ( 0 .. $#STargets ) { die "ERROR. Can't locate Centaur from memory bus table\n"; } - my $relativeCentaurRid = $STargets[$i][PLUG_POS]; + + my $relativeCentaurRid = $STargets[$i][PLUG_POS] + + (CDIMM_RID_NODE_MULTIPLIER * $STargets[$i][NODE_FIELD]); #should note that the $SortedVmem is sorted by node and position and #currently $STargets is also sorted by node and postion. If this ever @@ -2704,7 +2708,9 @@ sub generate_dimm # Adjust offset basedon processor value $vpdRec = ($proc * 64) + $vpdRec; - my $dimmHex=sprintf("0xD0%02X",$relativePos); + my $dimmHex = sprintf("0xD0%02X",$relativePos + + (CDIMM_RID_NODE_MULTIPLIER * ${node})); + print " <targetInstance> <id>sys${sys}node${node}dimm$dimm</id> diff --git a/src/usr/targeting/common/iterators/rawtargetiterator.C b/src/usr/targeting/common/iterators/rawtargetiterator.C index 9946a3d0f..a9912ad43 100644 --- a/src/usr/targeting/common/iterators/rawtargetiterator.C +++ b/src/usr/targeting/common/iterators/rawtargetiterator.C @@ -70,9 +70,10 @@ void _TargetRawIterator<T>::advance() // If cursor points to end()/NULL, do nothing. Otherwise, check to see if // it should advance (possibly to NULL) - if(iv_pCurrent != NULL) + if(_TargetIterator<T>::iv_pCurrent != NULL) { - iv_pCurrent = l_targetService.getNextTarget(iv_pCurrent); + _TargetIterator<T>::iv_pCurrent = + l_targetService.getNextTarget(_TargetIterator<T>::iv_pCurrent); } } |