summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/kernel/deferred.H10
-rw-r--r--src/kernel/cpumgr.C6
-rw-r--r--src/kernel/deferred.C10
-rw-r--r--src/usr/intr/intrrp.H3
4 files changed, 19 insertions, 10 deletions
diff --git a/src/include/kernel/deferred.H b/src/include/kernel/deferred.H
index f80a47bdb..5d22557c3 100644
--- a/src/include/kernel/deferred.H
+++ b/src/include/kernel/deferred.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -149,11 +151,13 @@ class DeferredQueue
/** Insert a work item into the queue.
*
* @param i_work - The item to add.
+ * @param i_onlyIfEmpty - Only insert the object if the queue is
+ * already empty, otherwise delete.
*
* Ownership of the work item is transfered to the queue, which is
* responsible for delete once the work is complete.
*/
- static void insert(DeferredWork* i_work);
+ static void insert(DeferredWork* i_work, bool i_onlyIfEmpty = false);
/** Execute any pending work items. */
static void execute();
@@ -161,7 +165,7 @@ class DeferredQueue
friend class DeferredWork;
// Instance functions for static pair.
- void _insert(DeferredWork* i_work);
+ void _insert(DeferredWork* i_work, bool i_onlyIfEmpty);
void _execute();
/** Remove a completed work item from the queue.
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index ba3b08356..44f61a173 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -293,7 +295,7 @@ void CpuManager::startSlaveCPU(cpu_t* cpu)
};
SyncTimebase* deferred = new SyncTimebase();
- DeferredQueue::insert(deferred);
+ DeferredQueue::insert(deferred, true /* only if empty */);
DeferredQueue::execute();
}
diff --git a/src/kernel/deferred.C b/src/kernel/deferred.C
index 8963226fc..af8a10189 100644
--- a/src/kernel/deferred.C
+++ b/src/kernel/deferred.C
@@ -60,10 +60,10 @@ DeferredQueue::~DeferredQueue()
kassert(0 == iv_cpus_and_next);
}
-void DeferredQueue::insert(DeferredWork* i_work)
+void DeferredQueue::insert(DeferredWork* i_work, bool i_onlyIfEmpty)
{
// Call singleton insert.
- Singleton<DeferredQueue>::instance()._insert(i_work);
+ Singleton<DeferredQueue>::instance()._insert(i_work, i_onlyIfEmpty);
}
void DeferredQueue::execute()
@@ -72,7 +72,7 @@ void DeferredQueue::execute()
Singleton<DeferredQueue>::instance()._execute();
}
-void DeferredQueue::_insert(DeferredWork* i_work)
+void DeferredQueue::_insert(DeferredWork* i_work, bool i_onlyIfEmpty)
{
lock.lock();
@@ -81,6 +81,10 @@ void DeferredQueue::_insert(DeferredWork* i_work)
{
iv_cpus_and_next = reinterpret_cast<uint64_t>(i_work);
}
+ else if (i_onlyIfEmpty)
+ {
+ delete i_work;
+ }
else
{
// Follow linked list to last work item.
diff --git a/src/usr/intr/intrrp.H b/src/usr/intr/intrrp.H
index 8a7360828..314ae5217 100644
--- a/src/usr/intr/intrrp.H
+++ b/src/usr/intr/intrrp.H
@@ -301,8 +301,7 @@ namespace INTR
enum
{
- // TODO: RTC 111512; change back to 1s
- CPU_WAKEUP_SECONDS = 2,
+ CPU_WAKEUP_SECONDS = 1,
CPU_WAKEUP_INTERVAL_COUNT = 10,
CPU_WAKEUP_INTERVAL_NS = (NS_PER_SEC * CPU_WAKEUP_SECONDS) /
CPU_WAKEUP_INTERVAL_COUNT,
OpenPOWER on IntegriCloud