summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2015-01-14 16:49:13 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-16 11:58:19 -0600
commit9df486caf53c9bb23ab188eaacf0d9d5e602745f (patch)
treeeb991f2a8ccbfe9da58b91f448d2b7b270d17c2f
parent002c4beefb54d288eee8faf4d9aa2b08b137aed3 (diff)
downloadtalos-hostboot-9df486caf53c9bb23ab188eaacf0d9d5e602745f.tar.gz
talos-hostboot-9df486caf53c9bb23ab188eaacf0d9d5e602745f.zip
PRD: replaced deque with list in TdQueue
Change-Id: I8b097a0df845bf7b525559a2a31f3e733e2ca2af RTC: 119023 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15137 Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Tested-by: Jenkins Server Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15736 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/usr/diag/prdf/common/runtime/prdfCenMbaTdCtlr_rt.C8
-rwxr-xr-xsrc/usr/diag/prdf/common/runtime/prdfCenMbaTdQueue.H28
2 files changed, 11 insertions, 25 deletions
diff --git a/src/usr/diag/prdf/common/runtime/prdfCenMbaTdCtlr_rt.C b/src/usr/diag/prdf/common/runtime/prdfCenMbaTdCtlr_rt.C
index fbaa4c51e..cde91d46e 100755
--- a/src/usr/diag/prdf/common/runtime/prdfCenMbaTdCtlr_rt.C
+++ b/src/usr/diag/prdf/common/runtime/prdfCenMbaTdCtlr_rt.C
@@ -3113,11 +3113,11 @@ void CenMbaTdCtlr::collectStateCaptureData( STEP_CODE_DATA_STRUCT & io_sc,
data[sz_actData] = queueCount;
sz_actData += 1;
- for ( uint32_t i = 0; i < queueCount; i++ )
+ for ( TdQueue::QueueItr it = queue.begin(); it != queue.end(); it++ )
{
- data[sz_actData ] = queue[i].type;
- data[sz_actData+1] = queue[i].rank.getMaster() << 5 |
- queue[i].rank.getSlave() << 2; // 2 extra bits
+ data[sz_actData ] = it->type;
+ data[sz_actData+1] = it->rank.getMaster() << 5 |
+ it->rank.getSlave() << 2; // 2 extra bits
sz_actData += 2;
}
diff --git a/src/usr/diag/prdf/common/runtime/prdfCenMbaTdQueue.H b/src/usr/diag/prdf/common/runtime/prdfCenMbaTdQueue.H
index 2d595d8ba..ba55cd763 100755
--- a/src/usr/diag/prdf/common/runtime/prdfCenMbaTdQueue.H
+++ b/src/usr/diag/prdf/common/runtime/prdfCenMbaTdQueue.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,13 +39,7 @@
// Other includes
#include <algorithm>
-// TODO: RTC 119023 remove after deque is supported in HBRT
-#ifdef __HOSTBOOT_RUNTIME
-// deque currently not supported in Hostboot.
#include <vector>
-#else
-#include <queue>
-#endif
namespace PRDF
{
@@ -79,15 +73,8 @@ class TdQueue
{
public: // typedefs
-// TODO: RTC 119023 remove after deque is supported in HBRT
-#ifdef __HOSTBOOT_RUNTIME
- // deque currently not supported in Hostboot.
typedef std::vector<TdQueueEntry> Queue;
typedef std::vector<TdQueueEntry>::iterator QueueItr;
-#else
- typedef std::deque<TdQueueEntry> Queue;
- typedef std::deque<TdQueueEntry>::iterator QueueItr;
-#endif
public:
@@ -146,13 +133,12 @@ class TdQueue
/**
* @brief Removes the entry at the beginning of the queue.
*/
-// TODO: RTC 119023 remove after deque is supported in HBRT
-#ifdef __HOSTBOOT_RUNTIME
- // deque currently not supported in Hostboot.
- void pop() {}
-#else
- void pop() { iv_queue.pop_front(); }
-#endif
+ // TODO: RTC 66487 This function currently has a complexity of 0(n). It
+ // is preferred to have 0(1), which could be accomplished with by
+ // using a deque or list. Unfortunately, Hostboot currently does not
+ // support std::deque or std::list::sort(). Therefore, we must use a
+ // vector at this time.
+ void pop() { iv_queue.erase(iv_queue.begin()); }
/**
* @return A constant reference to the queue.
OpenPOWER on IntegriCloud