diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-10-03 16:12:51 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-10-24 13:33:20 -0500 |
commit | 4962a22309cd7e3586aa57817689b18d67ca71c7 (patch) | |
tree | 2bfd610d6ed048f7d4a35717211eca06b15d1f69 /src/kernel/msghandler.C | |
parent | 21185b30cd99a00f01e15edba28402cdc00de1d1 (diff) | |
download | talos-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/msghandler.C')
-rw-r--r-- | src/kernel/msghandler.C | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/msghandler.C b/src/kernel/msghandler.C index 32da05673..82dab7f8f 100644 --- a/src/kernel/msghandler.C +++ b/src/kernel/msghandler.C @@ -29,8 +29,6 @@ #include <kernel/taskmgr.H> #include <kernel/console.H> -namespace Systemcalls { void TaskEnd(task_t*); }; - void MessageHandler::sendMessage(msg_sys_types_t i_type, void* i_key, void* i_data, task_t* i_task) { @@ -74,6 +72,11 @@ void MessageHandler::sendMessage(msg_sys_types_t i_type, void* i_key, // Defer task while waiting for message response. if ((NULL != i_task) && (TaskManager::getCurrentTask() == i_task)) { + // Set block status. + i_task->state = TASK_STATE_BLOCK_USRSPACE; + i_task->state_info = i_key; + + // Select next task off scheduler. i_task->cpu->scheduler->setNextRunnable(); } @@ -138,7 +141,7 @@ int MessageHandler::recvMessage(msg_t* i_msg) // Unsuccessful, unhandled response. Kill task. printk("Unhandled msg rc %d for key %p on task %d @ %p\n", msg_rc, key, deferred_task->tid, deferred_task->context.nip); - Systemcalls::TaskEnd(deferred_task); + TaskManager::endTask(deferred_task, NULL, TASK_STATUS_CRASHED); } else if (CONTINUE_DEFER == rc) { |