summaryrefslogtreecommitdiffstats
path: root/src/kernel/timemgr.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-10-03 16:12:51 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-10-24 13:33:20 -0500
commit4962a22309cd7e3586aa57817689b18d67ca71c7 (patch)
tree2bfd610d6ed048f7d4a35717211eca06b15d1f69 /src/kernel/timemgr.C
parent21185b30cd99a00f01e15edba28402cdc00de1d1 (diff)
downloadtalos-hostboot-4962a22309cd7e3586aa57817689b18d67ca71c7.tar.gz
talos-hostboot-4962a22309cd7e3586aa57817689b18d67ca71c7.zip
Support task_wait / task_wait_tid syscalls:
- Add task_end2 syscall to allow pthread_exit-like retval. - Add/maintain task states. - Create task parent/child tracking tree. - Add task_detach function. - Implement wait syscalls. Make task_exec caller the parent of spawned task: Previously the task_exec call caused a message to the VFS task, which called task_create and returned the tid in response to the message. This causes the parent of the spawned task to appear to be the VFS task. Modify task_exec / VFS handling to instead return the entry point address on the message and have task_exec call task_create directly itself. Change-Id: I6b6796f45875de37b1ab01e7596639b073820b95 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/443 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'src/kernel/timemgr.C')
-rw-r--r--src/kernel/timemgr.C8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kernel/timemgr.C b/src/kernel/timemgr.C
index cbe72440b..896871a4d 100644
--- a/src/kernel/timemgr.C
+++ b/src/kernel/timemgr.C
@@ -23,6 +23,7 @@
#include <kernel/timemgr.H>
#include <kernel/scheduler.H>
#include <util/singleton.H>
+#include <kernel/task.H>
uint64_t TimeManager::iv_timebaseFreq = 0xFFFFFFFF;
@@ -40,7 +41,7 @@ uint64_t TimeManager::convertSecToTicks(uint64_t i_sec, uint64_t i_nsec)
{
// This code will handle times almost up to a year without overflowing a
// uint64. This should be more than sufficient for our purposes.
-
+
// Result = ((sec * 10^9 + nsec) * tb) / 10^9.
uint64_t result = ((i_sec * 1000000000ULL) + i_nsec);
result *= (iv_timebaseFreq / 1000000);
@@ -57,10 +58,13 @@ void TimeManager::_delayTask(task_t* t, uint64_t i_sec, uint64_t i_nsec)
{
_TimeManager_Delay_t* node = new _TimeManager_Delay_t();
- node->key = this->getCurrentTimeBase() +
+ node->key = this->getCurrentTimeBase() +
this->convertSecToTicks(i_sec, i_nsec);
node->task = t;
+ t->state = TASK_STATE_BLOCK_SLEEP;
+ t->state_info = (void*)node->key;
+
iv_taskList[getPIR()].insert(node);
}
OpenPOWER on IntegriCloud