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>