syslets: add generic syslets infrastructure
authorZach Brown <zach.brown@oracle.com>
Thu, 6 Dec 2007 23:20:18 +0000 (15:20 -0800)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 22 Jan 2008 09:35:00 +0000 (10:35 +0100)
commitc57e2d7c3bc753c48f5a8eb0109fb92840ec5f59
treee01411aec9fd509ec5ba8021ee203ee52528f551
parent63b5127fb6f4e2a6b2af887a01e98ecb670de136
syslets: add generic syslets infrastructure

The indirect syslet arguments specify where to store the completion and what
function in userspcae to return to once the syslet has been executed.  The
details of how we pass the indirect syslet arguments needs help.

We parse the indirect syslet arguments in sys_indirect() before we call
the given system call.  If they're OK we mark the task as ready to become
a syslet.  We make sure that there is a child task waiting.

We call into kernel/syslet.c from the scheduler when we try to block a task
which has been marked as ready.   A child task is woken and returns to
userspace.

We store the result of the system call in the userspace ring back up in
sys_indrect() as the system call finally finishes.  At that point the original
task returns to the frame that userspace provided in the indirect syslet args.

This generic infrastructure relies on architecture specific routines to create
a new child task, move userspace state from one kernel task to another, and to
setup the userspace return frame in ptregs.  Code in asm-generic just returns
-EINVAL until an architecture provides the needed routines.

This is a simplification of Ingo's more involved syslet and threatlet
infrastructure which was built around 'uatoms'.  Enough code has changed that
it wasn't appropriate to bring the previous Signed-off-by lines forward.

Signed-off-by: Zach Brown <zach.brown@oracle.com>;
Signed-off-by: Jens Axboe <axboe@axboetest.dk.oracle.com>
fs/exec.c
include/asm-generic/errno.h
include/linux/sched.h
include/linux/syscalls.h
include/linux/syslet.h [new file with mode: 0644]
kernel/Makefile
kernel/exit.c
kernel/fork.c
kernel/indirect.c
kernel/sched.c
kernel/syslet.c [new file with mode: 0644]