summaryrefslogtreecommitdiffstats
path: root/src/sys/vfs/vfs_main.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/sys/vfs/vfs_main.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/sys/vfs/vfs_main.C')
-rw-r--r--src/sys/vfs/vfs_main.C30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/sys/vfs/vfs_main.C b/src/sys/vfs/vfs_main.C
index 06a7f9d07..17de12295 100644
--- a/src/sys/vfs/vfs_main.C
+++ b/src/sys/vfs/vfs_main.C
@@ -39,16 +39,6 @@ const char* VFS_ROOT_MSG_VFS = "/msg/vfs";
void vfs_module_init();
-/**
- * Call the module start routine
- * @param[in] i_module VfsSystemModule data for the module
- * @param[in] i_param parameter to pass to task_create() for this module
- * @return tid_t of started task or negative value on error.
- * @retval -ENOENT if i_module is NULL
- * @retval -ENOEXEC if there is no start()
- */
-tid_t vfs_exec(VfsSystemModule * i_module, void* i_param);
-
struct VfsPath
{
char key[64];
@@ -123,13 +113,14 @@ void vfs_main(void* i_barrier)
vfs_find_module(VFS_MODULES,
(const char *) msg->data[0]);
- tid_t child = vfs_exec(module,(void*) msg->data[1]);
+ void* fnptr = vfs_start_entrypoint(module);
// child == -ENOENT means module not found in base image
// so send a message to VFS_MSG queue to look in the
// extended image VFS_MSG queue will handle the
// msg_respond()
- if( child == (tid_t)-ENOENT ) // forward msg to usr vfs
+ if( fnptr == reinterpret_cast<void*>(-ENOENT) )
+ // forward msg to usr vfs
{
VfsEntry::key_type k;
strcpy(k.key, VFS_ROOT_MSG_VFS);
@@ -144,13 +135,13 @@ void vfs_main(void* i_barrier)
}
else // Cant find VFS_MSG queue - not started yet
{
- msg->data[0] = child;
+ msg->data[0] = (uint64_t) fnptr;
msg_respond(vfsMsgQ, msg);
}
}
else // send back child (or errno)
{
- msg->data[0] = child;
+ msg->data[0] = (uint64_t) fnptr;
msg_respond(vfsMsgQ, msg);
}
}
@@ -165,21 +156,22 @@ void vfs_main(void* i_barrier)
// ----------------------------------------------------------------------------
-tid_t vfs_exec(VfsSystemModule * i_module, void* i_param)
+void* vfs_start_entrypoint(VfsSystemModule * i_module)
{
- tid_t child = -ENOENT;
+ void* ptr = reinterpret_cast<void*>(-ENOENT);
if(i_module != NULL)
{
if (i_module->start == NULL)
{
- child = -ENOEXEC; // module has no start() routine
+ // module has no start() routine
+ ptr = reinterpret_cast<void*>(-ENOEXEC);
}
else
{
- child = task_create(i_module->start, i_param);
+ ptr = reinterpret_cast<void*>(i_module->start);
}
}
- return child;
+ return ptr;
}
OpenPOWER on IntegriCloud