Fixes change_to_vcore failure case
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 Oct 2012 01:00:11 +0000 (18:00 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 Oct 2012 01:02:47 +0000 (18:02 -0700)
commitd9513a404b135daa10899d43c32cc935f0066ae7
tree57237a44424469843adea831fffb1f159c0a78fe
parent87c0e41132bcb435a793b72ed0a7f97b7ac67d8c
Fixes change_to_vcore failure case

sys_change_vcore() could fail for a few reasons.  Previously, userspace
was assuming that if it failed it was because the vcore was already
running.  However, it can fail because the caller is getting preempted.

Changes the syscall to pass back a return value based on the type of
failure.  Userspace now continues to attempt to change until it not
longer is told to try again.

Note that it is not necessary to loop in code like ensure_vcore_runs,
since those functions are already called in busy loops.
kern/include/process.h
kern/src/process.c
kern/src/syscall.c
user/parlib/include/parlib.h
user/parlib/syscall.c
user/parlib/uthread.c